Class DatabaseMetaDataWrapper
java.lang.Object
edu.internet2.middleware.grouper.ext.org.apache.ddlutils.platform.DatabaseMetaDataWrapper
Wrapper class for database meta data that stores additional info.
- Version:
- $Revision: 329426 $
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the catalog in the database to read.getColumns
(String tableNamePattern, String columnNamePattern) Convenience method to return the column meta data using the configured catalog and schema pattern.getForeignKeys
(String tableNamePattern) Convenience method to return the foreign key meta data using the configured catalog and schema pattern.getIndices
(String tableNamePattern, boolean unique, boolean approximate) Convenience method to return the index meta data using the configured catalog and schema pattern.Returns the database meta data.getPrimaryKeys
(String tableNamePattern) Convenience method to return the primary key meta data using the configured catalog and schema pattern.Returns the schema in the database to read.Convenience method to return the table meta data using the configured catalog, schema pattern and table types.String[]
Returns the table types to recognize.void
setCatalog
(String catalog) Sets the catalog in the database to read.void
setMetaData
(DatabaseMetaData metaData) Sets the database meta data.void
setSchemaPattern
(String schema) Sets the schema in the database to read.void
setTableTypes
(String[] types) Sets the table types to recognize.
-
Constructor Details
-
DatabaseMetaDataWrapper
public DatabaseMetaDataWrapper()
-
-
Method Details
-
getMetaData
Returns the database meta data.- Returns:
- The meta data
-
setMetaData
Sets the database meta data.- Parameters:
metaData
- The meta data
-
getCatalog
Returns the catalog in the database to read.- Returns:
- The catalog
-
setCatalog
Sets the catalog in the database to read.- Parameters:
catalog
- The catalog
-
getSchemaPattern
Returns the schema in the database to read.- Returns:
- The schema
-
setSchemaPattern
Sets the schema in the database to read.- Parameters:
schema
- The schema
-
getTableTypes
Returns the table types to recognize.- Returns:
- The table types
-
setTableTypes
Sets the table types to recognize.- Parameters:
types
- The table types
-
getTables
Convenience method to return the table meta data using the configured catalog, schema pattern and table types.- Parameters:
tableNamePattern
- The pattern identifying for which tables to return info- Returns:
- The table meta data
- Throws:
SQLException
- If an error occurred retrieving the meta data- See Also:
-
getColumns
Convenience method to return the column meta data using the configured catalog and schema pattern.- Parameters:
tableNamePattern
- The pattern identifying for which tables to return infocolumnNamePattern
- The pattern identifying for which columns to return info- Returns:
- The column meta data
- Throws:
SQLException
- If an error occurred retrieving the meta data- See Also:
-
getPrimaryKeys
Convenience method to return the primary key meta data using the configured catalog and schema pattern.- Parameters:
tableNamePattern
- The pattern identifying for which tables to return info- Returns:
- The primary key meta data
- Throws:
SQLException
- If an error occurred retrieving the meta data- See Also:
-
getForeignKeys
Convenience method to return the foreign key meta data using the configured catalog and schema pattern.- Parameters:
tableNamePattern
- The pattern identifying for which tables to return info- Returns:
- The foreign key meta data
- Throws:
SQLException
- If an error occurred retrieving the meta data- See Also:
-
getIndices
public ResultSet getIndices(String tableNamePattern, boolean unique, boolean approximate) throws SQLException Convenience method to return the index meta data using the configured catalog and schema pattern.- Parameters:
tableNamePattern
- The pattern identifying for which tables to return infounique
- Whether to return only indices for unique valuesapproximate
- Whether the result is allowed to reflect approximate or out of data values- Returns:
- The index meta data
- Throws:
SQLException
- If an error occurred retrieving the meta data- See Also:
-