sqlite-jdbc-3.6.13 release

3,578 views
Skip to first unread message

Taro L. Saito

unread,
Apr 28, 2009, 12:08:12 AM4/28/09
to Xerial
Hi all,

I have implemented a feature to load DB files inside a jar file, which
is discussed in the following thread:
http://groups.google.com/group/xerial/browse_thread/thread/202aa1ffb9b113f5?hl=en

sqlite-jdbc 3.6.13 is available from here:
http://www.xerial.org/maven/repository/artifact/org/xerial/sqlite-jdbc/3.6.13/

[usage]

To load db files that can be found from the class loader (e.g., db
files inside a jar file in the classpath),
use "jdbc:sqlite::resource:" prefix.

For example, here is an example to access an SQLite DB file, sample.db
in a Java package org.yourdomain:

Connection conn = DriverManager.getConnection
("jdbc:sqlite::resource:org/yourdomain/sample.db");


In addition, external DB resources can be used as follows:

Connection conn = DriverManager
.getConnection("jdbc:sqlite::resource:http://
www.xerial.org/svn/project/XerialJ/trunk/sqlite-jdbc/src/test/java/org/sqlite/sample.db");


To access db files inside some specific jar file (in local or remote),
use the JAR URL: http://java.sun.com/j2se/1.5.0/docs/api/java/net/JarURLConnection.html

Connection conn = DriverManager
.getConnection("jdbc:sqlite::resource:jar:http://
www.xerial.org/svn/project/XerialJ/trunk/sqlite-jdbc/src/test/resources/testdb.jar!/sample.db");


DB files will be extracted to a temporary folder (System.getProperty
("java.io.tmpdir")).
Time stamps of DB files will be checked inside the sqlite-jdbc upon
establishing the connection, and sqlite-jdbc overwrites the extracted
files in the temporary folder if the DB files are updated.

[minor changes]
Fixed: out of memory error was wrongly reported when the DB file is
missing
http://code.google.com/p/xerial/issues/detail?id=6


Reply all
Reply to author
Forward
0 new messages