static List < String > getAllTables ( String database , Statement stmt ) throws SQLException { List < String > table = new ArrayList <> ( ) ; ResultSet rs ; rs = stmt . executeQuery ( "SHOW TABLE STATUS FROM `" + database + "`;" ) ; while ( rs . next ( ) ) { table . add ( rs . getString ( "Name" ) ) ; } return table ; }
This is a utility function to get the names of all the tables that re in the database supplied