Code example for Connection

Methods: commit, getAutoCommit, isClosed

0
   * Invokes a commit on the connection if auto-commit is turned off 
   */ 
  public static void commit(Connection conn)
  throws SQLException 
  { 
	  if (conn != null && !conn.isClosed())
	  { 
		  if (!conn.getAutoCommit())
			  conn.commit();
	  } 
	  else 
	  { 
		  LOG.error("Invoking a commit after the connection closed "); 
	  } 
  } 
   
  /** 
   * Invokes a rollback on the connection if auto-commit is turned off 
   */ 
  public static void rollback(Connection conn)
  throws SQLException