解析:轻松解决Sybase JDBC DRIVER问题

来源:岁月联盟 编辑:zhuzhu 时间:2007-09-26

使用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)则不会出现上述问题。 (责任编辑:卢兆林)