Package com.almworks.sqlite4java

sqlite4java is a minimalistic Java wrapper for SQLite RDBMS, aiming to provide high-performance, low-garbage interface for desktop Java applications.

See:
          Description

Interface Summary
SQLiteConstants This interface lists SQLite constants that may be used with sqlite4java.
 

Class Summary
SQLite SQLite class has several utility methods that are applicable to the whole instance of SQLite library within the current process.
SQLiteBackup SQLiteBackup wraps an instance of SQLite database backup, represented as sqlite3_backup* in SQLite C API.
SQLiteBlob SQLiteBlob encapsulates sqlite3_blob* handle, which represents an open BLOB (binary large object), stored in a single cell of a table.
SQLiteColumnMetadata SQLiteColumnMetadata contains information about a table column:
SQLiteConnection SQLiteConnection is a single connection to sqlite database.
SQLiteJob<T> SQLiteJob is a unit of work accepted by SQLiteQueue.
SQLiteLongArray SQLiteLongArray wraps a virtual table handle, created with SQLiteConnection.createArray(java.lang.String, boolean).
SQLiteProfiler SQLiteProfiler measures and accumulates statistics for various SQLite methods.
SQLiteQueue SQLiteQueue is a basic implementation of job queue for an SQLite connection.
SQLiteStatement SQLiteStatement wraps an instance of compiled SQL statement, represented as sqlite3_stmt* handle in SQLite C Interface.
SQLParts SQLParts is a means to avoid excessive garbage production during String concatenation when SQL is constructed.
 

Exception Summary
SQLiteBusyException SQLiteBusyException is a special exception that is thrown whenever SQLite returns SQLITE_BUSY or SQLITE_IOERR_BLOCKED error code.
SQLiteException SQLiteException is thrown whenever SQLite cannot execute an operation and returns an error code.
SQLiteInterruptedException SQLiteInterruptedException is a special exception that is thrown whenever SQLite returns SQLITE_INTERRUPT following a call to SQLiteConnection.interrupt().
 

Package com.almworks.sqlite4java Description

sqlite4java is a minimalistic Java wrapper for SQLite RDBMS, aiming to provide high-performance, low-garbage interface for desktop Java applications.

sqlite4java is shipped with pre-compiled binaries for Windows, Linux and Mac OS X; the binaries contain the SQLite database code and additional wrapper code.

To start using sqlite4java, you only need to place sqlite4java.jar and platform-dependent binaries into a directory in the CLASSPATH. (Binaries should be in the same directory as the jar file.)

To check SQLite version and library version, you can just run the jar file: java -jar sqlite4java.jar

sqlite4java is built using JDK 1.6.

Note on SQL used: SQL should contain characters from ASCII character table. If you need to insert or search for Unicode data, you need to bind it using statement parameters.

Main classes are SQLiteConnection and SQLiteStatement. A simple example:

    SQLiteConnection db = new SQLiteConnection(new File("/tmp/database"));
    db.open(true);
    ...
    SQLiteStatement st = db.prepare("SELECT order_id FROM orders WHERE quantity >= ?");
    try {
      st.bind(1, minimumQuantity);
      while (st.step()) {
        orders.add(st.columnLong(0));
      }
    } finally {
      st.dispose();
    }
    ...
    db.close();
  

See http://code.google.com/p/sqlite4java for more information.