Class DatabaseMetaDataWrapper40
- java.lang.Object
-
- com.sun.gjc.spi.base.DatabaseMetaDataWrapper
-
- com.sun.gjc.spi.jdbc40.DatabaseMetaDataWrapper40
-
- All Implemented Interfaces:
DatabaseMetaData
,Wrapper
public class DatabaseMetaDataWrapper40 extends DatabaseMetaDataWrapper
Wrapper class for DatabaseMetaData for JDBC 4.0
-
-
Field Summary
-
Fields inherited from class com.sun.gjc.spi.base.DatabaseMetaDataWrapper
_logger, connection, databaseMetaData
-
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
Constructors Constructor Description DatabaseMetaDataWrapper40(Connection con, DatabaseMetaData metaData)
Creates a new instance of DatabaseMetaDataWrapper40 for JDBC 4.0
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
autoCommitFailureClosesAllResultSets()
Retrieves whether aSQLException
while autoCommit istrue
indicates that all open ResultSets are closed, even ones that are holdable.boolean
generatedKeyAlwaysReturned()
ResultSet
getClientInfoProperties()
Retrieves a list of the client info properties that the driver supports.ResultSet
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.ResultSet
getFunctions(String catalog, String schemaPattern, String functionNamePattern)
Retrieves a description of the system and user functions available in the given catalog.long
getMaxLogicalLobSize()
Retrieves the maximum number of bytes this database allows for the logical size for aLOB
.ResultSet
getPseudoColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)
RowIdLifetime
getRowIdLifetime()
Indicates whether or not this data source supports the SQLROWID
type, and if so the lifetime for which aRowId
object remains valid.ResultSet
getSchemas(String catalog, String schemaPattern)
Retrieves the schema names available in this database.boolean
isWrapperFor(Class<?> iface)
Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does.boolean
supportsRefCursors()
Retrieves whether this database supports REF CURSOR.boolean
supportsStoredFunctionsUsingCallSyntax()
Retrieves whether this database supports invoking user-defined or vendor functions using the stored procedure escape syntax.<T> T
unwrap(Class<T> iface)
Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy.-
Methods inherited from class com.sun.gjc.spi.base.DatabaseMetaDataWrapper
allProceduresAreCallable, allTablesAreSelectable, dataDefinitionCausesTransactionCommit, dataDefinitionIgnoredInTransactions, deletesAreDetected, doesMaxRowSizeIncludeBlobs, getActualConnection, getAttributes, getBestRowIdentifier, getCatalogs, getCatalogSeparator, getCatalogTerm, getColumnPrivileges, getColumns, getConnection, getCrossReference, getDatabaseMajorVersion, getDatabaseMinorVersion, getDatabaseProductName, getDatabaseProductVersion, getDefaultTransactionIsolation, getDriverMajorVersion, getDriverMinorVersion, getDriverName, getDriverVersion, getExportedKeys, getExtraNameCharacters, getIdentifierQuoteString, getImportedKeys, getIndexInfo, getJDBCMajorVersion, getJDBCMinorVersion, getMaxBinaryLiteralLength, getMaxCatalogNameLength, getMaxCharLiteralLength, getMaxColumnNameLength, getMaxColumnsInGroupBy, getMaxColumnsInIndex, getMaxColumnsInOrderBy, getMaxColumnsInSelect, getMaxColumnsInTable, getMaxConnections, getMaxCursorNameLength, getMaxIndexLength, getMaxProcedureNameLength, getMaxRowSize, getMaxSchemaNameLength, getMaxStatementLength, getMaxStatements, getMaxTableNameLength, getMaxTablesInSelect, getMaxUserNameLength, getMethodExecutor, getNumericFunctions, getPrimaryKeys, getProcedureColumns, getProcedures, getProcedureTerm, getResultSetHoldability, getSchemas, getSchemaTerm, getSearchStringEscape, getSQLKeywords, getSQLStateType, getStringFunctions, getSuperTables, getSuperTypes, getSystemFunctions, getTablePrivileges, getTables, getTableTypes, getTimeDateFunctions, getTypeInfo, getUDTs, getURL, getUserName, getVersionColumns, insertsAreDetected, isCatalogAtStart, isReadOnly, locatorsUpdateCopy, nullPlusNonNullIsNull, nullsAreSortedAtEnd, nullsAreSortedAtStart, nullsAreSortedHigh, nullsAreSortedLow, othersDeletesAreVisible, othersInsertsAreVisible, othersUpdatesAreVisible, ownDeletesAreVisible, ownInsertsAreVisible, ownUpdatesAreVisible, 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, supportsStoredProcedures, supportsSubqueriesInComparisons, supportsSubqueriesInExists, supportsSubqueriesInIns, supportsSubqueriesInQuantifieds, supportsTableCorrelationNames, supportsTransactionIsolationLevel, supportsTransactions, supportsUnion, supportsUnionAll, updatesAreDetected, usesLocalFilePerTable, usesLocalFiles
-
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
supportsSharding
-
-
-
-
Constructor Detail
-
DatabaseMetaDataWrapper40
public DatabaseMetaDataWrapper40(Connection con, DatabaseMetaData metaData)
Creates a new instance of DatabaseMetaDataWrapper40 for JDBC 4.0- Parameters:
con
- Connection that is wrappedmetaData
- DatabaseMetaData that is wrapped
-
-
Method Detail
-
getRowIdLifetime
public RowIdLifetime getRowIdLifetime() throws SQLException
Indicates whether or not this data source supports the SQLROWID
type, and if so the lifetime for which aRowId
object remains valid.The returned int values have the following relationship:
ROWID_UNSUPPORTED <<y; ROWID_VALID_OTHER < ROWID_VALID_TRANSACTION < ROWID_VALID_SESSION < ROWID_VALID_FOREVER
so conditional logic such asif (metadata.getRowIdLifetime() > DatabaseMetaData.ROWID_VALID_TRANSACTION)
can be used. Valid Forever means valid across all Sessions, and valid for a Session means valid across all its contained Transactions.- Returns:
- the status indicating the lifetime of a
RowId
- Throws:
SQLException
- if a database access error occurs- Since:
- 1.6
-
getSchemas
public ResultSet getSchemas(String catalog, String schemaPattern) throws SQLException
Retrieves the schema names available in this database. The results are ordered byTABLE_CATALOG
andTABLE_SCHEM
.The schema columns are:
- TABLE_SCHEM String => schema name
- TABLE_CATALOG String => catalog name (may be
null
)
- Parameters:
catalog
- a catalog name; must match the catalog name as it is stored in the database;"" retrieves those without a catalog; null means catalog name should not be used to narrow down the search.schemaPattern
- a schema name; must match the schema name as it is stored in the database; null means schema name should not be used to narrow down the search.- Returns:
- a
ResultSet
object in which each row is a schema description - Throws:
SQLException
- if a database access error occurs- Since:
- 1.6
- See Also:
DatabaseMetaDataWrapper.getSearchStringEscape()
-
supportsStoredFunctionsUsingCallSyntax
public boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException
Retrieves whether this database supports invoking user-defined or vendor functions using the stored procedure escape syntax.- Returns:
true
if so;false
otherwise- Throws:
SQLException
- if a database access error occurs- Since:
- 1.6
-
autoCommitFailureClosesAllResultSets
public boolean autoCommitFailureClosesAllResultSets() throws SQLException
Retrieves whether aSQLException
while autoCommit istrue
indicates that all open ResultSets are closed, even ones that are holdable. When aSQLException
occurs while autocommit istrue
, it is vendor specific whether the JDBC driver responds with a commit operation, a rollback operation, or by doing neither a commit nor a rollback. A potential result of this difference is in whether or not holdable ResultSets are closed.- Returns:
true
if so;false
otherwise- Throws:
SQLException
- if a database access error occurs- Since:
- 1.6
-
getClientInfoProperties
public ResultSet getClientInfoProperties() throws SQLException
Retrieves a list of the client info properties that the driver supports. The result set contains the following columns- NAME String=> The name of the client info property
- MAX_LEN int=> The maximum length of the value for the property
- DEFAULT_VALUE String=> The default value of the property
- DESCRIPTION String=> A description of the property. This will typically contain information as to where this property is stored in the database.
ResultSet
is sorted by the NAME column- Returns:
- A
ResultSet
object; each row is a supported client info property - Throws:
SQLException
- if a database access error occurs- Since:
- 1.6
- NAME String=> The name of the client info property
-
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_NAME
andSPECIFIC_ 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_NAME
for example with overload functions
getFunctions
- Parameters:
catalog
- a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog;null
means that the catalog name should not be used to narrow the searchschemaPattern
- a schema name pattern; must match the schema name as it is stored in the database; "" retrieves those without a schema;null
means that the schema name should not be used to narrow the searchfunctionNamePattern
- a function name pattern; must match the function name as it is stored in the database- Returns:
ResultSet
- each row is a function description- Throws:
SQLException
- if a database access error occurs- Since:
- 1.6
- See Also:
DatabaseMetaDataWrapper.getSearchStringEscape()
- FUNCTION_CAT String => function catalog (may be
-
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_NAME
andSPECIFIC_ 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:- 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_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.
- Parameters:
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- 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:
DatabaseMetaDataWrapper.getSearchStringEscape()
- FUNCTION_CAT String => function catalog (may be
-
unwrap
public <T> T unwrap(Class<T> iface) throws SQLException
Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy.If the receiver implements the interface then the result is the receiver or a proxy for the receiver. If the receiver is a wrapper and the wrapped object implements the interface then the result is the wrapped object or a proxy for the wrapped object. Otherwise return the the result of calling
unwrap
recursively on the wrapped object or a proxy for that result. If the receiver is not a wrapper and does not implement the interface, then anSQLException
is thrown.- Parameters:
iface
- A Class defining an interface that the result must implement.- Returns:
- an object that implements the interface. May be a proxy for the actual implementing object.
- Throws:
SQLException
- If no object found that implements the interface- Since:
- 1.6
-
isWrapperFor
public boolean isWrapperFor(Class<?> iface) throws SQLException
Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does. Returns false otherwise. If this implements the interface then return true, else if this is a wrapper then return the result of recursively callingisWrapperFor
on the wrapped object. If this does not implement the interface and is not a wrapper, return false. This method should be implemented as a low-cost operation compared tounwrap
so that callers can use this method to avoid expensiveunwrap
calls that may fail. If this method returns true then callingunwrap
with the same argument should succeed.- Parameters:
iface
- a Class defining an interface.- Returns:
- true if this implements the interface or directly or indirectly wraps an object that does.
- Throws:
SQLException
- if an error occurs while determining whether this is a wrapper for an object with the given interface.- Since:
- 1.6
-
getPseudoColumns
public ResultSet getPseudoColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException
- Throws:
SQLException
-
generatedKeyAlwaysReturned
public boolean generatedKeyAlwaysReturned() throws SQLException
- Throws:
SQLException
-
getMaxLogicalLobSize
public long getMaxLogicalLobSize() throws SQLException
Retrieves the maximum number of bytes this database allows for the logical size for aLOB
.- Returns:
- the maximum number of bytes allowed; a result of zero means that there is no limit or the limit is not known
- Throws:
SQLException
- if a database access error occurs
-
supportsRefCursors
public boolean supportsRefCursors() throws SQLException
Retrieves whether this database supports REF CURSOR.- Returns:
true
if this database supports REF CURSOR;false
otherwise- Throws:
SQLException
- if a database access error occurs
-
-