A problem when connect MSSQL with transaction.


Problem: Could not load object: [Microsoft][SQLServer 2000 Driver for JDBC]Can't start a cloned connection while in manual transaction mode. ===============================================


If you pass "SelectMethod=cursor" attribute in connectio url, will allow more than one active statement per connection." jdbc:microsoft:sqlserver://localhost:1433;SelectMethod=cursor;","user","pwd"The reason for this is;When SelectMethod is set to direct, SQL Server does not support multiple active statements on a single connection within a transaction; however, when auto-commit mode is enabled (the default), the Microsoft SQL Server JDBC driver provides the ability to have multiple JDBC statements open on a single JDBC connection. This is done by cloning physical SQL Server connections as needed. To avoid cloning physical SQL Server connections in this circumstance, you should create only one Statement, PreparedStatement, CallableStatement, or DatabaseMetaData object per JDBC Connection object. Be sure to invoke the "close" methods on these objects when you are finished with them, that is, before creating another object of the types described.


Beyond APAC's No.1 Cloud

19.6% IaaS Market Share in Asia Pacific - Gartner IT Service report, 2018

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >



如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。