为何不会rollback...?
代码如下。每次都会更新值,ROLLBACK没用么?
Connection conn = dataSource.getConnection();
conn.setAutoCommit(false);
PreparedStatement pstmt = null;
pstmt = conn.prepareStatement("update test set name=? where id=?");
pstmt.setString(1, "GG");
pstmt.setInt(2, 3);
pstmt.executeUpdate();
conn.rollback();
[解决办法]