Code example for Connection

Methods: close, rollback

0
 public void rollbackNClose() throws SQLException 
 { 
  if( conn == null )
   return; 
   
  conn.rollback();
  conn.close();
 } 
 
 public void commitNClose() throws SQLException 
 { 
  if( conn == null )
   return; 
   
  conn.commit();
  conn.setAutoCommit(true);
  conn.close();
 } 
}