This is a Java wrapper including a basic JDBC driver for the SQLite 2/3 database engine. It is designed using JNI to interface to the SQLite API. That API is wrapped by methods in the SQLite.Database class. Since June, 2002, it includes a small JDBC driver, which allows the most basic things to be carried out using the java.sql package. Since September, 2004, SQLite3 (minimum 3.0.7) is supported. The JNI part can be generated to include support for both SQLite 2.x and 3.x and detects at runtime the type of the database.
The current source tarball can be downloaded from javasqlite-20120209.tar.gz. It has been tested on Linux, using SQLite 2.8.17 and 3.7.9, and JDK 1.4/1.5/1.6 from Sun. The change log starting from August 2007 is here.
For rebuilding the following requirements must be met:
- SQLite 2.4.12 or higher
- JDK 1.1 or higher
- C compiler and make
To override the directory where configure looks for SQLite and JDK the configure options --with-sqlite=DIR, --with-sqlite3=DIR, and --with-jdk=DIR can be used. To specify the place where the native library (the libsqlite_jni.so file) shall be installed, use the --prefix=DIR option. The default place is /usr/local/lib, i.e. the prefix defaults to /usr/local. To specify where the sqlite.jar file containing the high-level part and the JDBC driver shall be installed, use the --with-jardir=DIR option. The default is /usr/local/share/java. At runtime, it is necessary to tell the JVM both places with the -classpath and -Djava.library.path=.. command line options. Optionally, the native part is searched using the path prefix specified in the -DSQLite.library.path=.. property, which has precedence over -Djava.library.path=...
For Win32 (NT4 or above) the makefiles javasqlite.mak, javasqlite23.mak, and javasqlite3.mak are provided in the source archive. These makefiles contain some build instructions and use the J2SE 1.4.2 from Sun and MS Visual C++ 6.0.
A DLL with the native JNI part (including SQLite 3.7.7.1) and the JAR file with the Java part can be downloaded from javasqlite-20110827-win32.zip.
转载: