java.lang.Object
org.itsallcode.jdbc.metadata.DbMetaData
A simple wrapper for
DatabaseMetaData
.-
Constructor Summary
ConstructorsConstructorDescriptionDbMetaData
(Context context, DatabaseMetaData metaData) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptiongetColumns
(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) Retrieves a description of table columns available in the specified catalog.Retrieves a description of the tables available in the given catalog.
-
Constructor Details
-
DbMetaData
Create a new instance.- Parameters:
context
- DB context.metaData
- metaData object.
-
-
Method Details
-
getTables
public SimpleResultSet<TableMetaData> getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) Retrieves a description of the tables available in the given catalog. Only table descriptions matching the catalog, schema, table name and type criteria are returned. They are ordered byTABLE_TYPE
,TABLE_CAT
,TABLE_SCHEM
andTABLE_NAME
.- Parameters:
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 searchschemaPattern
- 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 searchtableNamePattern
- a table name pattern; must match the table name as it is stored in the databasetypes
- a list of table types, which must be from the list of table types returned fromDatabaseMetaData.getTableTypes()
,to include;null
returns all types- Returns:
- table descriptions
- See Also:
-
getColumns
public SimpleResultSet<ColumnMetaData> getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) Retrieves a description of table columns available in the specified catalog.Only column descriptions matching the catalog, schema, table and column name criteria are returned. They are ordered by
TABLE_CAT
,TABLE_SCHEM
,TABLE_NAME
, andORDINAL_POSITION
.- Parameters:
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 searchschemaPattern
- 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 searchtableNamePattern
- a table name pattern; must match the table name as it is stored in the databasecolumnNamePattern
- a column name pattern; must match the column name as it is stored in the database- Returns:
- column descriptions
- See Also:
-