This section describes how to get a list of all tables in the current database on the SQL Server through the DatabaseMetaData object.
If you want to list all tables in the current database on the SQL server, you can use
the DatabaseMetaData method: getTables(). It returns all tables that meets
the input criteria specified. Input parameters are:
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.
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
tableNamePattern - a table name pattern; must match the table name as it is stored in the database
types - a list of table types, which must be from the list of table types returned from getTableTypes(); null returns all types
The output is captured in a ResultSet object with the following fields: