Database MetaData Show Tables

List the Tables in Database.

Javadoc available at https://www.javatapas.com/docs/javatapas/sql/DatabaseMetadataShowTables.html


public static void databaseMetadataShowTables(Connection connection) throws SQLException {

	DatabaseMetaData databaseMetaData = connection.getMetaData();

	String[] tableTypes = new String[]{"TABLE"};

	ResultSet resultSet = databaseMetaData.getTables(null, null, null, tableTypes);

	while(resultSet.next()){
    System.out.println(resultSet.getString("TABLE_NAME"));
	}

}