public static int dropAll(String db){
  Connection c=null;
  PreparedStatement stat=null;
  ResultSet r=null;
  try {
    if (X.isEmpty(db)) {
      c=getConnection();
    }
 else {
      c=getConnection(db);
    }
    DatabaseMetaData dm=c.getMetaData();
    r=dm.getTables(null,null,"%",new String[]{"TABLE"});
    List<String> tables=new ArrayList<String>();
    while (r.next()) {
      tables.add(r.getString(3));
    }
    r.close();
    r=null;
    for (    String t : tables) {
      stat=c.prepareStatement("drop table " + t);
      stat.executeUpdate();
      stat.close();
      stat=null;
    }
    return tables.size();
  }
 catch (  Exception e) {
    log.error(e.getMessage(),e);
  }
  return 0;
}

public static int dropAll ( String db ) { Connection c = null ; PreparedStatement stat = null ; ResultSet r = null ; try { if ( X . isEmpty ( db ) ) { c = getConnection ( ) ; } else { c = getConnection ( db ) ; } DatabaseMetaData dm = c . getMetaData ( ) ; r = dm . getTables ( null , null , "%" , new String [ ] { "TABLE" } ) ; List < String > tables = new ArrayList < String > ( ) ; while ( r . next ( ) ) { tables . add ( r . getString ( 3 ) ) ; } r . close ( ) ; r = null ; for ( String t : tables ) { stat = c . prepareStatement ( "drop table " + t ) ; stat . executeUpdate ( ) ; stat . close ( ) ; stat = null ; } return tables . size ( ) ; } catch ( Exception e ) { log . error ( e . getMessage ( ) , e ) ; } return 0 ; }
drop all tables for the " db " , the " db " name was configured in " giiwa . properties " , such as : db [ ttt ] . url = . . . .
