Code example for Connection

Methods: commit, setAutoCommit

0
	/** 
	 * 提交事务 
	 */ 
	public static void commit(Connection conn){
		try { 
			conn.commit();
			conn.setAutoCommit(true);
		} catch (SQLException e) {
			System.out.println("结束事务失败");
			e.printStackTrace();
		} 
	} 
	 
	/** 
	 * 回滚事务 
	 */ 
	public static void rollback(Connection conn){
		try { 
			conn.rollback();
		} catch (SQLException e) {
			System.out.println("回滚异常");