[英]Can I switch off Oracle JDBC auto commit when closing a connection?
As we know from here , here and here for a start, calling close on a JDBC connection to Oracle results in a commit although this may not be the case for other JDBC drivers. 从这里开始 , 这里和这里我们都知道, 在与Oracle的JDBC连接上调用close会导致提交,尽管其他JDBC驱动程序可能不是这种情况。
I can do a rollback before closing specifically for Oracle, but I was curious whether anybody knows if I can switch this off when opening the connection in a similar way to switching off the auto commit? 我可以在专门针对Oracle进行关闭之前进行回滚,但是我很好奇是否有人能以与关闭自动提交类似的方式打开连接时关闭此功能吗? Thank you.
谢谢。
您可以尝试子类化Connection类并在构造函数中设置autoCommit = false
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.