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 {@link com.almworks.sqlite4java.SQLiteConnection} and {@link 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.