且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在sqlite4java中禁用自动提交?

更新时间:2022-06-15 22:36:02

Jefromi和king_nak是正确的 - 你只需要发出开始和结束交易的SQL语句。

Jefromi and king_nak are correct - you just need to issue SQL statements that begin and end a transaction.

SQLiteConnection con = new SQLiteConnection();
con.exec("BEGIN");
// do transaction work - auto-commit is disabled
con.exec("COMMIT");
// auto-commit is enabled again