Class DatabaseMetaDataUsingInfoSchema
- All Implemented Interfaces:
DatabaseMetaData, Wrapper
- Direct Known Subclasses:
JDBC4DatabaseMetaDataUsingInfoSchema
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enumNested classes/interfaces inherited from class DatabaseMetaData
DatabaseMetaData.ComparableWrapper<K,V>, DatabaseMetaData.IndexMetaDataKey, DatabaseMetaData.IteratorWithCleanup<T>, DatabaseMetaData.LocalAndReferencedColumns, DatabaseMetaData.ProcedureType, DatabaseMetaData.ResultSetIterator, DatabaseMetaData.SingleStringIterator, DatabaseMetaData.TableMetaDataKey, DatabaseMetaData.TableType, DatabaseMetaData.TypeDescriptor -
Field Summary
Fields inherited from class DatabaseMetaData
conn, database, MAX_IDENTIFIER_LENGTH, quotedId, SYSTEM_TABLE_AS_BYTES, TABLE_AS_BYTES, VIEW_AS_BYTESFields inherited from interface 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
ConstructorsModifierConstructorDescriptionprotectedDatabaseMetaDataUsingInfoSchema(MySQLConnection connToSet, String databaseToSet) -
Method Summary
Modifier and TypeMethodDescriptionprotected ResultSetgetColumnPrivileges(String catalog, String schema, String table, String columnNamePattern) Get a description of the access rights for a table's columns.getColumns(String catalog, String schemaPattern, String tableName, String columnNamePattern) Get a description of table columns available in a catalog.getCrossReference(String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, 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.)getExportedKeys(String catalog, String schema, 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).getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern) Retrieves a description of the given catalog's system or user function parameters and return type.getFunctions(String catalog, String schemaPattern, String functionNamePattern) Retrieves a description of the system and user functions available in the given catalog.booleangetImportedKeys(String catalog, String schema, 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).getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate) Get a description of a table's indices and statistics.protected intGetter to JDBC4 DatabaseMetaData.function* constants.protected intGetter to JDBC4 DatabaseMetaData.functionNoTable constant.getPrimaryKeys(String catalog, String schema, String table) Get a description of a table's primary key columns.getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) Retrieves a description of the given catalog's stored procedure parameter and result columns.protected ResultSetgetProcedureColumnsNoISParametersView(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) Redirects to another implementation of #getProcedureColumns.getProcedures(String catalog, String schemaPattern, String procedureNamePattern) Get a description of stored procedures available in a catalog.protected StringReturns a condition to be injected in the query that returns metadata for procedure columns only.protected StringReturns a condition to be injected in the query that returns metadata for procedures only.Get a description of tables available in a catalog.getVersionColumns(String catalog, String schema, String table) Get a description of a table's columns that are automatically updated when any value in a row is updated.Methods inherited from class DatabaseMetaData
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, usesLocalFilesMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DatabaseMetaData
autoCommitFailureClosesAllResultSets, getMaxLogicalLobSize, getRowIdLifetime, supportsRefCursors, supportsShardingMethods inherited from interface Wrapper
isWrapperFor, unwrap
-
Constructor Details
-
DatabaseMetaDataUsingInfoSchema
protected DatabaseMetaDataUsingInfoSchema(MySQLConnection connToSet, String databaseToSet) throws SQLException - Throws:
SQLException
-
-
Method Details
-
executeMetadataQuery
- Throws:
SQLException
-
getColumnPrivileges
public ResultSet getColumnPrivileges(String catalog, String schema, String table, String columnNamePattern) throws SQLException Get a description of the access rights for a table's columns.Only privileges matching the column name criteria are returned. They are ordered by COLUMN_NAME and PRIVILEGE.
Each privilige description has the following columns:
- TABLE_CAT String => table catalog (may be null)
- TABLE_SCHEM String => table schema (may be null)
- TABLE_NAME String => table name
- COLUMN_NAME String => column name
- GRANTOR => grantor of access (may be null)
- GRANTEE String => grantee of access
- PRIVILEGE String => name of access (SELECT, INSERT, UPDATE, REFRENCES, ...)
- IS_GRANTABLE String => "YES" if grantee is permitted to grant to others; "NO" if not; null if unknown
- Specified by:
getColumnPrivilegesin interfaceDatabaseMetaData- Overrides:
getColumnPrivilegesin classDatabaseMetaData- Parameters:
catalog- a catalog name; "" retrieves those without a catalogschema- a schema name; "" retrieves those without a schematable- a table namecolumnNamePattern- a column name pattern- Returns:
- ResultSet each row is a column privilege description
- Throws:
SQLException- if a database access error occurs- See Also:
-
getColumns
public ResultSet getColumns(String catalog, String schemaPattern, String tableName, String columnNamePattern) throws SQLException Get a description of table columns available in a catalog.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:
- TABLE_CAT String => table catalog (may be null)
- TABLE_SCHEM String => table schema (may be null)
- TABLE_NAME String => table name
- COLUMN_NAME String => column name
- DATA_TYPE short => SQL type from java.sql.Types
- TYPE_NAME String => Data source dependent type name
- COLUMN_SIZE int => column size. For char or date types this is the maximum number of characters, for numeric or decimal types this is precision.
- BUFFER_LENGTH is not used.
- DECIMAL_DIGITS int => the number of fractional digits
- NUM_PREC_RADIX int => Radix (typically either 10 or 2)
- NULLABLE int => is NULL allowed?
- columnNoNulls - might not allow NULL values
- columnNullable - definitely allows NULL values
- columnNullableUnknown - nullability unknown
- REMARKS String => comment describing column (may be null)
- COLUMN_DEF String => default value (may be null)
- SQL_DATA_TYPE int => unused
- SQL_DATETIME_SUB int => unused
- CHAR_OCTET_LENGTH int => for char types the maximum number of bytes in the column
- ORDINAL_POSITION int => index of column in table (starting at 1)
- IS_NULLABLE String => "NO" means column definitely does not allow NULL values; "YES" means the column might allow NULL values. An empty string means nobody knows.
- Specified by:
getColumnsin interfaceDatabaseMetaData- Overrides:
getColumnsin classDatabaseMetaData- Parameters:
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- Returns:
- ResultSet each row is a column description
- Throws:
SQLException- if a database access error occurs- See Also:
-
getCrossReference
public ResultSet getCrossReference(String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable) throws SQLException 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.) This should normally return a single foreign key/primary key pair (most tables only import a foreign key from a table once.) They are ordered by FKTABLE_CAT, FKTABLE_SCHEM, FKTABLE_NAME, and KEY_SEQ.Each foreign key column description has the following columns:
- PKTABLE_CAT String => primary key table catalog (may be null)
- PKTABLE_SCHEM String => primary key table schema (may be null)
- PKTABLE_NAME String => primary key table name
- PKCOLUMN_NAME String => primary key column name
- FKTABLE_CAT String => foreign key table catalog (may be null) being exported (may be null)
- FKTABLE_SCHEM String => foreign key table schema (may be null) being exported (may be null)
- FKTABLE_NAME String => foreign key table name being exported
- FKCOLUMN_NAME String => foreign key column name being exported
- KEY_SEQ short => sequence number within foreign key
- UPDATE_RULE short => What happens to foreign key when primary is updated:
- importedKeyCascade - change imported key to agree with primary key update
- importedKeyRestrict - do not allow update of primary key if it has been imported
- importedKeySetNull - change imported key to NULL if its primary key has been updated
- DELETE_RULE short => What happens to the foreign key when primary is deleted.
- importedKeyCascade - delete rows that import a deleted key
- importedKeyRestrict - do not allow delete of primary key if it has been imported
- importedKeySetNull - change imported key to NULL if its primary key has been deleted
- FK_NAME String => foreign key identifier (may be null)
- PK_NAME String => primary key identifier (may be null)
- Specified by:
getCrossReferencein interfaceDatabaseMetaData- Overrides:
getCrossReferencein classDatabaseMetaData- Parameters:
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- Returns:
- ResultSet each row is a foreign key column description
- Throws:
SQLException- if a database access error occurs
-
getExportedKeys
Get a description of a foreign key columns that reference a 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.Each foreign key column description has the following columns:
- PKTABLE_CAT String => primary key table catalog (may be null)
- PKTABLE_SCHEM String => primary key table schema (may be null)
- PKTABLE_NAME String => primary key table name
- PKCOLUMN_NAME String => primary key column name
- FKTABLE_CAT String => foreign key table catalog (may be null) being exported (may be null)
- FKTABLE_SCHEM String => foreign key table schema (may be null) being exported (may be null)
- FKTABLE_NAME String => foreign key table name being exported
- FKCOLUMN_NAME String => foreign key column name being exported
- KEY_SEQ short => sequence number within foreign key
- UPDATE_RULE short => What happens to foreign key when primary is updated:
- importedKeyCascade - change imported key to agree with primary key update
- importedKeyRestrict - do not allow update of primary key if it has been imported
- importedKeySetNull - change imported key to NULL if its primary key has been updated
- DELETE_RULE short => What happens to the foreign key when primary is deleted.
- importedKeyCascade - delete rows that import a deleted key
- importedKeyRestrict - do not allow delete of primary key if it has been imported
- importedKeySetNull - change imported key to NULL if its primary key has been deleted
- FK_NAME String => foreign key identifier (may be null)
- PK_NAME String => primary key identifier (may be null)
- Specified by:
getExportedKeysin interfaceDatabaseMetaData- Overrides:
getExportedKeysin classDatabaseMetaData- Parameters:
catalog- a catalog name; "" retrieves those without a catalogschema- a schema name pattern; "" retrieves those without a schematable- a table name- Returns:
- ResultSet each row is a foreign key column description
- Throws:
SQLException- if a database access error occurs- See Also:
-
getImportedKeys
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). They are ordered by PKTABLE_CAT, PKTABLE_SCHEM, PKTABLE_NAME, and KEY_SEQ.Each primary key column description has the following columns:
- PKTABLE_CAT String => primary key table catalog being imported (may be null)
- PKTABLE_SCHEM String => primary key table schema being imported (may be null)
- PKTABLE_NAME String => primary key table name being imported
- PKCOLUMN_NAME String => primary key column name being imported
- FKTABLE_CAT String => foreign key table catalog (may be null)
- FKTABLE_SCHEM String => foreign key table schema (may be null)
- FKTABLE_NAME String => foreign key table name
- FKCOLUMN_NAME String => foreign key column name
- KEY_SEQ short => sequence number within foreign key
- UPDATE_RULE short => What happens to foreign key when primary is updated:
- importedKeyCascade - change imported key to agree with primary key update
- importedKeyRestrict - do not allow update of primary key if it has been imported
- importedKeySetNull - change imported key to NULL if its primary key has been updated
- DELETE_RULE short => What happens to the foreign key when primary is deleted.
- importedKeyCascade - delete rows that import a deleted key
- importedKeyRestrict - do not allow delete of primary key if it has been imported
- importedKeySetNull - change imported key to NULL if its primary key has been deleted
- FK_NAME String => foreign key name (may be null)
- PK_NAME String => primary key name (may be null)
- Specified by:
getImportedKeysin interfaceDatabaseMetaData- Overrides:
getImportedKeysin classDatabaseMetaData- Parameters:
catalog- a catalog name; "" retrieves those without a catalogschema- a schema name pattern; "" retrieves those without a schematable- a table name- Returns:
- ResultSet each row is a primary key column description
- Throws:
SQLException- if a database access error occurs- See Also:
-
getIndexInfo
public ResultSet getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate) throws SQLException Get a description of a table's indices and statistics. They are ordered by NON_UNIQUE, TYPE, INDEX_NAME, and ORDINAL_POSITION.Each index column description has the following columns:
- TABLE_CAT String => table catalog (may be null)
- TABLE_SCHEM String => table schema (may be null)
- TABLE_NAME String => table name
- NON_UNIQUE boolean => Can index values be non-unique? false when TYPE is tableIndexStatistic
- INDEX_QUALIFIER String => index catalog (may be null); null when TYPE is tableIndexStatistic
- INDEX_NAME String => index name; null when TYPE is tableIndexStatistic
- TYPE short => index type:
- tableIndexStatistic - this identifies table statistics that are returned in conjuction with a table's index descriptions
- tableIndexClustered - this is a clustered index
- tableIndexHashed - this is a hashed index
- tableIndexOther - this is some other style of index
- ORDINAL_POSITION short => column sequence number within index; zero when TYPE is tableIndexStatistic
- COLUMN_NAME String => column name; null when TYPE is tableIndexStatistic
- ASC_OR_DESC String => column sort sequence, "A" => ascending, "D" => descending, may be null if sort sequence is not supported; null when TYPE is tableIndexStatistic
- CARDINALITY int => When TYPE is tableIndexStatisic then this is the number of rows in the table; otherwise it is the number of unique values in the index.
- PAGES int => When TYPE is tableIndexStatisic then this is the number of pages used for the table, otherwise it is the number of pages used for the current index.
- FILTER_CONDITION String => Filter condition, if any. (may be null)
- Specified by:
getIndexInfoin interfaceDatabaseMetaData- Overrides:
getIndexInfoin classDatabaseMetaData- Parameters:
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- Returns:
- ResultSet each row is an index column description
- Throws:
SQLException
-
getPrimaryKeys
Get a description of a table's primary key columns. They are ordered by COLUMN_NAME.Each column description has the following columns:
- TABLE_CAT String => table catalog (may be null)
- TABLE_SCHEM String => table schema (may be null)
- TABLE_NAME String => table name
- COLUMN_NAME String => column name
- KEY_SEQ short => sequence number within primary key
- PK_NAME String => primary key name (may be null)
- Specified by:
getPrimaryKeysin interfaceDatabaseMetaData- Overrides:
getPrimaryKeysin classDatabaseMetaData- Parameters:
catalog- a catalog name; "" retrieves those without a catalogschema- a schema name pattern; "" retrieves those without a schematable- a table name- Returns:
- ResultSet each row is a primary key column description
- Throws:
SQLException
-
getProcedures
public ResultSet getProcedures(String catalog, String schemaPattern, String procedureNamePattern) throws SQLException Get a description of stored procedures available in a catalog.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:
- PROCEDURE_CAT String => procedure catalog (may be null)
- PROCEDURE_SCHEM String => procedure schema (may be null)
- PROCEDURE_NAME String => procedure name
- reserved for future use
- reserved for future use
- reserved for future use
- REMARKS String => explanatory comment on the procedure
- PROCEDURE_TYPE short => kind of procedure:
- procedureResultUnknown - May return a result
- procedureNoResult - Does not return a result
- procedureReturnsResult - Returns a result
- Specified by:
getProceduresin interfaceDatabaseMetaData- Overrides:
getProceduresin classDatabaseMetaData- Parameters:
catalog- a catalog name; "" retrieves those without a catalogschemaPattern- a schema name pattern; "" retrieves those without a schemaprocedureNamePattern- a procedure name pattern- Returns:
- ResultSet each row is a procedure description
- Throws:
SQLException- if a database access error occurs- See Also:
-
getRoutineTypeConditionForGetProcedures
Returns a condition to be injected in the query that returns metadata for procedures only. Overridden by subclasses when needed. When not empty must end with "AND ".- Returns:
- String with the condition to be injected.
-
getProcedureColumns
public ResultSet getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) throws SQLException Retrieves a description of the given catalog's stored procedure parameter and result columns.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
ResultSetis a parameter description or column description with the following fields:- PROCEDURE_CAT String => procedure catalog (may be
null) - PROCEDURE_SCHEM String => procedure schema (may be
null) - PROCEDURE_NAME String => procedure name
- COLUMN_NAME String => column/parameter name
- COLUMN_TYPE Short => kind of column/parameter:
- procedureColumnUnknown - nobody knows
- procedureColumnIn - IN parameter
- procedureColumnInOut - INOUT parameter
- procedureColumnOut - OUT parameter
- procedureColumnReturn - procedure return value
- procedureColumnResult - result column in
ResultSet
- DATA_TYPE int => SQL type from java.sql.Types
- TYPE_NAME String => SQL type name, for a UDT type the type name is fully qualified
- PRECISION int => precision
- LENGTH int => length in bytes of data
- SCALE short => scale
- RADIX short => radix
- NULLABLE short => can it contain NULL.
- procedureNoNulls - does not allow NULL values
- procedureNullable - allows NULL values
- procedureNullableUnknown - nullability unknown
- REMARKS String => comment describing parameter/column
Note: Some databases may not return the column descriptions for a procedure. Additional columns beyond REMARKS can be defined by the database.
- Specified by:
getProcedureColumnsin interfaceDatabaseMetaData- Overrides:
getProcedureColumnsin classDatabaseMetaData- Parameters:
catalog- a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog;nullmeans 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;nullmeans 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- Returns:
ResultSet- each row describes a stored procedure parameter or column- Throws:
SQLException- if a database access error occurs- See Also:
- PROCEDURE_CAT String => procedure catalog (may be
-
getProcedureColumnsNoISParametersView
protected ResultSet getProcedureColumnsNoISParametersView(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) throws SQLException Redirects to another implementation of #getProcedureColumns. Subclasses may need to override this method.- Throws:
SQLException- See Also:
-
getRoutineTypeConditionForGetProcedureColumns
Returns a condition to be injected in the query that returns metadata for procedure columns only. Overridden by subclasses when needed. When not empty must end with "AND ".- Returns:
- String with the condition to be injected.
-
getTables
public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) throws SQLException Get a description of tables available in a catalog.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:
- TABLE_CAT String => table catalog (may be null)
- TABLE_SCHEM String => table schema (may be null)
- TABLE_NAME String => table name
- TABLE_TYPE String => table type. Typical types are "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", "LOCAL TEMPORARY", "ALIAS", "SYNONYM".
- REMARKS String => explanatory comment on the table
Note: Some databases may not return information for all tables.
- Specified by:
getTablesin interfaceDatabaseMetaData- Overrides:
getTablesin classDatabaseMetaData- Parameters:
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- Returns:
- ResultSet each row is a table description
- Throws:
SQLException- See Also:
-
gethasParametersView
public boolean gethasParametersView() -
getVersionColumns
Description copied from class:DatabaseMetaDataGet a description of a table's columns that are automatically updated when any value in a row is updated. They are unordered.Each column description has the following columns:
- SCOPE short => is not used
- COLUMN_NAME String => column name
- DATA_TYPE short => SQL data type from java.sql.Types
- TYPE_NAME String => Data source dependent type name
- COLUMN_SIZE int => precision
- BUFFER_LENGTH int => length of column value in bytes
- DECIMAL_DIGITS short => scale
- PSEUDO_COLUMN short => is this a pseudo column like an Oracle ROWID
- versionColumnUnknown - may or may not be pseudo column
- versionColumnNotPseudo - is NOT a pseudo column
- versionColumnPseudo - is a pseudo column
- Specified by:
getVersionColumnsin interfaceDatabaseMetaData- Overrides:
getVersionColumnsin classDatabaseMetaData- Parameters:
catalog- a catalog name; "" retrieves those without a catalogschema- a schema name; "" retrieves those without a schematable- a table name- Returns:
- ResultSet each row is a column description
- Throws:
SQLException
-
getFunctionColumns
public ResultSet getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern) throws SQLException Retrieves a description of the given catalog's system or user function parameters and return type.Only descriptions matching the schema, function and parameter name criteria are returned. They are ordered by
FUNCTION_CAT,FUNCTION_SCHEM,FUNCTION_NAMEandSPECIFIC_ 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
ResultSetis a parameter description, column description or return type description with the following fields:- FUNCTION_CAT String => function catalog (may be
null) - FUNCTION_SCHEM String => function schema (may be
null) - FUNCTION_NAME String => function name. This is the name used to invoke the function
- COLUMN_NAME String => column/parameter name
- COLUMN_TYPE Short => kind of column/parameter:
- functionColumnUnknown - nobody knows
- functionColumnIn - IN parameter
- functionColumnInOut - INOUT parameter
- functionColumnOut - OUT parameter
- functionColumnReturn - function return value
- functionColumnResult - Indicates that the parameter or column is a column in the
ResultSet
- DATA_TYPE int => SQL type from java.sql.Types
- TYPE_NAME String => SQL type name, for a UDT type the type name is fully qualified
- PRECISION int => precision
- LENGTH int => length in bytes of data
- SCALE short => scale - null is returned for data types where SCALE is not applicable.
- RADIX short => radix
- NULLABLE short => can it contain NULL.
- functionNoNulls - does not allow NULL values
- functionNullable - allows NULL values
- functionNullableUnknown - nullability unknown
- REMARKS String => comment describing column/parameter
- CHAR_OCTET_LENGTH int => the maximum length of binary and character based parameters or columns. For any other datatype the returned value is a NULL
- ORDINAL_POSITION int => the ordinal position, starting from 1, for the input and output parameters. A value of 0 is returned if this row describes the function's return value. For result set columns, it is the ordinal position of the column in the result set starting from 1.
- IS_NULLABLE String => ISO rules are used to determine the nullability for a parameter or column.
- YES --- if the parameter or column can include NULLs
- NO --- if the parameter or column cannot include NULLs
- empty string --- if the nullability for the parameter or column is unknown
- SPECIFIC_NAME String => the name which uniquely identifies this function within its schema. This is a user specified, or DBMS generated, name
that may be different then the
FUNCTION_NAMEfor 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.
- Specified by:
getFunctionColumnsin interfaceDatabaseMetaData- Overrides:
getFunctionColumnsin classDatabaseMetaData- Parameters:
catalog- a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog;nullmeans 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;nullmeans 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- Returns:
ResultSet- each row describes a user function parameter, column or return type- Throws:
SQLException- if a database access error occurs- Since:
- 1.6
- See Also:
- FUNCTION_CAT String => function catalog (may be
-
getJDBC4FunctionConstant
protected int getJDBC4FunctionConstant(DatabaseMetaDataUsingInfoSchema.JDBC4FunctionConstant constant) Getter to JDBC4 DatabaseMetaData.function* constants. This method must be overridden by JDBC4 subclasses. this implementation should never be called.- Parameters:
constant- the constant id from DatabaseMetaData fields to return.- Returns:
- 0
-
getFunctions
public ResultSet getFunctions(String catalog, String schemaPattern, String functionNamePattern) throws SQLException Retrieves a description of the system and user functions available in the given catalog.Only system and user function descriptions matching the schema and function name criteria are returned. They are ordered by
FUNCTION_CAT,FUNCTION_SCHEM,FUNCTION_NAMEandSPECIFIC_ NAME.Each function description has the the following columns:
- FUNCTION_CAT String => function catalog (may be
null) - FUNCTION_SCHEM String => function schema (may be
null) - FUNCTION_NAME String => function name. This is the name used to invoke the function
- REMARKS String => explanatory comment on the function
- FUNCTION_TYPE short => kind of function:
- functionResultUnknown - Cannot determine if a return value or table will be returned
- functionNoTable- Does not return a table
- functionReturnsTable - Returns a table
- SPECIFIC_NAME String => the name which uniquely identifies this function within its schema. This is a user specified, or DBMS generated, name
that may be different then the
FUNCTION_NAMEfor example with overload functions
A user may not have permission to execute any of the functions that are returned by
getFunctions- Specified by:
getFunctionsin interfaceDatabaseMetaData- Overrides:
getFunctionsin classDatabaseMetaData- Parameters:
catalog- a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog;nullmeans 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;nullmeans 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- Returns:
ResultSet- each row is a function description- Throws:
SQLException- if a database access error occurs- Since:
- 1.6
- See Also:
- FUNCTION_CAT String => function catalog (may be
-
getJDBC4FunctionNoTableConstant
protected int getJDBC4FunctionNoTableConstant()Getter to JDBC4 DatabaseMetaData.functionNoTable constant. This method must be overridden by JDBC4 subclasses. this implementation should never be called.- Overrides:
getJDBC4FunctionNoTableConstantin classDatabaseMetaData- Returns:
- 0
-