使用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)没有这个问题.
|