在JDBC的提交模式(commit mode)中,如果数据库连接是自动提交模式(auto commit mode),那么在每一条SQL语句执行后事务都将被提交,提交后如果还有任务,那么一个新的事务又开始了。
基于18个网页-相关网页
对于这个方法,需要注意默认连接的使用,还要将自动提交模式设为false。
Things to note about this method are the use of the default connection and setting the autocommit mode to false.
首先,应当关闭自动提交模式,这样,每条sql语句的结果不会被自动提交给数据库。
First, you should turn off autocommit mode so the results of each SQL statement aren't automatically committed to the database.
默认的事务行为是自动提交模式。在该模式下,每个语句在发送到目标服务器时进行提交。
The default transactional behavior is auto-commit mode, where each statement is committed as it is sent to the target server.
应用推荐