gpt4 book ai didi

java - Connection.setAutoCommit(true) 是否适用于 SQL 存储过程和函数?

转载 作者:行者123 更新时间:2023-11-29 09:30:51 30 4
gpt4 key购买 nike

DB 是 Oracle。

我想为 SQL 存储过程和函数使用 Connection.setAutoCommit。会成功吗?

对于调用过程,我使用 CallableStatement

最佳答案

不行,connection.setAutoCommit(true),在这个连接中是一个Java Object。您不能在存储过程中使用相同的内容。

我们有一个名为 autocommit 的 sql 系统变量,如果我们在编写存储过程时将其设置为 on,无论您尝试执行什么,您的过程都会自动提交结果。

关于java - Connection.setAutoCommit(true) 是否适用于 SQL 存储过程和函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11412349/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com