public class DatabaseMetaDataWrapper extends Object
| Constructor and Description |
|---|
DatabaseMetaDataWrapper() |
| Modifier and Type | Method and Description |
|---|---|
String |
escapeForSearch(String literalString)
Escape a string literal so that it can be used as a search pattern.
|
String |
getCatalog()
Returns the catalog in the database to read.
|
ResultSet |
getColumns(String tableNamePattern,
String columnNamePattern)
Convenience method to return the column meta data using the configured catalog and
schema pattern.
|
ResultSet |
getForeignKeys(String tableNamePattern)
Convenience method to return the foreign key meta data using the configured catalog and
schema pattern.
|
ResultSet |
getIndices(String tableNamePattern,
boolean unique,
boolean approximate)
Convenience method to return the index meta data using the configured catalog and
schema pattern.
|
DatabaseMetaData |
getMetaData()
Returns the database meta data.
|
ResultSet |
getPrimaryKeys(String tableNamePattern)
Convenience method to return the primary key meta data using the configured catalog and
schema pattern.
|
String |
getSchemaPattern()
Returns the schema in the database to read.
|
ResultSet |
getTables(String tableNamePattern)
Convenience method to return the table meta data using the configured catalog,
schema pattern and table types.
|
String[] |
getTableTypes()
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.
|
public DatabaseMetaData getMetaData()
public void setMetaData(DatabaseMetaData metaData)
metaData - The meta datapublic String getCatalog()
public void setCatalog(String catalog)
catalog - The catalogpublic String getSchemaPattern()
public void setSchemaPattern(String schema)
schema - The schemapublic String[] getTableTypes()
public void setTableTypes(String[] types)
types - The table typespublic String escapeForSearch(String literalString) throws SQLException
literalString - The string to escape.SQLException - If an error occurred retrieving the meta datapublic ResultSet getTables(String tableNamePattern) throws SQLException
tableNamePattern - The pattern identifying for which tables to return infoSQLException - If an error occurred retrieving the meta dataDatabaseMetaData.getTables(java.lang.String, java.lang.String, java.lang.String, java.lang.String[])public ResultSet getColumns(String tableNamePattern, String columnNamePattern) throws SQLException
tableNamePattern - The pattern identifying for which tables to return infocolumnNamePattern - The pattern identifying for which columns to return infoSQLException - If an error occurred retrieving the meta dataDatabaseMetaData.getColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String)public ResultSet getPrimaryKeys(String tableNamePattern) throws SQLException
tableNamePattern - The pattern identifying for which tables to return infoSQLException - If an error occurred retrieving the meta dataDatabaseMetaData.getPrimaryKeys(java.lang.String, java.lang.String, java.lang.String)public ResultSet getForeignKeys(String tableNamePattern) throws SQLException
tableNamePattern - The pattern identifying for which tables to return infoSQLException - If an error occurred retrieving the meta dataDatabaseMetaData.getImportedKeys(java.lang.String, java.lang.String, java.lang.String)public ResultSet getIndices(String tableNamePattern, boolean unique, boolean approximate) throws SQLException
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 valuesSQLException - If an error occurred retrieving the meta dataDatabaseMetaData.getIndexInfo(java.lang.String, java.lang.String, java.lang.String, boolean, boolean)Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.