My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads
Wiki pages
Links

Latest version:

Additional downloads:


About sqlite4java

sqlite4java is a minimalistic 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. (There's a contributed pre-compiled binary for ARMv5 in the Downloads area.) Required JRE version is 1.5. SQLite is pre-compiled and distributed along with the Java classes as dynamic JNI libraries.

sqlite4java is pretty much work in progress. The latest version is stable enough for us (ALM Works) to use it in our production applications, however the API is not full yet, some of the methods or optimizations for specific data types may be missing. Feel free to request improvements or suggest patches.

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() and column...() 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 as InputStream. 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 info@almworks.com if you'd like to have it licensed under different terms.

Powered by Google Project Hosting