public static void dropTemporaryOutputTables(String table,int numberOfPartitions,Connection connection){
  table=table.replace(";","");
  for (int i=0; i < numberOfPartitions; i++) {
    StringBuilder dropTableQuery=new StringBuilder();
    dropTableQuery.append("DROP TABLE ");
    dropTableQuery.append(table);
    dropTableQuery.append("_");
    dropTableQuery.append(i);
    LOG.info("Drop Table: ");
    LOG.info(dropTableQuery);
    executeStatementIfExists(dropTableQuery.toString(),connection);
  }
}

public static void dropTemporaryOutputTables ( String table , int numberOfPartitions , Connection connection ) { table = table . replace ( ";" , "" ) ; for ( int i = 0 ; i < numberOfPartitions ; i ++ ) { StringBuilder dropTableQuery = new StringBuilder ( ) ; dropTableQuery . append ( "DROP TABLE " ) ; dropTableQuery . append ( table ) ; dropTableQuery . append ( "_" ) ; dropTableQuery . append ( i ) ; LOG . info ( "Drop Table: " ) ; LOG . info ( dropTableQuery ) ; executeStatementIfExists ( dropTableQuery . toString ( ) , connection ) ; } }
drop multiple temporary tables from a database underneath a connection object .
