What is different from Zentus's SQLite JDBC?

Support major operating systems by embedding native libraries of SQLite, compiled for each of them.

Remove manual configurations

In the original version, in order to use the native version of sqlite-jdbc, users had to set a path to the native codes (dll, jnilib, so files, etc.) through the command-line arguments,
e.g., -Djava.library.path=(path to the dll, jnilib, etc.), or -Dorg.sqlite.lib.path, etc.
This process was error-prone and bothersome to tell every user to set these variables.
Our SQLiteJDBC library completely does away these inconveniences.

Another difference is that we are keeping this SQLiteJDBC library up-to-date to
the newest version of SQLite engine, because we are one of the hottest users of
this library. For example, SQLite JDBC is a core component of
UTGB (University of Tokyo Genome Browser) Toolkit, which
is our utility to create personalized genome browsers.

importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.sql.Statement;publicclassSample{publicstaticvoidmain(String[]args)throwsClassNotFoundException{// load the sqlite-JDBC driver using the current class loaderClass.forName("org.sqlite.JDBC");Connectionconnection=null;try{// create a database connectionconnection=DriverManager.getConnection("jdbc:sqlite:sample.db");Statementstatement=connection.createStatement();statement.setQueryTimeout(30);// set timeout to 30 sec.statement.executeUpdate("drop table if exists person");statement.executeUpdate("create table person (id integer, name string)");statement.executeUpdate("insert into person values(1, 'leo')");statement.executeUpdate("insert into person values(2, 'yui')");ResultSetrs=statement.executeQuery("select * from person");while(rs.next()){// read the result setSystem.out.println("name = "+rs.getString("name"));System.out.println("id = "+rs.getInt("id"));}}catch(SQLExceptione){// if the error message is "out of memory", // it probably means no database file is foundSystem.err.println(e.getMessage());}finally{try{if(connection!=null)connection.close();}catch(SQLExceptione){// connection close failed.System.err.println(e);}}}}

How to Specify Database Files

Here is an example to select a file C:\work\mydatabase.db (in Windows)

Dependency Tests

Windows XP (32-bit)

dependency check

DUMPBIN /DEPENDENTS sqlitejdbc.dll

KERNEL32.dll
msvcrt.dll

Mac OS X (10.4.10 Tiger ~ 10.5 Leopard)

dependency check

otool -L libsqlitejdbc.jnilib
libsqlitejdbc.jnilib:
build/Darwin-i386/libsqlitejdbc.jnilib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.9)

Using SQLiteJDBC with Maven2

If you are familiar with Maven2, add the following XML
fragments into your pom.xml file. With those settings, your Maven will automatically download our SQLiteJDBC library into your local Maven repository, since our sqlite-jdbc libraries are synchronized with the Maven's central repository.

Using SQLiteJDBC with Tomcat6 Web Server

Do not include sqlite-jdbc-(version).jar in WEB-INF/lib folder of your web application
package, since multiple web applications hosted by the same Tomcat server cannot
load the sqlite-jdbc native library more than once. That is the specification of
JNI (Java Native Interface). You will observe UnsatisfiedLinkError exception with
the message "no SQLite library found".

Work-around of this problem is to put sqlite-jdbc-(version).jar file into (TOMCAT_HOME)/lib
direcotry, in which multiple web applications can share the same native library
file (.dll, .jnilib, .so) extracted from this sqlite-jdbc jar file.

If you are using Maven for your web application, set the dependency scope as 'provided',
and manually put the SQLite JDBC jar file into (TOMCAT_HOME)/lib folder.