How to disable autocommit in sqlite4java?

后端 未结 3 838
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-13 11:48

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

3条回答
  •  耶瑟儿~
    2021-01-13 12:16

    Edit: I confused sqlite4java with the sqliteJDBC package. So the below code will not help. I'm keeping it for reference nevertheless.

    After you obtained the connection, just call setAutoCommit(false)

    java.sql.Connection con = DriverManager.getConnection("jdbc:sqlite:/your/db/file", "user", "password");
    con.setAutoCommit(false);
    

提交回复
热议问题