快速解决Sybase JDBC DRIVER出现的问题

来源:岁月联盟 编辑:zhuzhu 时间:2007-08-07

使用sybase jdbc driver得到:

 

connection conn

 

多次使用:

 

conn.setAutoCommit(b)

 

b 为相同的true|false时,

报错:

 

SET CHAINED command not allowed within multi-statement transaction.

解决方法:

 

if (conn.getAutoCommit()!=b) {    conn.setAutoCommit(b);}代替:conn.setAutoCommit(b).

 

使用其它数据库(如oracle)则不会出现上述问题。