加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

sqlserver2000 Can't start manual transaction mode be

发布时间:2020-12-12 14:05:57 所属栏目:MsSql教程 来源:网络整理
导读:问题描述? 今天在使用sql server 2000做jdbc数据库连接时,设置了手动的事务提交,结果报错。? java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Can't start manual transaction mode because there are cloned connections ? 网上搜到
问题描述?

今天在使用sql server 2000做jdbc数据库连接时,设置了手动的事务提交,结果报错。?

java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Can't start manual transaction mode because there are cloned connections

?

网上搜到的答案:

连接字符串中碰到的SelectMethod=cursor?
用法如下:?
作用:以利用服务器端的游标加快速度?
使用情况:?
? 1.执行多个Statements的操作的时候用?

??2.需要手动使用事务的时候使用??

用SQL Server驱动一次select很多数据最好在connection string中加上SelectMethod=Cursor,以利用服务器端游标加快速度,其实不只sqlserver,oracle的jdbc,只要使用PreparedStatement,驱动默认就使用游标,sqlserver则不然,必须使用SelectMethod=Cursor才打开游标。??

解决方案:

修改jdbc连接的url为

jdbc:microsoft:sqlserver://10.105.1.104:1433;DataBaseName=test2;SelectMethod=cursor?

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读