Sqlite-jdbc
SQLite JDBC, developed by Taro L. Saito, is a library for accessing and creating SQLite database files in Java.
Get Connection
How to Specify Database Files
Here is an example to select a file C:\work\mydatabase.db
(in Windows)
A UNIX (Linux, Mac OS X, etc) file /home/leo/work/mydatabase.db
How to Use Memory Databases
SQLite supports on-memory database management, which does not create any database files. To use a memory database in your Java code, get the database connection as follows:
Exist Table
public static boolean existTable(Connection connection, String tableName) {
try {
DatabaseMetaData meta = connection.getMetaData();
ResultSet tables = meta.getTables(null, null, tableName, null);
if (tables.next() == true) {
return true;
}
} catch (SQLException e) {
e.printStackTrace();
}
return false;
}
Favorite site
References
-
How_to_use_sqlite_jdbc.pdf ↩