2014-09-19 71 views
1

我試圖在jdbc驅動程序連接字符串中部署JBoss webapp,它要求selectMethod=cursor帶有selectMethod =遊標中斷連接的JDBC連接字符串

但是,當我嘗試連接到我的mssql(2008)數據庫與此字符串中,它只是連接時超時。當我從我的連接字符串刪除selectMethod=cursor,它的工作原理/接通,但我的應用程序不能正常工作,給我這個錯誤:[SQLServer JDBC Driver]Can't start a cloned connection while in manual transaction mode.

我已經更新了我的jdbc驅動程序 - 測試的所有版本。

這是我的連接字符串:

JDBC:微軟:SQLSERVER://127.0.0.1:1434;數據庫名= XXXX;用戶= XXXX;密碼= XXXXX; selectMethod =光標

感謝。

回答

0

我從使用微軟的jdbc驅動程序切換到jtds jdbc驅動程序,它再次奇妙地工作。

0

Microsoft docs on the issue對此有何看法?

This error occurs when you try to execute multiple statements against a SQL Server database with the JDBC driver while in manual transaction mode (AutoCommit=false) and while using the direct (SelectMethod=direct) mode. Direct mode is the default mode for the driver.

分辨率爲:

When you use manual transaction mode, you must set the SelectMethod property of the driver to Cursor, or make sure that you use only one active statement on each connection as specified in the "More Information" section of this article.