在connection类中提供了3个控制事务的方法: (1) setAutoCommit(Boolean autoCommit):设置是否自动提交事务; (2) commit();提交事务; (3) rollback();撤消事务;