This is a reminder message about the usage of load_extension() with
sqlite-jdbc:
In order to use load_exension('...') funtion, you have to use
org.sqlite.SQLiteConfig to enable load extension, since
load_extension('..') is disabled in default. Then, pass the result of
config.toProperties() when creating a connection.
Here is a sample code for loading an extension library:
SQLiteConfig config = new SQLiteConfig();
config.enableLoadExtension(true);
Connection connection =
DriverManager.getConnection("jdbc:sqlite:", config.toProperties());
Statement statement = connection.createStatement();
statement.execute("select load_extension('half.sqlext')");
ResultSet rs = statement.executeQuery("select half(10)");
while(rs.next())
{
// read the result set
System.out.println("half = " + rs.getInt(1));
}
I almost forgot about this feature before I got an e-mail for asking
the usage of load_extension(). That is why I am writing this message.
Thanks.