Download latest version:
- sqlite4java-392 with SQLite 3.8.7, Windows/Linux/Mac OS X/Android binaries
- OSGi bundle 1.0.392 with sqlite4java-392
Files for previous versions are available in the Downloads section.
Useful links:
About sqlite4java
Sqlite4java is a minimalistic, open-source Java wrapper for SQLite. SQLite is a free, compact, robust, embeddable SQL database engine. sqlite4java is built with the purpose to provide high-performance, low-garbage interface to SQLite for desktop Java applications.
Sqlite4java is not a JDBC driver. Access to the database is made through the custom interfaces of com.almworks.sqlite4java
package. Tighter integration with SQLite offers better performance and features not available through JDBC interfaces.
Sqlite4java is built for use on Windows, Linux, Mac OS X and Android, although you can try to compile it on other platforms. Required JRE version is 1.5. SQLite is pre-compiled and distributed along with the Java classes as dynamic JNI libraries.
Sqlite4java is a stable library that we (ALM Works) use in our production applications. The API may not support some of the SQLite functions, but most functionality is covered. Feel free to request improvements or suggest patches.
Supported Platforms
- Windows i386/x64
- Linux i686/amd64
- Mac OS X 10.5 or later (i686/x64)
- Android x86/armv7/armv5
Features
- Thin JNI-based wrapper for SQLite C Interface. Most of SQLite's user functions (not extender functions) are either already provided by the library or can be easily added.
- Single-threaded model - each SQLite connection is confined to a single thread, all calls must come from that thread. Application may open several connections to the same database from different threads. Along with the Serializable isolation level from SQLite, this feature facilitates writing very clean and predictable code.
- Bulk retrieval from SELECT statements, greatly improving speed and garbage rate via minimizing the number of JNI calls to
step()
andcolumn...()
methods. See SQLiteStatement.loadInts() for example. - Interruptible statements support allows to cancel a long-running query or update. See SQLiteConnection.interrupt().
- Long array binding allows to represent a
long[]
Java array as an SQL table. Table lookup is optimized if you specify that the array is sorted and/or has unique values. See SQLiteLongArray. - Incremental BLOB I/O maps to
sqlite3_blob...
methods, which provide means to read/write portions of a large BLOB. See SQLiteBlob. - BLOBs as streams - you can bind parameter as an
OutputStream
and read column value asInputStream
. See SQLiteStatement.bindStream() for example. - Job queue implementation lets you queue database jobs in a multi-threaded application, to be executed one-by-one in a dedicated database thread. See JobQueue.
- SQL Profiler collects statistics on the executed SQL.
- Backup API support lets you use SQLite's hot backup feature. See SQLiteConnection.initializeBackup().
License
sqlite4java is licensed under Apache License 2.0.
Contact [email protected] if you'd like to have it licensed under different terms.
Contributors
- ALM Works team
- Ivan Voronov