使用该类链接SQLite数据时需要下载sqlitejdbc-v056.jar,由于上传附件限制,所以jar包我没有上传下来,可以去百度搜索下载。代码如下:
package mainApp;
import java.sql.*;
public class SQLiteTest {
public static void main(String[] args) {
try {
// The SQLite (3.3.8) Database File
// This database has one table (pmp_countries) with 3 columns
// (country_id, country_code, country_name)
// It has like 237 records of all the countries I could think of.
String fileName = "E:/ProjectDocument/Citrus/syscity.db";
// Driver to Use
// http://www.zentus.com/sqlitejdbc/index.html
Class.forName("org.sqlite.JDBC");
// Create Connection Object to SQLite Database
// If you want to only create a database in memory, exclude the
// +fileName
Connection conn = DriverManager.getConnection("jdbc:s