org.postgresql.jdbc3
Class AbstractJdbc3DatabaseMetaData

java.lang.Object
  extended by org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData
      extended by org.postgresql.jdbc3.AbstractJdbc3DatabaseMetaData
Direct Known Subclasses:
AbstractJdbc4DatabaseMetaData, Jdbc3DatabaseMetaData, Jdbc3gDatabaseMetaData

public abstract class AbstractJdbc3DatabaseMetaData
extends AbstractJdbc2DatabaseMetaData


Field Summary
 
Fields inherited from class org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData
connection
 
Constructor Summary
AbstractJdbc3DatabaseMetaData(AbstractJdbc3Connection conn)
           
 
Method Summary
 ResultSet getAttributes(String catalog, String schemaPattern, String typeNamePattern, String attributeNamePattern)
          Retrieves a description of the given attribute of the given type for a user-defined type (UDT) that is available in the given schema and catalog.
 ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)
           
 int getDatabaseMajorVersion()
          Retrieves the major version number of the underlying database.
 int getDatabaseMinorVersion()
          Retrieves the minor version number of the underlying database.
 int getJDBCMajorVersion()
          Retrieves the major JDBC version number for this driver.
 int getJDBCMinorVersion()
          Retrieves the minor JDBC version number for this driver.
 int getResultSetHoldability()
          Retrieves the default holdability of this ResultSet object.
 ResultSet getSchemas()
           
 int getSQLStateType()
          Indicates whether the SQLSTATEs returned by SQLException.getSQLState is X/Open (now known as Open Group) SQL CLI or SQL99.
 ResultSet getSuperTables(String catalog, String schemaPattern, String tableNamePattern)
          Retrieves a description of the table hierarchies defined in a particular schema in this database.
 ResultSet getSuperTypes(String catalog, String schemaPattern, String typeNamePattern)
          Retrieves a description of the user-defined type (UDT) hierarchies defined in a particular schema in this database.
 boolean locatorsUpdateCopy()
          Indicates whether updates made to a LOB are made on a copy or directly to the LOB.
 boolean supportsGetGeneratedKeys()
          Retrieves whether auto-generated keys can be retrieved after a statement has been executed.
 boolean supportsMultipleOpenResults()
          Retrieves whether it is possible to have multiple ResultSet objects returned from a CallableStatement object simultaneously.
 boolean supportsNamedParameters()
          Retrieves whether this database supports named parameters to callable statements.
 boolean supportsResultSetHoldability(int holdability)
          Retrieves whether this database supports the given result set holdability.
 boolean supportsSavepoints()
          Retrieves whether this database supports savepoints.
 boolean supportsStatementPooling()
          Retrieves weather this database supports statement pooling.
 
Methods inherited from class org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData
allProceduresAreCallable, allTablesAreSelectable, createMetaDataStatement, dataDefinitionCausesTransactionCommit, dataDefinitionIgnoredInTransactions, deletesAreDetected, doesMaxRowSizeIncludeBlobs, escapeQuotes, getBestRowIdentifier, getCatalogs, getCatalogSeparator, getCatalogTerm, getColumnPrivileges, getColumns, getConnection, getCrossReference, getDatabaseProductName, getDatabaseProductVersion, getDefaultTransactionIsolation, getDriverMajorVersion, getDriverMinorVersion, getDriverName, getDriverVersion, getExportedKeys, getExtraNameCharacters, getIdentifierQuoteString, getImportedExportedKeys, getImportedKeys, getIndexInfo, getMaxBinaryLiteralLength, getMaxCatalogNameLength, getMaxCharLiteralLength, getMaxColumnNameLength, getMaxColumnsInGroupBy, getMaxColumnsInIndex, getMaxColumnsInOrderBy, getMaxColumnsInSelect, getMaxColumnsInTable, getMaxConnections, getMaxCursorNameLength, getMaxIndexKeys, getMaxIndexLength, getMaxNameLength, getMaxProcedureNameLength, getMaxRowSize, getMaxSchemaNameLength, getMaxStatementLength, getMaxStatements, getMaxTableNameLength, getMaxTablesInSelect, getMaxUserNameLength, getNumericFunctions, getPrimaryKeys, getProcedureColumns, getProcedureColumns, getProcedures, getProcedures, getProcedureTerm, getSchemas, getSchemaTerm, getSearchStringEscape, getSQLKeywords, getStringFunctions, getSystemFunctions, getTablePrivileges, getTables, getTableTypes, getTimeDateFunctions, getTypeInfo, getUDTs, getURL, getUserName, getVersionColumns, insertsAreDetected, isCatalogAtStart, isReadOnly, nullPlusNonNullIsNull, nullsAreSortedAtEnd, nullsAreSortedAtStart, nullsAreSortedHigh, nullsAreSortedLow, othersDeletesAreVisible, othersInsertsAreVisible, othersUpdatesAreVisible, ownDeletesAreVisible, ownInsertsAreVisible, ownUpdatesAreVisible, parseACL, rowChangesAreDetected, rowChangesAreVisible, 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, supportsGroupBy, supportsGroupByBeyondSelect, supportsGroupByUnrelated, supportsIntegrityEnhancementFacility, supportsLikeEscapeClause, supportsLimitedOuterJoins, supportsMinimumSQLGrammar, supportsMixedCaseIdentifiers, supportsMixedCaseQuotedIdentifiers, supportsMultipleResultSets, supportsMultipleTransactions, supportsNonNullableColumns, supportsOpenCursorsAcrossCommit, supportsOpenCursorsAcrossRollback, supportsOpenStatementsAcrossCommit, supportsOpenStatementsAcrossRollback, supportsOrderByUnrelated, supportsOuterJoins, supportsPositionedDelete, supportsPositionedUpdate, supportsResultSetConcurrency, supportsResultSetType, supportsSchemasInDataManipulation, supportsSchemasInIndexDefinitions, supportsSchemasInPrivilegeDefinitions, supportsSchemasInProcedureCalls, supportsSchemasInTableDefinitions, supportsSelectForUpdate, 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
 

Constructor Detail

AbstractJdbc3DatabaseMetaData

public AbstractJdbc3DatabaseMetaData(AbstractJdbc3Connection conn)
Method Detail

supportsSavepoints

public boolean supportsSavepoints()
                           throws SQLException
Retrieves whether this database supports savepoints.

Returns:
true if savepoints are supported; false otherwise
Throws:
SQLException - if a database access error occurs
Since:
1.4

supportsNamedParameters

public boolean supportsNamedParameters()
                                throws SQLException
Retrieves whether this database supports named parameters to callable statements.

Returns:
true if named parameters are supported; false otherwise
Throws:
SQLException - if a database access error occurs
Since:
1.4

supportsMultipleOpenResults

public boolean supportsMultipleOpenResults()
                                    throws SQLException
Retrieves whether it is possible to have multiple ResultSet objects returned from a CallableStatement object simultaneously.

Returns:
true if a CallableStatement object can return multiple ResultSet objects simultaneously; false otherwise
Throws:
SQLException - if a datanase access error occurs
Since:
1.4

supportsGetGeneratedKeys

public boolean supportsGetGeneratedKeys()
                                 throws SQLException
Retrieves whether auto-generated keys can be retrieved after a statement has been executed.

Returns:
true if auto-generated keys can be retrieved after a statement has executed; false otherwise
Throws:
SQLException - if a database access error occurs
Since:
1.4

getSuperTypes

public ResultSet getSuperTypes(String catalog,
                               String schemaPattern,
                               String typeNamePattern)
                        throws SQLException
Retrieves a description of the user-defined type (UDT) hierarchies defined in a particular schema in this database. Only the immediate super type/ sub type relationship is modeled.

Only supertype information for UDTs matching the catalog, schema, and type name is returned. The type name parameter may be a fully-qualified name. When the UDT name supplied is a fully-qualified name, the catalog and schemaPattern parameters are ignored.

If a UDT does not have a direct super type, it is not listed here. A row of the ResultSet object returned by this method describes the designated UDT and a direct supertype. A row has the following columns:

  1. TYPE_CAT String => the UDT's catalog (may be null)
  2. TYPE_SCHEM String => UDT's schema (may be null)
  3. TYPE_NAME String => type name of the UDT
  4. SUPERTYPE_CAT String => the direct super type's catalog (may be null)
  5. SUPERTYPE_SCHEM String => the direct super type's schema (may be null)
  6. SUPERTYPE_NAME String => the direct super type's name

Note: If the driver does not support type hierarchies, an empty result set is returned.

Parameters:
catalog - a catalog name; "" retrieves those without a catalog; null means drop catalog name from the selection criteria
schemaPattern - a schema name pattern; "" retrieves those without a schema
typeNamePattern - a UDT name pattern; may be a fully-qualified name
Returns:
a ResultSet object in which a row gives information about the designated UDT
Throws:
SQLException - if a database access error occurs
Since:
1.4

getSuperTables

public ResultSet getSuperTables(String catalog,
                                String schemaPattern,
                                String tableNamePattern)
                         throws SQLException
Retrieves a description of the table hierarchies defined in a particular schema in this database.

Only supertable information for tables matching the catalog, schema and table name are returned. The table name parameter may be a fully- qualified name, in which case, the catalog and schemaPattern parameters are ignored. If a table does not have a super table, it is not listed here. Supertables have to be defined in the same catalog and schema as the sub tables. Therefore, the type description does not need to include this information for the supertable.

Each type description has the following columns:

  1. TABLE_CAT String => the type's catalog (may be null)
  2. TABLE_SCHEM String => type's schema (may be null)
  3. TABLE_NAME String => type name
  4. SUPERTABLE_NAME String => the direct super type's name

Note: If the driver does not support type hierarchies, an empty result set is returned.

Parameters:
catalog - a catalog name; "" retrieves those without a catalog; null means drop catalog name from the selection criteria
schemaPattern - a schema name pattern; "" retrieves those without a schema
tableNamePattern - a table name pattern; may be a fully-qualified name
Returns:
a ResultSet object in which each row is a type description
Throws:
SQLException - if a database access error occurs
Since:
1.4

getAttributes

public ResultSet getAttributes(String catalog,
                               String schemaPattern,
                               String typeNamePattern,
                               String attributeNamePattern)
                        throws SQLException
Retrieves a description of the given attribute of the given type for a user-defined type (UDT) that is available in the given schema and catalog.

Descriptions are returned only for attributes of UDTs matching the catalog, schema, type, and attribute name criteria. They are ordered by TYPE_SCHEM, TYPE_NAME and ORDINAL_POSITION. This description does not contain inherited attributes.

The ResultSet object that is returned has the following columns:

  1. TYPE_CAT String => type catalog (may be null)
  2. TYPE_SCHEM String => type schema (may be null)
  3. TYPE_NAME String => type name
  4. ATTR_NAME String => attribute name
  5. DATA_TYPE short => attribute type SQL type from java.sql.Types
  6. ATTR_TYPE_NAME String => Data source dependent type name. For a UDT, the type name is fully qualified. For a REF, the type name is fully qualified and represents the target type of the reference type.
  7. ATTR_SIZE int => column size. For char or date types this is the maximum number of characters; for numeric or decimal types this is precision.
  8. DECIMAL_DIGITS int => the number of fractional digits
  9. NUM_PREC_RADIX int => Radix (typically either 10 or 2)
  10. NULLABLE int => whether NULL is allowed
    • attributeNoNulls - might not allow NULL values
    • attributeNullable - definitely allows NULL values
    • attributeNullableUnknown - nullability unknown
  11. REMARKS String => comment describing column (may be null)
  12. ATTR_DEF String => default value (may be null)
  13. SQL_DATA_TYPE int => unused
  14. SQL_DATETIME_SUB int => unused
  15. CHAR_OCTET_LENGTH int => for char types the maximum number of bytes in the column
  16. ORDINAL_POSITION int => index of column in table (starting at 1)
  17. IS_NULLABLE String => "NO" means column definitely does not allow NULL values; "YES" means the column might allow NULL values. An empty string means unknown.
  18. SCOPE_CATALOG String => catalog of table that is the scope of a reference attribute (null if DATA_TYPE isn't REF)
  19. SCOPE_SCHEMA String => schema of table that is the scope of a reference attribute (null if DATA_TYPE isn't REF)
  20. SCOPE_TABLE String => table name that is the scope of a reference attribute (null if the DATA_TYPE isn't REF)
  21. SOURCE_DATA_TYPE short => source type of a distinct type or user-generated Ref type,SQL type from java.sql.Types (null if DATA_TYPE isn't DISTINCT or user-generated REF)

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 search
schemaPattern - 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
typeNamePattern - a type name pattern; must match the type name as it is stored in the database
attributeNamePattern - an attribute name pattern; must match the attribute name as it is declared in the database
Returns:
a ResultSet object in which each row is an attribute description
Throws:
SQLException - if a database access error occurs
Since:
1.4

supportsResultSetHoldability

public boolean supportsResultSetHoldability(int holdability)
                                     throws SQLException
Retrieves whether this database supports the given result set holdability.

Parameters:
holdability - one of the following constants: ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
Returns:
true if so; false otherwise
Throws:
SQLException - if a database access error occurs
Since:
1.4
See Also:
Connection

getResultSetHoldability

public int getResultSetHoldability()
                            throws SQLException
Retrieves the default holdability of this ResultSet object.

Returns:
the default holdability; either ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
Throws:
SQLException - if a database access error occurs
Since:
1.4

getDatabaseMajorVersion

public int getDatabaseMajorVersion()
                            throws SQLException
Retrieves the major version number of the underlying database.

Returns:
the underlying database's major version
Throws:
SQLException - if a database access error occurs
Since:
1.4

getDatabaseMinorVersion

public int getDatabaseMinorVersion()
                            throws SQLException
Retrieves the minor version number of the underlying database.

Returns:
underlying database's minor version
Throws:
SQLException - if a database access error occurs
Since:
1.4

getJDBCMajorVersion

public int getJDBCMajorVersion()
                        throws SQLException
Retrieves the major JDBC version number for this driver.

Returns:
JDBC version major number
Throws:
SQLException - if a database access error occurs
Since:
1.4

getJDBCMinorVersion

public int getJDBCMinorVersion()
                        throws SQLException
Retrieves the minor JDBC version number for this driver.

Returns:
JDBC version minor number
Throws:
SQLException - if a database access error occurs
Since:
1.4

getSQLStateType

public int getSQLStateType()
                    throws SQLException
Indicates whether the SQLSTATEs returned by SQLException.getSQLState is X/Open (now known as Open Group) SQL CLI or SQL99.

Returns:
the type of SQLSTATEs, one of: sqlStateXOpen or sqlStateSQL99
Throws:
SQLException - if a database access error occurs
Since:
1.4

locatorsUpdateCopy

public boolean locatorsUpdateCopy()
                           throws SQLException
Indicates whether updates made to a LOB are made on a copy or directly to the LOB.

Returns:
true if updates are made to a copy of the LOB; false if updates are made directly to the LOB
Throws:
SQLException - if a database access error occurs
Since:
1.4

supportsStatementPooling

public boolean supportsStatementPooling()
                                 throws SQLException
Retrieves weather this database supports statement pooling.

Returns:
true is so; false otherwise
Throws:
SQLExcpetion - if a database access error occurs
SQLException
Since:
1.4

getColumns

public ResultSet getColumns(String catalog,
                            String schemaPattern,
                            String tableNamePattern,
                            String columnNamePattern)
                     throws SQLException
Overrides:
getColumns in class AbstractJdbc2DatabaseMetaData
Throws:
SQLException

getSchemas

public ResultSet getSchemas()
                     throws SQLException
Overrides:
getSchemas in class AbstractJdbc2DatabaseMetaData
Throws:
SQLException


Copyright © 2013. All Rights Reserved.