diff options
author | Barry Lind <barry@xythos.com> | 2002-08-14 20:35:40 +0000 |
---|---|---|
committer | Barry Lind <barry@xythos.com> | 2002-08-14 20:35:40 +0000 |
commit | b3dd55c6517a6a9f531a7bab463e9bcf6291aa9b (patch) | |
tree | e78512bb088ee72bff62abd640335c29cc5965c9 /src/interfaces/jdbc/org/postgresql/jdbc3/AbstractJdbc3DatabaseMetaData.java | |
parent | 64a0649432408b407e477caf11056b380b5689bd (diff) | |
download | postgresql-b3dd55c6517a6a9f531a7bab463e9bcf6291aa9b.tar.gz |
Added support for JDBC3. The driver will now build under JDBC3 (i.e. Java 1.4).
This concludes my changes that restructured the code to support JDBC3.
The jdbc unit tests were also resturctured to allow different tests between
jdbc2 and jdbc3, although currently make check (aka ant test) for JDBC3 just
runs the JDBC2 tests. Of special note the largeobject/PGblob and PGclob
classes have been moved under the jdbc2/jdbc3 specific directories as they
now differ by jdbc version. Also note that this checkin removes the
PostgresqlDataSource and files in the xa directory. A recent checkin has
added new datasource support that replaces the functionality provided by these
classes.
Modified Files:
jdbc/build.xml
jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSet.java
jdbc/org/postgresql/jdbc1/AbstractJdbc1ResultSetMetaData.java
jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
jdbc/org/postgresql/jdbc2/AbstractJdbc2Connection.java
jdbc/org/postgresql/jdbc2/AbstractJdbc2DatabaseMetaData.java
jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSetMetaData.java
jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java
jdbc/org/postgresql/jdbc2/Array.java
jdbc/org/postgresql/jdbc2/Jdbc2CallableStatement.java
jdbc/org/postgresql/jdbc2/Jdbc2Connection.java
jdbc/org/postgresql/jdbc2/Jdbc2DatabaseMetaData.java
jdbc/org/postgresql/jdbc2/Jdbc2PreparedStatement.java
jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java
jdbc/org/postgresql/jdbc2/Jdbc2ResultSetMetaData.java
jdbc/org/postgresql/jdbc2/Jdbc2Statement.java
jdbc/org/postgresql/test/jdbc2/BatchExecuteTest.java
jdbc/org/postgresql/test/jdbc2/BlobTest.java
jdbc/org/postgresql/test/jdbc2/CallableStmtTest.java
jdbc/org/postgresql/test/jdbc2/ConnectionTest.java
jdbc/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java
jdbc/org/postgresql/test/jdbc2/DateTest.java
jdbc/org/postgresql/test/jdbc2/DriverTest.java
jdbc/org/postgresql/test/jdbc2/JBuilderTest.java
jdbc/org/postgresql/test/jdbc2/MiscTest.java
jdbc/org/postgresql/test/jdbc2/ResultSetTest.java
jdbc/org/postgresql/test/jdbc2/TimeTest.java
jdbc/org/postgresql/test/jdbc2/TimestampTest.java
jdbc/org/postgresql/test/jdbc2/UpdateableResultTest.java
Added Files:
jdbc/org/postgresql/jdbc2/AbstractJdbc2Blob.java
jdbc/org/postgresql/jdbc2/AbstractJdbc2Clob.java
jdbc/org/postgresql/jdbc2/Jdbc2Blob.java
jdbc/org/postgresql/jdbc2/Jdbc2Clob.java
jdbc/org/postgresql/jdbc3/AbstractJdbc3Blob.java
jdbc/org/postgresql/jdbc3/AbstractJdbc3Clob.java
jdbc/org/postgresql/jdbc3/AbstractJdbc3Connection.java
jdbc/org/postgresql/jdbc3/AbstractJdbc3DatabaseMetaData.java
jdbc/org/postgresql/jdbc3/AbstractJdbc3ResultSet.java
jdbc/org/postgresql/jdbc3/AbstractJdbc3Statement.java
jdbc/org/postgresql/jdbc3/Jdbc3Blob.java
jdbc/org/postgresql/jdbc3/Jdbc3CallableStatement.java
jdbc/org/postgresql/jdbc3/Jdbc3Clob.java
jdbc/org/postgresql/jdbc3/Jdbc3Connection.java
jdbc/org/postgresql/jdbc3/Jdbc3DatabaseMetaData.java
jdbc/org/postgresql/jdbc3/Jdbc3PreparedStatement.java
jdbc/org/postgresql/jdbc3/Jdbc3ResultSet.java
jdbc/org/postgresql/jdbc3/Jdbc3ResultSetMetaData.java
jdbc/org/postgresql/jdbc3/Jdbc3Statement.java
jdbc/org/postgresql/test/TestUtil.java
jdbc/org/postgresql/test/jdbc2/Jdbc2TestSuite.java
jdbc/org/postgresql/test/jdbc3/Jdbc3TestSuite.java
Removed Files:
jdbc/org/postgresql/PostgresqlDataSource.java
jdbc/org/postgresql/largeobject/PGblob.java
jdbc/org/postgresql/largeobject/PGclob.java
jdbc/org/postgresql/test/JDBC2Tests.java
jdbc/org/postgresql/xa/ClientConnection.java
jdbc/org/postgresql/xa/TwoPhaseConnection.java
jdbc/org/postgresql/xa/TxConnection.java
jdbc/org/postgresql/xa/XAConnectionImpl.java
jdbc/org/postgresql/xa/XADataSourceImpl.java
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/jdbc3/AbstractJdbc3DatabaseMetaData.java')
-rw-r--r-- | src/interfaces/jdbc/org/postgresql/jdbc3/AbstractJdbc3DatabaseMetaData.java | 339 |
1 files changed, 339 insertions, 0 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/jdbc3/AbstractJdbc3DatabaseMetaData.java b/src/interfaces/jdbc/org/postgresql/jdbc3/AbstractJdbc3DatabaseMetaData.java new file mode 100644 index 0000000000..0c2e61d3a2 --- /dev/null +++ b/src/interfaces/jdbc/org/postgresql/jdbc3/AbstractJdbc3DatabaseMetaData.java @@ -0,0 +1,339 @@ +package org.postgresql.jdbc3; + + +import java.sql.*; + +public abstract class AbstractJdbc3DatabaseMetaData extends org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData +{ + + public AbstractJdbc3DatabaseMetaData(AbstractJdbc3Connection conn) + { + super(conn); + } + + + /** + * Retrieves whether this database supports savepoints. + * + * @return <code>true</code> if savepoints are supported; + * <code>false</code> otherwise + * @exception SQLException if a database access error occurs + * @since 1.4 + */ + public boolean supportsSavepoints() throws SQLException { + throw org.postgresql.Driver.notImplemented(); + } + + /** + * Retrieves whether this database supports named parameters to callable + * statements. + * + * @return <code>true</code> if named parameters are supported; + * <code>false</code> otherwise + * @exception SQLException if a database access error occurs + * @since 1.4 + */ + public boolean supportsNamedParameters() throws SQLException { + throw org.postgresql.Driver.notImplemented(); + } + + /** + * Retrieves whether it is possible to have multiple <code>ResultSet</code> objects + * returned from a <code>CallableStatement</code> object + * simultaneously. + * + * @return <code>true</code> if a <code>CallableStatement</code> object + * can return multiple <code>ResultSet</code> objects + * simultaneously; <code>false</code> otherwise + * @exception SQLException if a datanase access error occurs + * @since 1.4 + */ + public boolean supportsMultipleOpenResults() throws SQLException { + throw org.postgresql.Driver.notImplemented(); + } + + /** + * Retrieves whether auto-generated keys can be retrieved after + * a statement has been executed. + * + * @return <code>true</code> if auto-generated keys can be retrieved + * after a statement has executed; <code>false</code> otherwise + * @exception SQLException if a database access error occurs + * @since 1.4 + */ + public boolean supportsGetGeneratedKeys() throws SQLException { + throw org.postgresql.Driver.notImplemented(); + } + + /** + * 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. + * <P> + * 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. + * <P> + * If a UDT does not have a direct super type, it is not listed here. + * A row of the <code>ResultSet</code> object returned by this method + * describes the designated UDT and a direct supertype. A row has the following + * columns: + * <OL> + * <LI><B>TYPE_CAT</B> String => the UDT's catalog (may be <code>null</code>) + * <LI><B>TYPE_SCHEM</B> String => UDT's schema (may be <code>null</code>) + * <LI><B>TYPE_NAME</B> String => type name of the UDT + * <LI><B>SUPERTYPE_CAT</B> String => the direct super type's catalog + * (may be <code>null</code>) + * <LI><B>SUPERTYPE_SCHEM</B> String => the direct super type's schema + * (may be <code>null</code>) + * <LI><B>SUPERTYPE_NAME</B> String => the direct super type's name + * </OL> + * + * <P><B>Note:</B> If the driver does not support type hierarchies, an + * empty result set is returned. + * + * @param catalog a catalog name; "" retrieves those without a catalog; + * <code>null</code> means drop catalog name from the selection criteria + * @param schemaPattern a schema name pattern; "" retrieves those + * without a schema + * @param typeNamePattern a UDT name pattern; may be a fully-qualified + * name + * @return a <code>ResultSet</code> object in which a row gives information + * about the designated UDT + * @throws SQLException if a database access error occurs + * @since 1.4 + */ + public ResultSet getSuperTypes(String catalog, String schemaPattern, + String typeNamePattern) throws SQLException { + throw org.postgresql.Driver.notImplemented(); + } + + /** + * Retrieves a description of the table hierarchies defined in a particular + * schema in this database. + * + * <P>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. + * + * <P>Each type description has the following columns: + * <OL> + * <LI><B>TABLE_CAT</B> String => the type's catalog (may be <code>null</code>) + * <LI><B>TABLE_SCHEM</B> String => type's schema (may be <code>null</code>) + * <LI><B>TABLE_NAME</B> String => type name + * <LI><B>SUPERTABLE_NAME</B> String => the direct super type's name + * </OL> + * + * <P><B>Note:</B> If the driver does not support type hierarchies, an + * empty result set is returned. + * + * @param catalog a catalog name; "" retrieves those without a catalog; + * <code>null</code> means drop catalog name from the selection criteria + * @param schemaPattern a schema name pattern; "" retrieves those + * without a schema + * @param tableNamePattern a table name pattern; may be a fully-qualified + * name + * @return a <code>ResultSet</code> object in which each row is a type description + * @throws SQLException if a database access error occurs + * @since 1.4 + */ + public ResultSet getSuperTables(String catalog, String schemaPattern, + String tableNamePattern) throws SQLException { + throw org.postgresql.Driver.notImplemented(); + } + + /** + * 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. + * <P> + * 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. + * <P> + * The <code>ResultSet</code> object that is returned has the following + * columns: + * <OL> + * <LI><B>TYPE_CAT</B> String => type catalog (may be <code>null</code>) + * <LI><B>TYPE_SCHEM</B> String => type schema (may be <code>null</code>) + * <LI><B>TYPE_NAME</B> String => type name + * <LI><B>ATTR_NAME</B> String => attribute name + * <LI><B>DATA_TYPE</B> short => attribute type SQL type from java.sql.Types + * <LI><B>ATTR_TYPE_NAME</B> 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. + * <LI><B>ATTR_SIZE</B> int => column size. For char or date + * types this is the maximum number of characters; for numeric or + * decimal types this is precision. + * <LI><B>DECIMAL_DIGITS</B> int => the number of fractional digits + * <LI><B>NUM_PREC_RADIX</B> int => Radix (typically either 10 or 2) + * <LI><B>NULLABLE</B> int => whether NULL is allowed + * <UL> + * <LI> attributeNoNulls - might not allow NULL values + * <LI> attributeNullable - definitely allows NULL values + * <LI> attributeNullableUnknown - nullability unknown + * </UL> + * <LI><B>REMARKS</B> String => comment describing column (may be <code>null</code>) + * <LI><B>ATTR_DEF</B> String => default value (may be <code>null</code>) + * <LI><B>SQL_DATA_TYPE</B> int => unused + * <LI><B>SQL_DATETIME_SUB</B> int => unused + * <LI><B>CHAR_OCTET_LENGTH</B> int => for char types the + * maximum number of bytes in the column + * <LI><B>ORDINAL_POSITION</B> int => index of column in table + * (starting at 1) + * <LI><B>IS_NULLABLE</B> String => "NO" means column definitely + * does not allow NULL values; "YES" means the column might + * allow NULL values. An empty string means unknown. + * <LI><B>SCOPE_CATALOG</B> String => catalog of table that is the + * scope of a reference attribute (<code>null</code> if DATA_TYPE isn't REF) + * <LI><B>SCOPE_SCHEMA</B> String => schema of table that is the + * scope of a reference attribute (<code>null</code> if DATA_TYPE isn't REF) + * <LI><B>SCOPE_TABLE</B> String => table name that is the scope of a + * reference attribute (<code>null</code> if the DATA_TYPE isn't REF) + * <LI><B>SOURCE_DATA_TYPE</B> short => source type of a distinct type or user-generated + * Ref type,SQL type from java.sql.Types (<code>null</code> if DATA_TYPE + * isn't DISTINCT or user-generated REF) + * </OL> + * @param catalog a catalog name; must match the catalog name as it + * is stored in the database; "" retrieves those without a catalog; + * <code>null</code> means that the catalog name should not be used to narrow + * the search + * @param schemaPattern a schema name pattern; must match the schema name + * as it is stored in the database; "" retrieves those without a schema; + * <code>null</code> means that the schema name should not be used to narrow + * the search + * @param typeNamePattern a type name pattern; must match the + * type name as it is stored in the database + * @param attributeNamePattern an attribute name pattern; must match the attribute + * name as it is declared in the database + * @return a <code>ResultSet</code> object in which each row is an + * attribute description + * @exception SQLException if a database access error occurs + * @since 1.4 + */ + public ResultSet getAttributes(String catalog, String schemaPattern, + String typeNamePattern, String attributeNamePattern) + throws SQLException { + throw org.postgresql.Driver.notImplemented(); + } + + /** + * Retrieves whether this database supports the given result set holdability. + * + * @param holdability one of the following constants: + * <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or + * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT<code> + * @return <code>true</code> if so; <code>false</code> otherwise + * @exception SQLException if a database access error occurs + * @see Connection + * @since 1.4 + */ + public boolean supportsResultSetHoldability(int holdability) throws SQLException { + throw org.postgresql.Driver.notImplemented(); + } + + /** + * Retrieves the default holdability of this <code>ResultSet</code> + * object. + * + * @return the default holdability; either + * <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or + * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code> + * @exception SQLException if a database access error occurs + * @since 1.4 + */ + public int getResultSetHoldability() throws SQLException { + throw org.postgresql.Driver.notImplemented(); + } + + /** + * Retrieves the major version number of the underlying database. + * + * @return the underlying database's major version + * @exception SQLException if a database access error occurs + * @since 1.4 + */ + public int getDatabaseMajorVersion() throws SQLException { + throw org.postgresql.Driver.notImplemented(); + } + + /** + * Retrieves the minor version number of the underlying database. + * + * @return underlying database's minor version + * @exception SQLException if a database access error occurs + * @since 1.4 + */ + public int getDatabaseMinorVersion() throws SQLException { + throw org.postgresql.Driver.notImplemented(); + } + + /** + * Retrieves the major JDBC version number for this + * driver. + * + * @return JDBC version major number + * @exception SQLException if a database access error occurs + * @since 1.4 + */ + public int getJDBCMajorVersion() throws SQLException { + throw org.postgresql.Driver.notImplemented(); + } + + /** + * Retrieves the minor JDBC version number for this + * driver. + * + * @return JDBC version minor number + * @exception SQLException if a database access error occurs + * @since 1.4 + */ + public int getJDBCMinorVersion() throws SQLException { + throw org.postgresql.Driver.notImplemented(); + } + + /** + * Indicates whether the SQLSTATEs returned by <code>SQLException.getSQLState</code> + * is X/Open (now known as Open Group) SQL CLI or SQL99. + * @return the type of SQLSTATEs, one of: + * sqlStateXOpen or + * sqlStateSQL99 + * @throws SQLException if a database access error occurs + * @since 1.4 + */ + public int getSQLStateType() throws SQLException { + throw org.postgresql.Driver.notImplemented(); + } + + /** + * Indicates whether updates made to a LOB are made on a copy or directly + * to the LOB. + * @return <code>true</code> if updates are made to a copy of the LOB; + * <code>false</code> if updates are made directly to the LOB + * @throws SQLException if a database access error occurs + * @since 1.4 + */ + public boolean locatorsUpdateCopy() throws SQLException { + throw org.postgresql.Driver.notImplemented(); + } + + /** + * Retrieves weather this database supports statement pooling. + * + * @return <code>true</code> is so; + <code>false</code> otherwise + * @throws SQLExcpetion if a database access error occurs + * @since 1.4 + */ + public boolean supportsStatementPooling() throws SQLException { + throw org.postgresql.Driver.notImplemented(); + } + +} |