컴퓨터/JAVA

Cannot Start a Cloned Connection While in Manual Transaction Mode

Hikasiru 2006. 5. 4. 14:07

link:http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B313181

SYMPTOMS

While using the Microsoft SQL Server 2000 Driver for JDBC, you may experience the following exception:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Can't start a cloned connection while in manual transaction mode.


CAUSE

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.


Solution
"jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=pubs;SelectMethod=Cursor;User=User;Password=Password");
con.setAutoCommit(false);