我用jdbc连接SQLite,Connection每次都是null
我用输出语句后输出SQLException 高手们帮帮忙啊~~
一下是连库代码public Connection dbConnection() {
Connection conn = null;
try {
Class.forName("SQLite.JDBCDriver");
Properties props = new Properties();
props.put ("encoding", "UTF8");
System.out.println("a");
conn = DriverManager.getConnection("jdbc:sqlite:/mnt/sdcard/sqlite/test_SQLite.db", props);
System.out.println("b");
} catch (SQLException e) {
System.out.println("SQLException");
e.printStackTrace();
} catch (ClassNotFoundException e) {
System.out.println("ClassNotFoundException");
e.printStackTrace();
}
return conn;
}输出结果是:
a
SQLException
a
SQLException
a
SQLException