1 回答

TA貢獻(xiàn)1828條經(jīng)驗(yàn) 獲得超3個(gè)贊
我剛剛嘗試使用 Xerial 的 sqlite-jdbc-3.27.2.1.jar,它們似乎讓我們r(jià)estore from將本機(jī)(二進(jìn)制)SQLite 數(shù)據(jù)庫(kù)文件放入:memory:數(shù)據(jù)庫(kù)中,如下所示:
try (Connection conn = DriverManager.getConnection("jdbc:sqlite::memory:")) {
try (Statement st = conn.createStatement()) {
st.execute("restore from C:\\__tmp\\thing.sqlite");
// let's see if we can read one of the tables
ResultSet rs = st.executeQuery("SELECT * FROM Table1");
while (rs.next()) {
System.out.println(rs.getString(1));
}
}
} catch (Throwable e) {
e.printStackTrace(System.err);
}
添加回答
舉報(bào)