code: public static List<String> getTableNames(DatabaseMetaData metaData, String catalog, String schemaPattern,
                                                   String tableNamePattern, String [] types) throws SQLException {
          List<String> tableList = new ArrayList<String>();
          ResultSet rs = metaData.getTables(catalog, schemaPattern, tableNamePattern, types);
          boolean isH2 = isH2DataBase(metaData);
          try {
              while (rs.next()) {
                  tableList.add(new TableLocation(rs).toString(isH2));
              }
          } finally {
              rs.close();
          }
          return tableList;
      }
docs: Returns the list of table names.
  
  @param metaData Database meta data
  @param catalog A catalog name. Must match the catalog name as it is stored in the database.
  "" retrieves those without a catalog; null means that the catalog name should not be used to
  narrow the search
  @param schemaPattern A schema name pattern. Must match the schema name as it is stored in the database.
  "" retrieves those without a schema.
  null means that the schema name should not be used to narrow the search
  @param tableNamePattern A table name pattern. Must match the table name as it is stored in the database
  @param types A list of table types, which must be from the list of table types returned from getTableTypes(),
  to include. null returns all types
  @return The integer primary key used for edition[1-n]; 0 if the source is closed or if the table has no primary
  key or more than one column as primary key