Hi, I am trying to to test the library with the spatialite extensions for sqlite.
I would like to have this work on windows, since it is the most tricky system when it comes to native bindings.
I am trying to run a database creation, during which the spatialite lib is supposed to load a pile of geographic information.
I do this like:
String nativeSpatialiteLib = "path_to/mod_spatialite.dll";
String nativeSqliteLib = "path_to/com/almworks/sqlite4java/sqlite4java-win32-x64/1.0.392/";
SQLite.setLibraryPath(nativeSqliteLib);
conn = new SQLiteConnection(dbFile);
conn.open(true);
conn.setExtensionLoadingEnabled(true);
File ext = new File(nativeSpatialiteLib);
conn.loadExtension(ext);
String sql = "SELECT InitSpatialMetadata()";
conn.exec(sql);
conn.dispose();
While the sqlite libs are properly loaded, it fails in:
conn.loadExtension(ext);
Telling me:
Exception in thread "main" com.almworks.sqlite4java.SQLiteException: [1] DB[1] loadExtension() Impossibile trovare la procedura specificata.
which means as much as: impossible to find the specified method.
I am not sure if I am loading the mod_spatialite properly.
As a sidenote, in the xerial jdbc the lib was properly loaded with: stmt.execute("SELECT load_extension('mod_spatialite')");
after putting the native spatialite ibs in the path.
Thanks for any hint.
Cheers,
Andrea