1 //睿共享 事务管理 2 public void executeTran(String[] sql){ 3睿共享 Connection connection = getConnection(); 4 PreparedStatement pstmt = null; 5 6 try { 7 //开启自动提交 8 connection.setAutoCommit(false); 9 //预编译sql 10 for (int i = 0; i) { 11 pstmt= connection.prepareStatement(sql[i]); 12 pstmt.exec 睿共享 uteUpdate(); 13 } 14 }睿共享 catch (SQLExc睿共享 eption e) { 15 e.printStackTrace(); 16 } 17 }