Top Description Inners Fields Constructors Methods
com.mysql.cj.jdbc

public Class DatabaseMetaDataUsingInfoSchema

extends DatabaseMetaData
Class Inheritance
Imports
java.sql.PreparedStatement, .ResultSet, .SQLException, .Statement, .Types, java.util.ArrayList, .Collections, .List, .Map, java.util.concurrent.locks.Lock, .ReentrantLock, com.mysql.cj.Messages, .MysqlType, .ServerVersion, com.mysql.cj.conf.PropertyDefinitions.DatabaseTerm, .PropertyKey, com.mysql.cj.exceptions.MysqlErrorNumbers, com.mysql.cj.jdbc.exceptions.SQLError, com.mysql.cj.jdbc.result.ResultSetFactory, com.mysql.cj.util.LRUCache, .StringUtils

DatabaseMetaData implementation that uses INFORMATION_SCHEMA

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static enum

Field Summary

Modifier and TypeField and Description
private static final Lock
private static Map<ServerVersion, String>
Inherited from com.mysql.cj.jdbc.DatabaseMetaData:
conndatabasedatabaseTermMAX_IDENTIFIER_LENGTHmaxBufferSizenullDatabaseMeansCurrentpedanticquotedIdresultSetFactorysessionSQL2003_KEYWORDSSYSTEM_TABLE_AS_BYTESTABLE_AS_BYTEStinyInt1isBittransformedBitIsBooleanuseHostsInPrivilegesVIEW_AS_BYTESyearIsDateType

Constructor Summary

AccessConstructor and Description
protected
DatabaseMetaDataUsingInfoSchema(JdbcConnection connToSet, String databaseToSet, ResultSetFactory resultSetFactory)

Method Summary

Modifier and TypeMethod and Description
private final void
appendJdbcTypeMappingQuery(StringBuilder buf, String mysqlTypeColumnName, String fullMysqlTypeColumnName)

protected ResultSet
private String
private String
private String
public ResultSet
getBestRowIdentifier(String
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 search
catalog
,
String
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 search
schema
,
String
a table name; must match the table name as it is stored in the database
table
,
int
the scope of interest; use same values as SCOPE
scope
,
boolean
include columns that are nullable.
nullable
)

Overrides com.mysql.cj.jdbc.DatabaseMetaData.getBestRowIdentifier.

Implements java.sql.DatabaseMetaData.getBestRowIdentifier.

Retrieves a description of a table's optimal set of columns that uniquely identifies a row.

public ResultSet
getCatalogs()

Overrides com.mysql.cj.jdbc.DatabaseMetaData.getCatalogs.

Implements java.sql.DatabaseMetaData.getCatalogs.

Retrieves the catalog names available in this database.

public ResultSet
getColumnPrivileges(String
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 search
catalog
,
String
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 search
schema
,
String
a table name; must match the table name as it is stored in the database
table
,
String
a column name pattern; must match the column name as it is stored in the database
columnNamePattern
)

Overrides com.mysql.cj.jdbc.DatabaseMetaData.getColumnPrivileges.

Implements java.sql.DatabaseMetaData.getColumnPrivileges.

Retrieves a description of the access rights for a table's columns.

public ResultSet
getColumns(String
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 search
catalog
,
String
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 search
schemaPattern
,
String
a table name pattern; must match the table name as it is stored in the database
tableNamePattern
,
String
a column name pattern; must match the column name as it is stored in the database
columnNamePattern
)

Overrides com.mysql.cj.jdbc.DatabaseMetaData.getColumns.

Implements java.sql.DatabaseMetaData.getColumns.

Retrieves a description of table columns available in the specified catalog.

public ResultSet
getCrossReference(final String
a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog; null means drop catalog name from the selection criteria
parentCatalog
,
final String
a schema name; must match the schema name as it is stored in the database; "" retrieves those without a schema; null means drop schema name from the selection criteria
parentSchema
,
final String
the name of the table that exports the key; must match the table name as it is stored in the database
parentTable
,
final String
a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog; null means drop catalog name from the selection criteria
foreignCatalog
,
final String
a schema name; must match the schema name as it is stored in the database; "" retrieves those without a schema; null means drop schema name from the selection criteria
foreignSchema
,
final String
the name of the table that imports the key; must match the table name as it is stored in the database
foreignTable
)

Overrides com.mysql.cj.jdbc.DatabaseMetaData.getCrossReference.

Implements java.sql.DatabaseMetaData.getCrossReference.

Retrieves a description of the foreign key columns in the given foreign key table that reference the primary key or the columns representing a unique constraint of the parent table (could be the same or a different table).

public ResultSet
getExportedKeys(String
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 search
catalog
,
String
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 search
schema
,
String
a table name; must match the table name as it is stored in this database
table
)

Overrides com.mysql.cj.jdbc.DatabaseMetaData.getExportedKeys.

Implements java.sql.DatabaseMetaData.getExportedKeys.

Retrieves a description of the foreign key columns that reference the given table's primary key columns (the foreign keys exported by a table).

public ResultSet
getFunctionColumns(String
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 search
catalog
,
String
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 search
schemaPattern
,
String
a procedure name pattern; must match the function name as it is stored in the database
functionNamePattern
,
String
a parameter name pattern; must match the parameter or column name as it is stored in the database
columnNamePattern
)

Overrides com.mysql.cj.jdbc.DatabaseMetaData.getFunctionColumns.

Implements java.sql.DatabaseMetaData.getFunctionColumns.

Retrieves a description of the given catalog's system or user function parameters and return type.

protected int

Returns:

one of the java.sql.DatabaseMetaData#function* fields.
getFunctionConstant
(DatabaseMetaDataUsingInfoSchema.FunctionConstant
the constant id from DatabaseMetaData fields to return.
constant
)

Getter to DatabaseMetaData.function* constants.

public ResultSet
getFunctions(String
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 search
catalog
,
String
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 search
schemaPattern
,
String
a function name pattern; must match the function name as it is stored in the database
functionNamePattern
)

Overrides com.mysql.cj.jdbc.DatabaseMetaData.getFunctions.

Implements java.sql.DatabaseMetaData.getFunctions.

Retrieves a description of the system and user functions available in the given catalog.

public ResultSet
getImportedKeys(String
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 search
catalog
,
String
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 search
schema
,
String
a table name; must match the table name as it is stored in the database
table
)

Overrides com.mysql.cj.jdbc.DatabaseMetaData.getImportedKeys.

Implements java.sql.DatabaseMetaData.getImportedKeys.

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).

public ResultSet
getIndexInfo(String
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 search
catalog
,
String
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 search
schema
,
String
a table name; must match the table name as it is stored in this database
table
,
boolean
when true, return only indices for unique values; when false, return indices regardless of whether unique or not
unique
,
boolean
when true, result is allowed to reflect approximate or out of data values; when false, results are requested to be accurate
approximate
)

Overrides com.mysql.cj.jdbc.DatabaseMetaData.getIndexInfo.

Implements java.sql.DatabaseMetaData.getIndexInfo.

Retrieves a description of the given table's indices and statistics.

public ResultSet
getPrimaryKeys(String
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 search
catalog
,
String
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 search
schema
,
String
a table name; must match the table name as it is stored in the database
table
)

Overrides com.mysql.cj.jdbc.DatabaseMetaData.getPrimaryKeys.

Implements java.sql.DatabaseMetaData.getPrimaryKeys.

Retrieves a description of the given table's primary key columns.

public ResultSet
getProcedureColumns(String
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 search
catalog
,
String
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 search
schemaPattern
,
String
a procedure name pattern; must match the procedure name as it is stored in the database
procedureNamePattern
,
String
a column name pattern; must match the column name as it is stored in the database
columnNamePattern
)

Overrides com.mysql.cj.jdbc.DatabaseMetaData.getProcedureColumns.

Implements java.sql.DatabaseMetaData.getProcedureColumns.

Retrieves a description of the given catalog's stored procedure parameter and result columns.

public ResultSet
getProcedures(String
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 search
catalog
,
String
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 search
schemaPattern
,
String
a procedure name pattern; must match the procedure name as it is stored in the database
procedureNamePattern
)

Overrides com.mysql.cj.jdbc.DatabaseMetaData.getProcedures.

Implements java.sql.DatabaseMetaData.getProcedures.

Retrieves a description of the stored procedures available in the given catalog.

public ResultSet
getSchemas()

Overrides com.mysql.cj.jdbc.DatabaseMetaData.getSchemas.

Implements java.sql.DatabaseMetaData.getSchemas.

Retrieves the schema names available in this database.

public ResultSet
getSchemas(String
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.
catalog
,
String
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.
schemaPattern
)

Overrides com.mysql.cj.jdbc.DatabaseMetaData.getSchemas.

Implements java.sql.DatabaseMetaData.getSchemas.

Retrieves the schema names available in this database.

public String
getSQLKeywords()

Overrides com.mysql.cj.jdbc.DatabaseMetaData.getSQLKeywords.

Implements java.sql.DatabaseMetaData.getSQLKeywords.

Get a comma separated list of all a database's SQL keywords that are NOT also SQL92/SQL2003 keywords.

public ResultSet
getTablePrivileges(String
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 search
catalog
,
String
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 search
schemaPattern
,
String
a table name pattern; must match the table name as it is stored in the database
tableNamePattern
)

Overrides com.mysql.cj.jdbc.DatabaseMetaData.getTablePrivileges.

Implements java.sql.DatabaseMetaData.getTablePrivileges.

Retrieves a description of the access rights for each table available in a catalog.

public ResultSet
getTables(String
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 search
catalog
,
String
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 search
schemaPattern
,
String
a table name pattern; must match the table name as it is stored in the database
tableNamePattern
,
String[]
a list of table types, which must be from the list of table types returned from getTableTypes, to include; null returns all types
types
)

Overrides com.mysql.cj.jdbc.DatabaseMetaData.getTables.

Implements java.sql.DatabaseMetaData.getTables.

Retrieves a description of the tables available in the given catalog.

public ResultSet
getVersionColumns(String
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 search
catalog
,
String
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 search
schema
,
String
a table name; must match the table name as it is stored in the database
table
)

Overrides com.mysql.cj.jdbc.DatabaseMetaData.getVersionColumns.

Implements java.sql.DatabaseMetaData.getVersionColumns.

Retrieves a description of a table's columns that are automatically updated when any value in a row is updated.

Inherited from com.mysql.cj.jdbc.DatabaseMetaData:
allProceduresAreCallableallTablesAreSelectableautoCommitFailureClosesAllResultSetsconvertToJdbcFunctionListconvertToJdbcProcedureListcreateColumnsFieldscreateFieldMetadataForGetProcedurescreateFkMetadataFieldscreateFunctionColumnsFieldscreateIndexInfoFieldscreateProcedureColumnsFieldscreateTablesFieldsdataDefinitionCausesTransactionCommitdataDefinitionIgnoredInTransactionsdeletesAreDetecteddoesMaxRowSizeIncludeBlobsextractForeignKeyFromCreateTablegeneratedKeyAlwaysReturnedgetAttributesgetCatalogSeparatorgetCatalogTermgetClientInfoPropertiesgetColumnPrivilegesFieldsgetColumnTypegetConnectiongetDatabasegetDatabaseIteratorgetDatabaseMajorVersiongetDatabaseMinorVersiongetDatabaseProductNamegetDatabaseProductVersiongetDatabasesgetDatabasesgetDefaultTransactionIsolationgetDriverMajorVersiongetDriverMinorVersiongetDriverNamegetDriverVersiongetExceptionInterceptorgetExtraNameCharactersgetForeignKeyActionsgetFunctionsFieldsgetIdentifierQuoteStringgetInstancegetJDBCMajorVersiongetJDBCMinorVersiongetMaxBinaryLiteralLengthgetMaxCatalogNameLengthgetMaxCharLiteralLengthgetMaxColumnNameLengthgetMaxColumnsInGroupBygetMaxColumnsInIndexgetMaxColumnsInOrderBygetMaxColumnsInSelectgetMaxColumnsInTablegetMaxConnectionsgetMaxCursorNameLengthgetMaxIndexLengthgetMaxProcedureNameLengthgetMaxRowSizegetMaxSchemaNameLengthgetMaxStatementLengthgetMaxStatementsgetMaxTableNameLengthgetMaxTablesInSelectgetMaxUserNameLengthgetMetadataCollationIndexgetMetadataEncodinggetNumericFunctionsgetPrimaryKeysFieldsgetProcedureOrFunctionColumnsgetProcedureOrFunctionColumnTypegetProceduresAndOrFunctionsgetProcedureTermgetPseudoColumnsgetResultSetHoldabilitygetRowIdLifetimegetSchemaPatternIteratorgetSchemaTermgetSearchStringEscapegetSQLStateTypegetStringFunctionsgetSuperTablesgetSuperTypesgetSystemFunctionsgetTableTypesgetTimeDateFunctionsgetTypeInfogetUDTsgetURLgetUserNamegetVersionColumnsFieldsinsertsAreDetectedisCatalogAtStartisReadOnlyisWrapperForlocatorsUpdateCopynormalizeCasenullPlusNonNullIsNullnullsAreSortedAtEndnullsAreSortedAtStartnullsAreSortedHighnullsAreSortedLowothersDeletesAreVisibleothersInsertsAreVisibleothersUpdatesAreVisibleownDeletesAreVisibleownInsertsAreVisibleownUpdatesAreVisibleparseTableStatusIntoReferencingAndReferencedColumnspopulateKeyResultsprepareMetaDataSafeStatementprovidesQueryObjectGenerators2bsetMetadataCollationIndexsetMetadataEncodingstoresLowerCaseIdentifiersstoresLowerCaseQuotedIdentifiersstoresMixedCaseIdentifiersstoresMixedCaseQuotedIdentifiersstoresUpperCaseIdentifiersstoresUpperCaseQuotedIdentifierssupportsAlterTableWithAddColumnsupportsAlterTableWithDropColumnsupportsANSI92EntryLevelSQLsupportsANSI92FullSQLsupportsANSI92IntermediateSQLsupportsBatchUpdatessupportsCatalogsInDataManipulationsupportsCatalogsInIndexDefinitionssupportsCatalogsInPrivilegeDefinitionssupportsCatalogsInProcedureCallssupportsCatalogsInTableDefinitionssupportsColumnAliasingsupportsConvertsupportsConvertsupportsCoreSQLGrammarsupportsCorrelatedSubqueriessupportsDataDefinitionAndDataManipulationTransactionssupportsDataManipulationTransactionsOnlysupportsDifferentTableCorrelationNamessupportsExpressionsInOrderBysupportsExtendedSQLGrammarsupportsFullOuterJoinssupportsGetGeneratedKeyssupportsGroupBysupportsGroupByBeyondSelectsupportsGroupByUnrelatedsupportsIntegrityEnhancementFacilitysupportsLikeEscapeClausesupportsLimitedOuterJoinssupportsMinimumSQLGrammarsupportsMixedCaseIdentifierssupportsMixedCaseQuotedIdentifierssupportsMultipleOpenResultssupportsMultipleResultSetssupportsMultipleTransactionssupportsNamedParameterssupportsNonNullableColumnssupportsOpenCursorsAcrossCommitsupportsOpenCursorsAcrossRollbacksupportsOpenStatementsAcrossCommitsupportsOpenStatementsAcrossRollbacksupportsOrderByUnrelatedsupportsOuterJoinssupportsPositionedDeletesupportsPositionedUpdatesupportsResultSetConcurrencysupportsResultSetHoldabilitysupportsResultSetTypesupportsSavepointssupportsSchemasInDataManipulationsupportsSchemasInIndexDefinitionssupportsSchemasInPrivilegeDefinitionssupportsSchemasInProcedureCallssupportsSchemasInTableDefinitionssupportsSelectForUpdatesupportsStatementPoolingsupportsStoredFunctionsUsingCallSyntaxsupportsStoredProceduressupportsSubqueriesInComparisonssupportsSubqueriesInExistssupportsSubqueriesInInssupportsSubqueriesInQuantifiedssupportsTableCorrelationNamessupportsTransactionIsolationLevelsupportsTransactionssupportsUnionsupportsUnionAllunwrapupdatesAreDetectedusesLocalFilePerTableusesLocalFiles