public boolean execute(String sqlStatements,Connection conn){
  if (conn == null)   throw new IllegalStateException("Require connection");
  String[] sql=convert(sqlStatements);
  m_exception=null;
  if (m_conversionError != null || sql == null)   return false;
  boolean ok=true;
  int i=0;
  String statement=null;
  try {
    if (m_stmt == null)     m_stmt=conn.createStatement();
    for (i=0; ok && i < sql.length; i++) {
      statement=sql[i];
      if (statement.length() == 0) {
        if (m_verbose)         log.finer("Skipping empty (" + i + ")");
      }
 else {
        if (m_verbose)         log.info("Executing (" + i + ") <<"+ statement+ ">>");
 else         log.info("Executing " + i);
        try {
          m_stmt.clearWarnings();
          int no=m_stmt.executeUpdate(statement);
          SQLWarning warn=m_stmt.getWarnings();
          if (warn != null) {
            if (m_verbose)             log.info("- " + warn);
 else {
              log.info("Executing (" + i + ") <<"+ statement+ ">>");
              log.info("- " + warn);
            }
          }
          if (m_verbose)           log.fine("- ok " + no);
        }
 catch (        SQLException ex) {
          if (!statement.startsWith("DROP ")) {
            ok=false;
            m_exception=ex;
          }
          if (!m_verbose)           log.info("Executing (" + i + ") <<"+ statement+ ">>");
          log.info("Error executing " + i + "/"+ sql.length+ " = "+ ex);
        }
      }
    }
  }
 catch (  SQLException e) {
    m_exception=e;
    if (!m_verbose)     log.info("Executing (" + i + ") <<"+ statement+ ">>");
    log.info("Error executing " + i + "/"+ sql.length+ " = "+ e);
    return false;
  }
  return ok;
}

public boolean execute ( String sqlStatements , Connection conn ) { if ( conn == null ) throw new IllegalStateException ( "Require connection" ) ; String [ ] sql = convert ( sqlStatements ) ; m_exception = null ; if ( m_conversionError != null || sql == null ) return false ; boolean ok = true ; int i = 0 ; String statement = null ; try { if ( m_stmt == null ) m_stmt = conn . createStatement ( ) ; for ( i = 0 ; ok && i < sql . length ; i ++ ) { statement = sql [ i ] ; if ( statement . length ( ) == 0 ) { if ( m_verbose ) log . finer ( "Skipping empty (" + i + ")" ) ; } else { if ( m_verbose ) log . info ( "Executing (" + i + ") <<" + statement + ">>" ) ; else log . info ( "Executing " + i ) ; try { m_stmt . clearWarnings ( ) ; int no = m_stmt . executeUpdate ( statement ) ; SQLWarning warn = m_stmt . getWarnings ( ) ; if ( warn != null ) { if ( m_verbose ) log . info ( "- " + warn ) ; else { log . info ( "Executing (" + i + ") <<" + statement + ">>" ) ; log . info ( "- " + warn ) ; } } if ( m_verbose ) log . fine ( "- ok " + no ) ; } catch ( SQLException ex ) { if ( ! statement . startsWith ( "DROP " ) ) { ok = false ; m_exception = ex ; } if ( ! m_verbose ) log . info ( "Executing (" + i + ") <<" + statement + ">>" ) ; log . info ( "Error executing " + i + "/" + sql . length + " = " + ex ) ; } } } } catch ( SQLException e ) { m_exception = e ; if ( ! m_verbose ) log . info ( "Executing (" + i + ") <<" + statement + ">>" ) ; log . info ( "Error executing " + i + "/" + sql . length + " = " + e ) ; return false ; } return ok ; }
execute sql statement ( stops at first error ) . if an error occurred haderror ( ) returns true . you can get details via getconversionerror ( ) or getexception ( )
