Update supplied jar in PluginSdk with higher version in plugin

Answered

Hi all,

 

For a plugin I'm developing I'm want to use SQLite.

The PluginSDK already has this jar available: sqlite-jdbc-3.21.0.1.jar

But I want to use sqlite-jdbc-3.27.2.1.jar, as this includes new functionality I need.

 

When I (for development purposes) just update the jar in the PluginSDK, all is fine. But in this way I cannot release the plugin.

When I add the sqlite-jdbc-3.27.2.1.jar as a library, create build, install, I get an error:
java.lang.Throwable: No suitable driver found for jdbc:sqlite:metafactory-plugin-hours.db

How can I add a higher version of a supplied jar to my plugin?

 

Thanks in advance, greeting,

Marco de Reus

2 comments
Comment actions Permalink

Not really, as I am not using gradle...

 

Did find a solution by using some classpath magic in Java, by adding Class.forName when creating a connection.

 

private Connection connect() {
Connection conn = null;
try {
Class.forName("org.sqlite.JDBC"); // Needed to force loading the sqlite-jdbc.jar of the plugin itself
conn = DriverManager.getConnection(URL);
} catch (SQLException | ClassNotFoundException e) {
LOG.error(e.getMessage());
}
return conn;
}

 

Thanks for the tip and response though!

 

Greetings, Marco de Reus

0

Please sign in to leave a comment.