我正在尝试将sqlite-File读入内存以获得更好的性能,在关闭我的应用程序时我想将其写回到hdd.
我在Java中使用jdbc(3.7.2)驱动程序.
根据文档,我的代码看起来像
this._conn = DriverManager.getConnection("jdbc:sqlite:");
Statement stat = this._conn.createStatement();
File dbFile = new File(this._config.GetDataBaseFile());
if (dbFile.exists()) {
this._logger.AddInfo("File exists.");
stat.executeUpdate("restore from " + dbFile.getAbsolutePath());
}
该文件存在(及其有效的sqlite数据库),this._conn已打开,但如果我想在其上执行语句,则表明内部没有表或数据.它似乎无法恢复任何东西.
有关如何进一步解决/调试的任何建议?
(顺便说一句 – 如果我在我的连接上使用stat.executeUpdate(“backup to test.db”),它会备份我的空:memory:db …)