<modelVersion>4.0.0</modelVersion>\r
<groupId>org.xerial</groupId>\r
<artifactId>sqlite-jdbc</artifactId>\r
- <version>v038.1</version>\r
+ <version>v038.2</version>\r
<name>SQLite JDBC</name>\r
<description>SQLite JDBC library</description>\r
\r
static boolean load()
{
+ loaded = SQLiteJDBCLoader.initialize();
+ return loaded;
+ /*
if (loaded != null)
return loaded == Boolean.TRUE;
- SQLiteJDBCLoader.initialize(true);
-
String libpath = System.getProperty("org.sqlite.lib.path");
String libname = System.getProperty("org.sqlite.lib.name");
if (libname == null)
}
loaded = Boolean.TRUE;
- return true;
+ */
+ //return true;
}
/** linked list of all instanced UDFDatas */
\r
private static boolean extracted = false;\r
\r
- public static void initialize()\r
+ public static boolean initialize()\r
{\r
- setSQLiteNativeLibraryPath();\r
+ loadSQLiteNativeLibrary();\r
+ return extracted;\r
}\r
\r
- public static void initialize(boolean forceReload)\r
+ public static boolean initialize(boolean forceReload)\r
{\r
if (forceReload)\r
extracted = false;\r
- setSQLiteNativeLibraryPath();\r
+ loadSQLiteNativeLibrary();\r
+ return extracted;\r
}\r
\r
private static boolean extractLibraryFile(String libraryResourcePath, String libraryFolder, String libraryFileName)\r
}\r
}\r
\r
- return setNativeLibraryPath(libraryFolder, libraryFileName);\r
+ return loadNativeLibrary(libraryFolder, libraryFileName);\r
}\r
catch (IOException e)\r
{\r
\r
}\r
\r
- private static boolean setNativeLibraryPath(String path, String name)\r
+ private static boolean loadNativeLibrary(String path, String name)\r
{\r
File libPath = new File(path, name);\r
if (libPath.exists())\r
{\r
- System.setProperty("org.sqlite.lib.path", path == null ? "./" : path);\r
- System.setProperty("org.sqlite.lib.name", name);\r
- return true;\r
+ // System.setProperty("org.sqlite.lib.path", path == null ? "./" :\r
+ // path);\r
+ // System.setProperty("org.sqlite.lib.name", name);\r
+\r
+ try\r
+ {\r
+ System.load(new File(path, name).getAbsolutePath());\r
+ return true;\r
+ }\r
+ catch (UnsatisfiedLinkError e)\r
+ {\r
+ System.err.println(e);\r
+ return false;\r
+ }\r
+\r
}\r
else\r
return false;\r
}\r
\r
- private static void setSQLiteNativeLibraryPath()\r
+ private static void loadSQLiteNativeLibrary()\r
{\r
if (extracted)\r
return;\r
\r
if (sqliteNativeLibraryPath != null)\r
{\r
- if (setNativeLibraryPath(sqliteNativeLibraryPath, sqliteNativeLibraryName))\r
+ if (loadNativeLibrary(sqliteNativeLibraryPath, sqliteNativeLibraryName))\r
{\r
extracted = true;\r
return;\r