public class DatabaseMetaDataUsingInfoSchema extends DatabaseMetaData
| Modifier and Type | Class and Description |
|---|---|
protected static class |
DatabaseMetaDataUsingInfoSchema.JDBC4FunctionConstant |
DatabaseMetaData.ComparableWrapper<K extends java.lang.Object & java.lang.Comparable<? super K>,V>, DatabaseMetaData.IndexMetaDataKey, DatabaseMetaData.IteratorWithCleanup<T>, DatabaseMetaData.LocalAndReferencedColumns, DatabaseMetaData.ProcedureType, DatabaseMetaData.ResultSetIterator, DatabaseMetaData.SingleStringIterator, DatabaseMetaData.TableMetaDataKey, DatabaseMetaData.TableType, DatabaseMetaData.TypeDescriptorconn, database, MAX_IDENTIFIER_LENGTH, quotedId, SYSTEM_TABLE_AS_BYTES, TABLE_AS_BYTES, VIEW_AS_BYTESattributeNoNulls, 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| Modifier | Constructor and Description |
|---|---|
protected |
DatabaseMetaDataUsingInfoSchema(MySQLConnection connToSet,
java.lang.String databaseToSet) |
| Modifier and Type | Method and Description |
|---|---|
protected java.sql.ResultSet |
executeMetadataQuery(java.sql.PreparedStatement pStmt) |
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 |
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.
|
boolean |
gethasParametersView() |
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.
|
protected int |
getJDBC4FunctionConstant(DatabaseMetaDataUsingInfoSchema.JDBC4FunctionConstant constant)
Getter to JDBC4 DatabaseMetaData.function* constants.
|
protected int |
getJDBC4FunctionNoTableConstant()
Getter to JDBC4 DatabaseMetaData.functionNoTable constant.
|
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.
|
protected java.sql.ResultSet |
getProcedureColumnsNoISParametersView(java.lang.String catalog,
java.lang.String schemaPattern,
java.lang.String procedureNamePattern,
java.lang.String columnNamePattern)
Redirects to another implementation of #getProcedureColumns.
|
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.
|
protected java.lang.String |
getRoutineTypeConditionForGetProcedureColumns()
Returns a condition to be injected in the query that returns metadata for procedure columns only.
|
protected java.lang.String |
getRoutineTypeConditionForGetProcedures()
Returns a condition to be injected in the query that returns metadata for procedures only.
|
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.
|
java.sql.ResultSet |
getVersionColumns(java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
Get a description of a table's columns that are automatically updated
when any value in a row is updated.
|
allProceduresAreCallable, allTablesAreSelectable, buildResultSet, convertToJdbcFunctionList, convertToJdbcProcedureList, createColumnsFields, createFieldMetadataForGetProcedures, createFkMetadataFields, createFunctionColumnsFields, createIndexInfoFields, createProcedureColumnsFields, createTablesFields, dataDefinitionCausesTransactionCommit, dataDefinitionIgnoredInTransactions, deletesAreDetected, doesMaxRowSizeIncludeBlobs, extractForeignKeyForTable, extractForeignKeyFromCreateTable, generatedKeyAlwaysReturned, getAttributes, getBestRowIdentifier, getCatalogIterator, getCatalogs, getCatalogSeparator, getCatalogTerm, getClientInfoProperties, getColumnType, getConnection, getDatabaseMajorVersion, getDatabaseMinorVersion, getDatabaseProductName, getDatabaseProductVersion, getDefaultTransactionIsolation, getDriverMajorVersion, getDriverMinorVersion, getDriverName, getDriverVersion, getExceptionInterceptor, getExportKeyResults, getExtraNameCharacters, getForeignKeyActions, getFullyQualifiedName, getIdentifierQuoteString, getImportKeyResults, getInstance, getJDBCMajorVersion, getJDBCMinorVersion, getMaxBinaryLiteralLength, getMaxCatalogNameLength, getMaxCharLiteralLength, getMaxColumnNameLength, getMaxColumnsInGroupBy, getMaxColumnsInIndex, getMaxColumnsInOrderBy, getMaxColumnsInSelect, getMaxColumnsInTable, getMaxConnections, getMaxCursorNameLength, getMaxIndexLength, getMaxProcedureNameLength, getMaxRowSize, getMaxSchemaNameLength, getMaxStatementLength, getMaxStatements, getMaxTableNameLength, getMaxTablesInSelect, getMaxUserNameLength, getNumericFunctions, getProcedureOrFunctionColumns, getProceduresAndOrFunctions, getProcedureTerm, getPseudoColumns, getResultSetHoldability, getSchemas, getSchemas, getSchemaTerm, getSearchStringEscape, getSQLKeywords, getSQLStateType, getStringFunctions, getSuperTables, getSuperTypes, getSystemFunctions, getTableNameWithCase, getTablePrivileges, getTableTypes, getTimeDateFunctions, getTypeInfo, getUDTs, getURL, getUserName, insertsAreDetected, isCatalogAtStart, isReadOnly, locatorsUpdateCopy, nullPlusNonNullIsNull, nullsAreSortedAtEnd, nullsAreSortedAtStart, nullsAreSortedHigh, nullsAreSortedLow, othersDeletesAreVisible, othersInsertsAreVisible, othersUpdatesAreVisible, ownDeletesAreVisible, ownInsertsAreVisible, ownUpdatesAreVisible, parseTableStatusIntoLocalAndReferencedColumns, prepareMetaDataSafeStatement, providesQueryObjectGenerator, s2b, storesLowerCaseIdentifiers, storesLowerCaseQuotedIdentifiers, storesMixedCaseIdentifiers, storesMixedCaseQuotedIdentifiers, storesUpperCaseIdentifiers, storesUpperCaseQuotedIdentifiers, supportsAlterTableWithAddColumn, supportsAlterTableWithDropColumn, supportsANSI92EntryLevelSQL, supportsANSI92FullSQL, supportsANSI92IntermediateSQL, supportsBatchUpdates, supportsCatalogsInDataManipulation, supportsCatalogsInIndexDefinitions, supportsCatalogsInPrivilegeDefinitions, supportsCatalogsInProcedureCalls, supportsCatalogsInTableDefinitions, supportsColumnAliasing, supportsConvert, supportsConvert, supportsCoreSQLGrammar, supportsCorrelatedSubqueries, supportsDataDefinitionAndDataManipulationTransactions, supportsDataManipulationTransactionsOnly, supportsDifferentTableCorrelationNames, supportsExpressionsInOrderBy, supportsExtendedSQLGrammar, supportsFullOuterJoins, supportsGetGeneratedKeys, supportsGroupBy, supportsGroupByBeyondSelect, supportsGroupByUnrelated, supportsIntegrityEnhancementFacility, supportsLikeEscapeClause, supportsLimitedOuterJoins, supportsMinimumSQLGrammar, supportsMixedCaseIdentifiers, supportsMixedCaseQuotedIdentifiers, supportsMultipleOpenResults, supportsMultipleResultSets, supportsMultipleTransactions, supportsNamedParameters, supportsNonNullableColumns, supportsOpenCursorsAcrossCommit, supportsOpenCursorsAcrossRollback, supportsOpenStatementsAcrossCommit, supportsOpenStatementsAcrossRollback, supportsOrderByUnrelated, supportsOuterJoins, supportsPositionedDelete, supportsPositionedUpdate, supportsResultSetConcurrency, supportsResultSetHoldability, supportsResultSetType, supportsSavepoints, supportsSchemasInDataManipulation, supportsSchemasInIndexDefinitions, supportsSchemasInPrivilegeDefinitions, supportsSchemasInProcedureCalls, supportsSchemasInTableDefinitions, supportsSelectForUpdate, supportsStatementPooling, supportsStoredFunctionsUsingCallSyntax, supportsStoredProcedures, supportsSubqueriesInComparisons, supportsSubqueriesInExists, supportsSubqueriesInIns, supportsSubqueriesInQuantifieds, supportsTableCorrelationNames, supportsTransactionIsolationLevel, supportsTransactions, supportsUnion, supportsUnionAll, updatesAreDetected, usesLocalFilePerTable, usesLocalFilesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprotected DatabaseMetaDataUsingInfoSchema(MySQLConnection connToSet, java.lang.String databaseToSet) throws java.sql.SQLException
java.sql.SQLExceptionprotected java.sql.ResultSet executeMetadataQuery(java.sql.PreparedStatement pStmt)
throws java.sql.SQLException
java.sql.SQLExceptionpublic 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.DatabaseMetaDatagetColumnPrivileges in class DatabaseMetaDatacatalog - a catalog name; "" retrieves those without a catalogschema - a schema name; "" retrieves those without a schematable - a table namecolumnNamePattern - a column name patternjava.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.DatabaseMetaDatagetColumns in class DatabaseMetaDatacatalog - a catalog name; "" retrieves those without a catalogschemaPattern - a schema name pattern; "" retrieves those without a schematableName - a table name patterncolumnNamePattern - a column name patternjava.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.DatabaseMetaDatagetCrossReference in class DatabaseMetaDataprimaryCatalog - 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 namejava.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.DatabaseMetaDatagetExportedKeys in class DatabaseMetaDatacatalog - a catalog name; "" retrieves those without a catalogschema - a schema name pattern; "" retrieves those without a schematable - a table namejava.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.DatabaseMetaDatagetImportedKeys in class DatabaseMetaDatacatalog - a catalog name; "" retrieves those without a catalogschema - a schema name pattern; "" retrieves those without a schematable - a table namejava.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.DatabaseMetaDatagetIndexInfo in class DatabaseMetaDatacatalog - 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 accuratejava.sql.SQLExceptionpublic 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.DatabaseMetaDatagetPrimaryKeys in class DatabaseMetaDatacatalog - a catalog name; "" retrieves those without a catalogschema - a schema name pattern; "" retrieves those without a schematable - a table namejava.sql.SQLExceptionpublic 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.DatabaseMetaDatagetProcedures in class DatabaseMetaDatacatalog - a catalog name; "" retrieves those without a catalogschemaPattern - a schema name pattern; "" retrieves those without a schemaprocedureNamePattern - a procedure name patternjava.sql.SQLException - if a database access error occursDatabaseMetaData.getSearchStringEscape()protected java.lang.String getRoutineTypeConditionForGetProcedures()
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.DatabaseMetaDatagetProcedureColumns in class DatabaseMetaDatacatalog - 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 databaseResultSet - each row describes a stored procedure parameter or
columnjava.sql.SQLException - if a database access error occursDatabaseMetaData.getSearchStringEscape()protected java.sql.ResultSet getProcedureColumnsNoISParametersView(java.lang.String catalog,
java.lang.String schemaPattern,
java.lang.String procedureNamePattern,
java.lang.String columnNamePattern)
throws java.sql.SQLException
java.sql.SQLExceptiongetProcedureColumnsprotected java.lang.String getRoutineTypeConditionForGetProcedureColumns()
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.DatabaseMetaDatagetTables in class DatabaseMetaDatacatalog - 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 typesjava.sql.SQLExceptionDatabaseMetaData.getSearchStringEscape()public boolean gethasParametersView()
public java.sql.ResultSet getVersionColumns(java.lang.String catalog,
java.lang.String schema,
java.lang.String table)
throws java.sql.SQLException
DatabaseMetaDataEach column description has the following columns:
getVersionColumns in interface java.sql.DatabaseMetaDatagetVersionColumns in class DatabaseMetaDatacatalog - a catalog name; "" retrieves those without a catalogschema - a schema name; "" retrieves those without a schematable - a table namejava.sql.SQLExceptionpublic 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.DatabaseMetaDatagetFunctionColumns in class DatabaseMetaDatacatalog - 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 databaseResultSet - each row describes a
user function parameter, column or return typejava.sql.SQLException - if a database access error occursDatabaseMetaData.getSearchStringEscape()protected int getJDBC4FunctionConstant(DatabaseMetaDataUsingInfoSchema.JDBC4FunctionConstant constant)
constant - the constant id from DatabaseMetaData fields to return.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
getFunctions in interface java.sql.DatabaseMetaDatagetFunctions in class DatabaseMetaDatacatalog - 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 databaseResultSet - each row is a function descriptionjava.sql.SQLException - if a database access error occursDatabaseMetaData.getSearchStringEscape()protected int getJDBC4FunctionNoTableConstant()
getJDBC4FunctionNoTableConstant in class DatabaseMetaData