|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mysql.jdbc.DatabaseMetaData
com.mysql.jdbc.DatabaseMetaDataUsingInfoSchema
public class DatabaseMetaDataUsingInfoSchema
DatabaseMetaData implementation that uses INFORMATION_SCHEMA available in MySQL-5.0 and newer. The majority of the queries in this code were built for Connector/OO.org by Georg Richter (georg_at_mysql.com).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.mysql.jdbc.DatabaseMetaData |
---|
DatabaseMetaData.IteratorWithCleanup, DatabaseMetaData.LocalAndReferencedColumns, DatabaseMetaData.ResultSetIterator, DatabaseMetaData.SingleStringIterator, DatabaseMetaData.TypeDescriptor |
Field Summary |
---|
Fields inherited from class com.mysql.jdbc.DatabaseMetaData |
---|
conn, database, MAX_IDENTIFIER_LENGTH, quotedId |
Fields inherited from interface java.sql.DatabaseMetaData |
---|
attributeNoNulls, attributeNullable, attributeNullableUnknown, bestRowNotPseudo, bestRowPseudo, bestRowSession, bestRowTemporary, bestRowTransaction, bestRowUnknown, columnNoNulls, columnNullable, columnNullableUnknown, functionColumnIn, functionColumnInOut, functionColumnOut, functionColumnResult, functionColumnUnknown, functionNoNulls, functionNoTable, functionNullable, functionNullableUnknown, functionResultUnknown, functionReturn, functionReturnsTable, importedKeyCascade, importedKeyInitiallyDeferred, importedKeyInitiallyImmediate, importedKeyNoAction, importedKeyNotDeferrable, importedKeyRestrict, importedKeySetDefault, importedKeySetNull, procedureColumnIn, procedureColumnInOut, procedureColumnOut, procedureColumnResult, procedureColumnReturn, procedureColumnUnknown, procedureNoNulls, procedureNoResult, procedureNullable, procedureNullableUnknown, procedureResultUnknown, procedureReturnsResult, sqlStateSQL, sqlStateSQL99, sqlStateXOpen, tableIndexClustered, tableIndexHashed, tableIndexOther, tableIndexStatistic, typeNoNulls, typeNullable, typeNullableUnknown, typePredBasic, typePredChar, typePredNone, typeSearchable, versionColumnNotPseudo, versionColumnPseudo, versionColumnUnknown |
Constructor Summary | |
---|---|
protected |
DatabaseMetaDataUsingInfoSchema(ConnectionImpl connToSet,
java.lang.String databaseToSet)
|
Method Summary | |
---|---|
java.sql.ResultSet |
getColumnPrivileges(java.lang.String catalog,
java.lang.String schema,
java.lang.String table,
java.lang.String columnNamePattern)
Get a description of the access rights for a table's columns. |
java.sql.ResultSet |
getColumns(java.lang.String catalog,
java.lang.String schemaPattern,
java.lang.String tableName,
java.lang.String columnNamePattern)
Get a description of table columns available in a catalog. |
java.sql.ResultSet |
getCrossReference(java.lang.String primaryCatalog,
java.lang.String primarySchema,
java.lang.String primaryTable,
java.lang.String foreignCatalog,
java.lang.String foreignSchema,
java.lang.String foreignTable)
Get a description of the foreign key columns in the foreign key table that reference the primary key columns of the primary key table (describe how one table imports another's key.) |
java.sql.ResultSet |
getExportedKeys(java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
Get a description of a foreign key columns that reference a table's primary key columns (the foreign keys exported by a table). |
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 |
getImportedKeys(java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
Get a description of the primary key columns that are referenced by a 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)
Get a description of a table's indices and statistics. |
java.sql.ResultSet |
getPrimaryKeys(java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
Get a description of a table's primary key columns. |
java.sql.ResultSet |
getProcedureColumns(java.lang.String catalog,
java.lang.String schemaPattern,
java.lang.String procedureNamePattern,
java.lang.String columnNamePattern)
Retrieves a description of the given catalog's stored procedure parameter and result columns. |
java.sql.ResultSet |
getProcedures(java.lang.String catalog,
java.lang.String schemaPattern,
java.lang.String procedureNamePattern)
Get a description of stored procedures available in a catalog. |
java.sql.ResultSet |
getTables(java.lang.String catalog,
java.lang.String schemaPattern,
java.lang.String tableNamePattern,
java.lang.String[] types)
Get a description of tables available in a catalog. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.sql.DatabaseMetaData |
---|
autoCommitFailureClosesAllResultSets, getClientInfoProperties, getFunctions, getRowIdLifetime |
Methods inherited from interface java.sql.Wrapper |
---|
isWrapperFor, unwrap |
Constructor Detail |
---|
protected DatabaseMetaDataUsingInfoSchema(ConnectionImpl connToSet, java.lang.String databaseToSet) throws java.sql.SQLException
java.sql.SQLException
Method Detail |
---|
public java.sql.ResultSet getColumnPrivileges(java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String columnNamePattern) throws java.sql.SQLException
Only privileges matching the column name criteria are returned. They are ordered by COLUMN_NAME and PRIVILEGE.
Each privilige description has the following columns:
getColumnPrivileges
in interface java.sql.DatabaseMetaData
getColumnPrivileges
in class DatabaseMetaData
catalog
- a catalog name; "" retrieves those without a catalogschema
- a schema name; "" retrieves those without a schematable
- a table namecolumnNamePattern
- a column name pattern
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 tableName, 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_SCHEM, TABLE_NAME and ORDINAL_POSITION.
Each column description has the following columns:
getColumns
in interface java.sql.DatabaseMetaData
getColumns
in class DatabaseMetaData
catalog
- a catalog name; "" retrieves those without a catalogschemaPattern
- a schema name pattern; "" retrieves those without a schematableName
- a table name patterncolumnNamePattern
- a column name pattern
java.sql.SQLException
- if a database access error occursDatabaseMetaData.getSearchStringEscape()
public java.sql.ResultSet getCrossReference(java.lang.String primaryCatalog, java.lang.String primarySchema, java.lang.String primaryTable, java.lang.String foreignCatalog, java.lang.String foreignSchema, java.lang.String foreignTable) throws java.sql.SQLException
Each foreign key column description has the following columns:
getCrossReference
in interface java.sql.DatabaseMetaData
getCrossReference
in class DatabaseMetaData
primaryCatalog
- a catalog name; "" retrieves those without a catalogprimarySchema
- a schema name pattern; "" retrieves those without a schemaprimaryTable
- a table nameforeignCatalog
- a catalog name; "" retrieves those without a catalogforeignSchema
- a schema name pattern; "" retrieves those without a schemaforeignTable
- a table name
java.sql.SQLException
- if a database access error occurspublic java.sql.ResultSet getExportedKeys(java.lang.String catalog, java.lang.String schema, java.lang.String table) throws java.sql.SQLException
Each foreign key column description has the following columns:
getExportedKeys
in interface java.sql.DatabaseMetaData
getExportedKeys
in class DatabaseMetaData
catalog
- a catalog name; "" retrieves those without a catalogschema
- a schema name pattern; "" retrieves those without a schematable
- a table name
java.sql.SQLException
- if a database access error occursgetImportedKeys(java.lang.String, java.lang.String, java.lang.String)
public java.sql.ResultSet getImportedKeys(java.lang.String catalog, java.lang.String schema, java.lang.String table) throws java.sql.SQLException
Each primary key column description has the following columns:
getImportedKeys
in interface java.sql.DatabaseMetaData
getImportedKeys
in class DatabaseMetaData
catalog
- a catalog name; "" retrieves those without a catalogschema
- a schema name pattern; "" retrieves those without a schematable
- a table name
java.sql.SQLException
- if a database access error occursgetExportedKeys(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
Each index column description has the following columns:
getIndexInfo
in interface java.sql.DatabaseMetaData
getIndexInfo
in class DatabaseMetaData
catalog
- a catalog name; "" retrieves those without a catalogschema
- a schema name pattern; "" retrieves those without a schematable
- a table nameunique
- 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
- DOCUMENT ME!public java.sql.ResultSet getPrimaryKeys(java.lang.String catalog, java.lang.String schema, java.lang.String table) throws java.sql.SQLException
Each column description has the following columns:
getPrimaryKeys
in interface java.sql.DatabaseMetaData
getPrimaryKeys
in class DatabaseMetaData
catalog
- a catalog name; "" retrieves those without a catalogschema
- a schema name pattern; "" retrieves those without a schematable
- a table name
java.sql.SQLException
- DOCUMENT ME!public 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_SCHEM, and PROCEDURE_NAME.
Each procedure description has the the following columns:
getProcedures
in interface java.sql.DatabaseMetaData
getProcedures
in class DatabaseMetaData
catalog
- a catalog name; "" retrieves those without a catalogschemaPattern
- a schema name pattern; "" retrieves those without a schemaprocedureNamePattern
- a procedure name pattern
java.sql.SQLException
- if a database access error occursDatabaseMetaData.getSearchStringEscape()
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
Only descriptions matching the schema, function and
parameter name criteria are returned. They are ordered by
FUNCTION_CAT
, FUNCTION_SCHEM
,
FUNCTION_NAME
and
SPECIFIC_ NAME
. Within this, the return value,
if any, is first. Next are the parameter descriptions in call
order. The column descriptions follow in column number order.
Each row in the ResultSet
is a parameter description, column description or
return type description with the following fields:
null
)
null
)
ResultSet
FUNCTION_NAME
for example with overload functions
The PRECISION column represents the specified column size for the given parameter or 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.
getFunctionColumns
in interface java.sql.DatabaseMetaData
getFunctionColumns
in class DatabaseMetaData
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
ResultSet
- each row describes a
user function parameter, column or return type
java.sql.SQLException
- if a database access error occursDatabaseMetaData.getSearchStringEscape()
public java.sql.ResultSet getProcedureColumns(java.lang.String catalog, java.lang.String schemaPattern, java.lang.String procedureNamePattern, java.lang.String columnNamePattern) throws java.sql.SQLException
Only descriptions matching the schema, procedure and parameter name criteria are returned. They are ordered by PROCEDURE_SCHEM and PROCEDURE_NAME. Within this, the return value, if any, is first. Next are the parameter descriptions in call order. The column descriptions follow in column number order.
Each row in the ResultSet
is a parameter description or
column description with the following fields:
null
)
null
)
ResultSet
Note: Some databases may not return the column descriptions for a procedure. Additional columns beyond REMARKS can be defined by the database.
getProcedureColumns
in interface java.sql.DatabaseMetaData
getProcedureColumns
in class DatabaseMetaData
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 databasecolumnNamePattern
- a column name pattern; must match the column name
as it is stored in the database
ResultSet
- each row describes a stored procedure parameter or
column
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
Only table descriptions matching the catalog, schema, table name and type criteria are returned. They are ordered by TABLE_TYPE, TABLE_SCHEM and TABLE_NAME.
Each table description has the following columns:
Note: Some databases may not return information for all tables.
getTables
in interface java.sql.DatabaseMetaData
getTables
in class DatabaseMetaData
catalog
- a catalog name; "" retrieves those without a catalogschemaPattern
- a schema name pattern; "" retrieves those without a schematableNamePattern
- a table name patterntypes
- a list of table types to include; null returns all types
java.sql.SQLException
- DOCUMENT ME!DatabaseMetaData.getSearchStringEscape()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |