使用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)则不会出现上述问题。