|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jdbwc.core.PgSQLDBMDFromInfoSchema
public class PgSQLDBMDFromInfoSchema
This MetaData class is designed for PostgreSQL implementations
greater than 7.4.x.
Moved all methods that use INFORMATION_SCHEMA into this class
to seperate the query logic from PgSQLDatabaseMetaData and to
make Driver maintenance and development a little easier.
Field Summary | |
---|---|
protected WCConnection |
myConnection
The connection that created this WCDatabaseMetaData |
protected static java.lang.String |
myTabletypes
The first 2 are known Table types. |
Constructor Summary | |
---|---|
protected |
PgSQLDBMDFromInfoSchema(WCConnection connection)
|
Method Summary | |
---|---|
java.sql.ResultSet |
getAttributes(java.lang.String catalog,
java.lang.String schemaPattern,
java.lang.String typeNamePattern,
java.lang.String attributeNamePattern)
Retrieves a description of the given attribute of the given type for a user-defined type (UDT) that is available in the given schema and catalog. Descriptions are returned only for attributes of UDTs matching the catalog, schema, type, and attribute name criteria. They are ordered by TYPE_CAT, TYPE_SCHEM, TYPE_NAME and ORDINAL_POSITION. |
java.sql.ResultSet |
getBestRowIdentifier(java.lang.String catalog,
java.lang.String schema,
java.lang.String table,
int scope,
boolean nullable)
|
java.sql.ResultSet |
getCatalogs()
Retrieves the catalog names available in this database. |
java.sql.ResultSet |
getClientInfoProperties()
Retrieves a list of the client info properties that the driver supports. |
java.sql.ResultSet |
getColumnPrivileges(java.lang.String catalog,
java.lang.String schema,
java.lang.String table,
java.lang.String columnNamePattern)
Retrieves a description of the access rights for a table's columns. Only privileges matching the column name criteria are returned. |
java.sql.ResultSet |
getColumns(java.lang.String catalog,
java.lang.String schemaPattern,
java.lang.String tableNamePattern,
java.lang.String columnNamePattern)
Retrieves a description of table columns available in the specified catalog. |
java.sql.ResultSet |
getCrossReference(java.lang.String parentCatalog,
java.lang.String parentSchema,
java.lang.String parentTable,
java.lang.String foreignCatalog,
java.lang.String foreignSchema,
java.lang.String foreignTable)
|
int |
getDefaultTransactionIsolation()
|
java.sql.ResultSet |
getExportedKeys(java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
Retrieves a description of the foreign key columns that reference the given table's primary key columns (the foreign keys exported by a table). They are ordered by FKTABLE_CAT, FKTABLE_SCHEM, FKTABLE_NAME, and KEY_SEQ. |
java.sql.ResultSet |
getFunctionColumns(java.lang.String catalog,
java.lang.String schemaPattern,
java.lang.String functionNamePattern,
java.lang.String columnNamePattern)
Retrieves a description of the given catalog's system or user function parameters and return type. |
java.sql.ResultSet |
getFunctions(java.lang.String catalog,
java.lang.String schemaPattern,
java.lang.String functionNamePattern)
Retrieves a description of the system and user functions available in the given catalog. |
java.sql.ResultSet |
getImportedKeys(java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
Retrieves a description of the primary key columns that are referenced by the given table's foreign key columns (the primary keys imported by a table). |
java.sql.ResultSet |
getIndexInfo(java.lang.String catalog,
java.lang.String schema,
java.lang.String table,
boolean unique,
boolean approximate)
Retrieves a description of the given table's indices and statistics. |
java.sql.ResultSet |
getPrimaryKeys(java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
Retrieves a description of the given table's primary key columns. They are ordered by COLUMN_NAME. |
java.sql.ResultSet |
getProcedureColumns(java.lang.String catalog,
java.lang.String schemaPattern,
java.lang.String procedureNamePattern,
java.lang.String columnNamePattern)
|
java.sql.ResultSet |
getProcedures(java.lang.String catalog,
java.lang.String schemaPattern,
java.lang.String procedureNamePattern)
Retrieves a description of the stored procedures available in the given catalog. |
java.lang.String |
getProcedureTerm()
Retrieves the database vendor's preferred term for "procedure". |
java.sql.ResultSet |
getSchemas()
Retrieves the schema names available in this database. |
java.sql.ResultSet |
getSchemas(java.lang.String catalog,
java.lang.String schemaPattern)
Retrieves the schema names available in this database. |
java.sql.ResultSet |
getTablePrivileges(java.lang.String catalog,
java.lang.String schemaPattern,
java.lang.String tableNamePattern)
Retrieves a description of the access rights for each table available in a catalog. |
java.sql.ResultSet |
getTables(java.lang.String catalog,
java.lang.String schemaPattern,
java.lang.String tableNamePattern,
java.lang.String[] types)
Retrieves a description of the tables available in the given catalog. |
java.sql.ResultSet |
getUDTs(java.lang.String catalog,
java.lang.String schemaPattern,
java.lang.String typeNamePattern,
int[] types)
|
java.sql.ResultSet |
getVersionColumns(java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected transient WCConnection myConnection
protected static final java.lang.String myTabletypes
Constructor Detail |
---|
protected PgSQLDBMDFromInfoSchema(WCConnection connection) throws java.sql.SQLException
java.sql.SQLException
Method Detail |
---|
public java.sql.ResultSet getAttributes(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String typeNamePattern, java.lang.String attributeNamePattern) throws java.sql.SQLException
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 searchtypeNamePattern
- a type name pattern; must match the type name as it is stored in the databaseattributeNamePattern
- an attribute name pattern; must match the attribute name as it is declared in the database
java.sql.SQLException
- if a database access error occursDatabaseMetaData.getSearchStringEscape()
public java.sql.ResultSet getBestRowIdentifier(java.lang.String catalog, java.lang.String schema, java.lang.String table, int scope, boolean nullable) throws java.sql.SQLException
java.sql.SQLException
public java.sql.ResultSet getCatalogs() throws java.sql.SQLException
The catalog column is:
ResultSet
object in which each row has a
single String
column that is a catalog name
java.sql.SQLException
- if a database access error occurspublic java.sql.ResultSet getClientInfoProperties() throws java.sql.SQLException
java.sql.SQLException
- if a database access error occurspublic java.sql.ResultSet getColumnPrivileges(java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String columnNamePattern) throws java.sql.SQLException
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 searchschema
- a schema name; 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 searchtable
- a table name; 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
java.sql.SQLException
- if a database access error occursDatabaseMetaData.getSearchStringEscape()
public java.sql.ResultSet getColumns(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern, java.lang.String columnNamePattern) throws java.sql.SQLException
Only column descriptions matching the catalog, schema, table
and column name criteria are returned. They are ordered by
TABLE_CAT
,TABLE_SCHEM
,
TABLE_NAME
, and ORDINAL_POSITION
.
Each column description has the following columns:
null
)
null
)
NULL
values
NULL
values
null
)
null
)
null
if DATA_TYPE isn't REF)
null
if the DATA_TYPE isn't REF)
null
if the DATA_TYPE isn't REF)
null
if DATA_TYPE
isn't DISTINCT or user-generated REF)
The COLUMN_SIZE column the specified column size for the given column. For numeric data, this is the maximum precision. For character data, this is the length in characters. For datetime datatypes, this is the length in characters of the String representation (assuming the maximum allowed precision of the fractional seconds component). For binary data, this is the length in bytes. For the ROWID datatype, this is the length in bytes. Null is returned for data types where the column size is not applicable.
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
ResultSet
- each row is a column description
java.sql.SQLException
- if a database access error occursDatabaseMetaData.getSearchStringEscape()
public java.sql.ResultSet getCrossReference(java.lang.String parentCatalog, java.lang.String parentSchema, java.lang.String parentTable, java.lang.String foreignCatalog, java.lang.String foreignSchema, java.lang.String foreignTable) throws java.sql.SQLException
java.sql.SQLException
public int getDefaultTransactionIsolation() throws java.sql.SQLException
java.sql.SQLException
public java.sql.ResultSet getExportedKeys(java.lang.String catalog, java.lang.String schema, java.lang.String table) throws java.sql.SQLException
catalog
- a catalog name; must match the catalog name as it is stored in this database; "" retrieves those without a catalog; null means that the catalog name should not be used to narrow the searchschema
- a schema name; 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 searchtable
- a table name; must match the table name as it is stored in this database
java.sql.SQLException
- if a database access error occursDatabaseMetaData.getImportedKeys(java.lang.String, java.lang.String, java.lang.String)
public java.sql.ResultSet getFunctionColumns(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String functionNamePattern, java.lang.String columnNamePattern) throws java.sql.SQLException
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 searchfunctionNamePattern
- a procedure name pattern; must match the function name as it is stored in the databasecolumnNamePattern
- a parameter name pattern; must match the parameter or column name as it is stored in the database
java.sql.SQLException
- if a database access error occursDatabaseMetaData.getSearchStringEscape()
public java.sql.ResultSet getFunctions(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String functionNamePattern) throws java.sql.SQLException
Only system and user function descriptions matching the schema and
function name criteria are returned. They are ordered by
FUNCTION_CAT
, FUNCTION_SCHEM
,
FUNCTION_NAME
and
SPECIFIC_ NAME
.
Each function description has the the following columns:
null
)
null
)
FUNCTION_NAME
for example with overload functions
A user may not have permission to execute any of the functions that are
returned by getFunctions
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 searchfunctionNamePattern
- a function name pattern; must match the
function name as it is stored in the database
ResultSet
- each row is a function description
java.sql.SQLException
- if a database access error occursDatabaseMetaData.getSearchStringEscape()
public java.sql.ResultSet getImportedKeys(java.lang.String catalog, java.lang.String schema, java.lang.String table) throws java.sql.SQLException
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 searchschema
- a schema name; 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 searchtable
- a table name; must match the table name as it is stored in the database
java.sql.SQLException
- if a database access error occursDatabaseMetaData.getExportedKeys(java.lang.String, java.lang.String, java.lang.String)
public java.sql.ResultSet getIndexInfo(java.lang.String catalog, java.lang.String schema, java.lang.String table, boolean unique, boolean approximate) throws java.sql.SQLException
catalog
- a catalog name; must match the catalog name as it is stored in this database; "" retrieves those without a catalog; null means that the catalog name should not be used to narrow the searchschema
- a schema name; must match the schema name as it is stored in this database; "" retrieves those without a schema; null means that the schema name should not be used to narrow the searchtable
- a table name; must match the table name as it is stored in this databaseunique
- when true, return only indices for unique values; when false, return indices regardless of whether unique or notapproximate
- when true, result is allowed to reflect approximate or out of data values; when false, results are requested to be accurate
java.sql.SQLException
- if a database access error occurspublic java.sql.ResultSet getPrimaryKeys(java.lang.String catalog, java.lang.String schema, java.lang.String table) throws java.sql.SQLException
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 searchschema
- a schema name; 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 searchtable
- a table name; must match the table name as it is stored in the database
java.sql.SQLException
- if a database access error occurspublic java.sql.ResultSet getProcedureColumns(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String procedureNamePattern, java.lang.String columnNamePattern) throws java.sql.SQLException
java.sql.SQLException
DatabaseMetaData.getProcedureColumns(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public java.lang.String getProcedureTerm() throws java.sql.SQLException
java.sql.SQLException
- if a database access error occurspublic java.sql.ResultSet getProcedures(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String procedureNamePattern) throws java.sql.SQLException
Only procedure descriptions matching the schema and
procedure name criteria are returned. They are ordered by
PROCEDURE_CAT
, PROCEDURE_SCHEM
,
PROCEDURE_NAME
and SPECIFIC_ NAME
.
Each procedure description has the the following columns:
null
)
null
)
A user may not have permissions to execute any of the procedures that are
returned by getProcedures
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 searchprocedureNamePattern
- a procedure name pattern; must match the
procedure name as it is stored in the database
ResultSet
- each row is a procedure description
java.sql.SQLException
- if a database access error occursDatabaseMetaData.getSearchStringEscape()
public java.sql.ResultSet getSchemas() throws java.sql.SQLException
TABLE_CATALOG
and
TABLE_SCHEM
.
The schema columns are:
null
)
ResultSet
object in which each row is a
schema description
java.sql.SQLException
- if a database access error occurspublic java.sql.ResultSet getSchemas(java.lang.String catalog, java.lang.String schemaPattern) throws java.sql.SQLException
TABLE_CATALOG
and
TABLE_SCHEM
.
The schema columns are:
null
)
catalog
- a catalog name; must match the catalog name as it is stored
in the database;"" retrieves those without a catalog; null means catalog
name should not be used to narrow down the search.schemaPattern
- a schema name; must match the schema name as it is
stored in the database; null means
schema name should not be used to narrow down the search.
ResultSet
object in which each row is a
schema description
java.sql.SQLException
- if a database access error occursDatabaseMetaData.getSearchStringEscape()
public java.sql.ResultSet getTables(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern, java.lang.String[] types) throws java.sql.SQLException
TABLE_TYPE
, TABLE_CAT
,
TABLE_SCHEM
and TABLE_NAME
.
Each table description has the following columns:
null
)
null
)
null
)
null
)
null
)
null
)
null
)
Note: Some databases may not return information for all tables.
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 from DatabaseMetaData.getTableTypes()
,to include; null
returns
all types
ResultSet
- each row is a table description
java.sql.SQLException
- if a database access error occursDatabaseMetaData.getSearchStringEscape()
public java.sql.ResultSet getTablePrivileges(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String tableNamePattern) throws java.sql.SQLException
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 database
java.sql.SQLException
- if a database access error occursDatabaseMetaData.getSearchStringEscape()
public java.sql.ResultSet getUDTs(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String typeNamePattern, int[] types) throws java.sql.SQLException
java.sql.SQLException
public java.sql.ResultSet getVersionColumns(java.lang.String catalog, java.lang.String schema, java.lang.String table) throws java.sql.SQLException
java.sql.SQLException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |