本文介绍了如何在sqlite4java中禁用自动提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近一直在玩sqlite4java库。
我想我已经弄清楚了。困扰我的唯一想法是我不知道如何使用此库关闭自动提交。有人可以帮忙吗?
非常感谢代码示例。

I have recently been playing with the sqlite4java library.I think I have it pretty much figured out. The only think that bothers me is that I do not know how to switch off the auto-commit using this library. Can anyone please help?A code example would be much appreciated.

提前致谢,
Boro

Thanks in advance,Boro

推荐答案

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

这篇关于如何在sqlite4java中禁用自动提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-22 16:49