JDBC事务 在获取到conn连接的时候,conn.setAutoCommit(false);设置不自动执行事务。最终执行完成以后,最后conn.commit();在catch里面写conn.rollback(); 如下