Code example for Connection

Methods: getAutoCommitrollbacksetAutoCommit

0
	} 
 
	 
	public boolean isInTransaction() throws DAOException { 
		try { 
			return !conn.getAutoCommit();
		} catch (SQLException e) {
			throw new DataAccessException(e);
		} 
	} 
 
	 
	public void rollback() throws DAOException { 
		try{ 
			if(!isInTransaction())return; 
			conn.rollback();
			conn.setAutoCommit(true);
		}catch(SQLException e){
			throw new DataAccessException(e);
		}	 
	} 
	 
Experience pair programming with AI  Get Codota for Java