How to get list of tables from MySQL using Java DatabaseMetaData?

DatabaseMetaData metadata = con.getMetaData();
metadata.getTables(catalog, schemaPattern, tableNamePattern, types);


What fields are required to get a list of tables?


source to share

1 answer

If you want a list of all tables, you should use:

metadata.getTables(null, null, null, new String[]{"TABLE"});




All Articles