// This is a default value for remarks
private static final byte defaultRemarks[]="no remarks".getBytes();
+
+ private boolean haveMinimumServerVersion(String ver) throws SQLException
+ {
+ if (getDatabaseProductVersion().compareTo(ver)>=0)
+ return true;
+ else
+ return false;
+ }
+
+
public DatabaseMetaData(Connection conn)
{
this.connection = conn;
*/
public boolean nullsAreSortedHigh() throws SQLException
{
- return false;
+ return haveMinimumServerVersion("7.2");
}
/**
*/
public boolean nullsAreSortedAtEnd() throws SQLException
{
- return true;
+ return ! haveMinimumServerVersion("7.2");
}
/**
* case sensitive and as a result store them in mixed case? A
* JDBC compliant driver will always return true.
*
- *
Predicament - what do they mean by "SQL identifiers" - if it
- * means the names of the tables and columns, then the answers
- * given below are correct - otherwise I don't know.
- *
* @return true if so
* @exception SQLException if a database access error occurs
*/
* a space if identifier quoting isn't supported. A JDBC Compliant
* driver will always use a double quote character.
*
- *
If an SQL identifier is a table name, column name, etc. then
- * we do not support it.
- *
* @return the quoting string
* @exception SQLException if a database access error occurs
*/
return false;
}
+ /**
+ * Are table correlation names supported? A JDBC Compliant
+ * driver always returns true.
+ *
+ * @return true if so; false otherwise
+ * @exception SQLException - if a database access error occurs
+ */
public boolean supportsTableCorrelationNames() throws SQLException
{
- // XXX-Not Implemented
- return false;
+ return true;
}
+ /**
+ * If table correlation names are supported, are they restricted to
+ * be different from the names of the tables?
+ *
+ * @return true if so; false otherwise
+ * @exception SQLException - if a database access error occurs
+ */
public boolean supportsDifferentTableCorrelationNames() throws SQLException
{
- // XXX-Not Implemented
return false;
}
/**
* Can an "ORDER BY" clause use columns not in the SELECT?
- * I checked it, and you can't.
*
* @return true if so
* @exception SQLException if a database access error occurs
*/
public boolean supportsOrderByUnrelated() throws SQLException
{
- return false;
+ return haveMinimumServerVersion("6.4");
}
/**
/**
* Can a "GROUP BY" clause use columns not in the SELECT?
- * I checked it - it seems to allow it
*
* @return true if so
* @exception SQLException if a database access error occurs
*/
public boolean supportsGroupByUnrelated() throws SQLException
{
- return true;
+ return haveMinimumServerVersion("6.4");
}
/**
* it specifies all the columns in the SELECT? Does anyone actually
* understand what they mean here?
*
+ * (I think this is a subset of the previous function. -- petere)
+ *
* @return true if so
* @exception SQLException if a database access error occurs
*/
public boolean supportsGroupByBeyondSelect() throws SQLException
{
- return true; // For now...
+ return supportsGroupByUnrelated();
}
/**
*/
public boolean supportsLikeEscapeClause() throws SQLException
{
- return true;
+ return haveMinimumServerVersion("7.1");
}
/**
/**
* Does this driver support the ANSI-92 entry level SQL grammar?
- * All JDBC Compliant drivers must return true. I think we have
- * to support outer joins for this to be true.
+ * All JDBC Compliant drivers must return true.
*
* @return true if so
* @exception SQLException if a database access error occurs
/**
* Does this driver support the ANSI-92 intermediate level SQL
- * grammar? Anyone who does not support Entry level cannot support
- * Intermediate level.
+ * grammar?
*
* @return true if so
* @exception SQLException if a database access error occurs
*/
public boolean supportsOuterJoins() throws SQLException
{
- return true; // yes 7.1 does
+ return haveMinimumServerVersion("7.1");
}
/**
*/
public boolean supportsFullOuterJoins() throws SQLException
{
- return true; // yes in 7.1
+ return haveMinimumServerVersion("7.1");
}
/**
*/
public boolean supportsLimitedOuterJoins() throws SQLException
{
- return true; // yes in 7.1
+ return supportsFullOuterJoins();
}
/**
- * What is the database vendor's preferred term for "schema" - well,
- * we do not provide support for schemas, so lets just use that
- * term.
+ * What is the database vendor's preferred term for "schema"?
+ * PostgreSQL doesn't have schemas, but when it does, we'll use the
+ * term "schema".
*
* @return the vendor term
* @exception SQLException if a database access error occurs
*/
public String getSchemaTerm() throws SQLException
{
- return "Schema";
+ return "schema";
}
/**
- * What is the database vendor's preferred term for "procedure" -
- * I kind of like "Procedure" myself.
+ * What is the database vendor's preferred term for "procedure"?
+ * Traditionally, "function" has been used.
*
* @return the vendor term
* @exception SQLException if a database access error occurs
*/
public String getProcedureTerm() throws SQLException
{
- return "Procedure";
+ return "function";
}
/**
- * What is the database vendor's preferred term for "catalog"? -
- * we dont have a preferred term, so just use Catalog
+ * What is the database vendor's preferred term for "catalog"?
*
* @return the vendor term
* @exception SQLException if a database access error occurs
*/
public String getCatalogTerm() throws SQLException
{
- return "Catalog";
+ return "database";
}
/**
*/
public boolean isCatalogAtStart() throws SQLException
{
- return false;
+ throw org.postgresql.Driver.notImplemented();
}
/**
- * What is the Catalog separator. Hmmm....well, I kind of like
- * a period (so we get catalog.table definitions). - I don't think
- * PostgreSQL supports catalogs anyhow, so it makes no difference.
+ * What is the Catalog separator.
*
* @return the catalog separator string
* @exception SQLException if a database access error occurs
*/
public String getCatalogSeparator() throws SQLException
{
- // PM Sep 29 97 - changed from "." as we don't support catalogs.
- return "";
+ throw org.postgresql.Driver.notImplemented();
}
/**
return false; // For now...
}
+ /**
+ * Is SELECT for UPDATE supported?
+ *
+ * @return true if so; false otherwise
+ * @exception SQLException - if a database access error occurs
+ */
public boolean supportsSelectForUpdate() throws SQLException
{
- // XXX-Not Implemented
- return false;
+ return haveMinimumServerVersion("6.5");
}
+ /**
+ * Are stored procedure calls using the stored procedure escape
+ * syntax supported?
+ *
+ * @return true if so; false otherwise
+ * @exception SQLException - if a database access error occurs
+ */
public boolean supportsStoredProcedures() throws SQLException
{
- // XXX-Not Implemented
return false;
}
+ /**
+ * Are subqueries in comparison expressions supported? A JDBC
+ * Compliant driver always returns true.
+ *
+ * @return true if so; false otherwise
+ * @exception SQLException - if a database access error occurs
+ */
public boolean supportsSubqueriesInComparisons() throws SQLException
{
- // XXX-Not Implemented
- return false;
+ return true;
}
+ /**
+ * Are subqueries in 'exists' expressions supported? A JDBC
+ * Compliant driver always returns true.
+ *
+ * @return true if so; false otherwise
+ * @exception SQLException - if a database access error occurs
+ */
public boolean supportsSubqueriesInExists() throws SQLException
{
- // XXX-Not Implemented
- return false;
+ return true;
}
+ /**
+ * Are subqueries in 'in' statements supported? A JDBC
+ * Compliant driver always returns true.
+ *
+ * @return true if so; false otherwise
+ * @exception SQLException - if a database access error occurs
+ */
public boolean supportsSubqueriesInIns() throws SQLException
{
- // XXX-Not Implemented
- return false;
+ return true;
}
+ /**
+ * Are subqueries in quantified expressions supported? A JDBC
+ * Compliant driver always returns true.
+ *
+ * (No idea what this is, but we support a good deal of
+ * subquerying.)
+ *
+ * @return true if so; false otherwise
+ * @exception SQLException - if a database access error occurs
+ */
public boolean supportsSubqueriesInQuantifieds() throws SQLException
{
- // XXX-Not Implemented
- return false;
+ return true;
}
+ /**
+ * Are correlated subqueries supported? A JDBC Compliant driver
+ * always returns true.
+ *
+ * (a.k.a. subselect in from?)
+ *
+ * @return true if so; false otherwise
+ * @exception SQLException - if a database access error occurs
+ */
public boolean supportsCorrelatedSubqueries() throws SQLException
{
- // XXX-Not Implemented
- return false;
+ return haveMinimumServerVersion("7.1");
}
/**
- * Is SQL UNION supported? Nope.
+ * Is SQL UNION supported?
*
* @return true if so
* @exception SQLException if a database access error occurs
*/
public boolean supportsUnion() throws SQLException
{
- return true; // 7.0?
+ return true; // since 6.3
}
/**
- * Is SQL UNION ALL supported? Nope.
+ * Is SQL UNION ALL supported?
*
* @return true if so
* @exception SQLException if a database access error occurs
*/
public boolean supportsUnionAll() throws SQLException
{
- return false;
+ return haveMinimumServerVersion("7.1");
}
/**
*/
public int getMaxBinaryLiteralLength() throws SQLException
{
- return 0; // For now...
+ return 0; // no limit
}
/**
*/
public int getMaxCharLiteralLength() throws SQLException
{
- return 65535;
+ return 0; // no limit
}
/**
*/
public int getMaxColumnsInGroupBy() throws SQLException
{
- return getMaxColumnsInTable();
+ return 0; // no limit
}
/**
/**
* What's the maximum number of columns in an "ORDER BY clause?
- * Theoretically, all of them!
*
* @return the max columns
* @exception SQLException if a database access error occurs
*/
public int getMaxColumnsInOrderBy() throws SQLException
{
- return getMaxColumnsInTable();
+ return 0; // no limit
}
/**
* What is the maximum number of columns in a "SELECT" list?
- * Theoretically, all of them!
*
* @return the max columns
* @exception SQLException if a database access error occurs
*/
public int getMaxColumnsInSelect() throws SQLException
{
- return getMaxColumnsInTable();
+ return 0; // no limit
}
/**
}
/**
- * What is the maximum length of an index (in bytes)? Now, does
- * the spec. mean name of an index (in which case its 32, the
- * same as a table) or does it mean length of an index element
- * (in which case its 8192, the size of a row) or does it mean
- * the number of rows it can access (in which case it 2^32 -
- * a 4 byte OID number)? I think its the length of an index
- * element, personally, so Im setting it to 65535.
+ * Retrieves the maximum number of bytes for an index, including all
+ * of the parts of the index.
*
- * @return max index length in bytes
+ * @return max index length in bytes, which includes the composite
+ * of all the constituent parts of the index; a result of zero means
+ * that there is no limit or the limit is not known
* @exception SQLException if a database access error occurs
*/
public int getMaxIndexLength() throws SQLException
{
- return 65535;
+ return 0; // no limit (larger than an int anyway)
}
public int getMaxSchemaNameLength() throws SQLException
}
/**
- * What is the maximum length of a single row? (not including
- * blobs). 65535 is defined in PostgreSQL.
+ * What is the maximum length of a single row?
*
* @return max row size in bytes
* @exception SQLException if a database access error occurs
*/
public int getMaxRowSize() throws SQLException
{
- return 65535;
+ if (haveMinimumServerVersion("7.1"))
+ return 1073741824; // 1 GB
+ else
+ return 8192; // XXX could be altered
}
/**
*/
public int getMaxStatementLength() throws SQLException
{
- return 65535;
+ if (haveMinimumServerVersion("7.0"))
+ return 0; // actually whatever fits in size_t
+ else
+ return 16384;
}
/**
/**
* What is the maximum number of tables that can be specified
- * in a SELECT? Theoretically, this is the same number as the
- * number of tables allowable. In practice tho, it is much smaller
- * since the number of tables is limited by the statement, we
- * return 1024 here - this is just a number I came up with (being
- * the number of tables roughly of three characters each that you
- * can fit inside a 65535 character buffer with comma separators).
+ * in a SELECT?
*
* @return the maximum
* @exception SQLException if a database access error occurs
*/
public int getMaxTablesInSelect() throws SQLException
{
- return 1024;
+ return 0; // no limit
}
/**
/**
* Are both data definition and data manipulation transactions
- * supported? I checked it, and could not do a CREATE TABLE
- * within a transaction, so I am assuming that we don't
+ * supported?
*
* @return true if so
* @exception SQLException if a database access error occurs
*/
public boolean supportsDataDefinitionAndDataManipulationTransactions() throws SQLException
{
- return false;
+ return true;
}
/**
*/
public boolean supportsDataManipulationTransactionsOnly() throws SQLException
{
- return true;
+ return false;
}
/**
// This is a default value for remarks
private static final byte defaultRemarks[]="no remarks".getBytes();
+
+ private boolean haveMinimumServerVersion(String ver) throws SQLException
+ {
+ if (getDatabaseProductVersion().compareTo(ver)>=0)
+ return true;
+ else
+ return false;
+ }
+
+
public DatabaseMetaData(Connection conn)
{
this.connection = conn;
*/
public boolean nullsAreSortedHigh() throws SQLException
{
- return false;
+ return haveMinimumServerVersion("7.2");
}
/**
*/
public boolean nullsAreSortedAtEnd() throws SQLException
{
- return true;
+ return ! haveMinimumServerVersion("7.2");
}
/**
* case sensitive and as a result store them in mixed case? A
* JDBC compliant driver will always return true.
*
- *
Predicament - what do they mean by "SQL identifiers" - if it
- * means the names of the tables and columns, then the answers
- * given below are correct - otherwise I don't know.
- *
* @return true if so
* @exception SQLException if a database access error occurs
*/
* a space if identifier quoting isn't supported. A JDBC Compliant
* driver will always use a double quote character.
*
- *
If an SQL identifier is a table name, column name, etc. then
- * we do not support it.
- *
* @return the quoting string
* @exception SQLException if a database access error occurs
*/
return false;
}
+ /**
+ * Are table correlation names supported? A JDBC Compliant
+ * driver always returns true.
+ *
+ * @return true if so; false otherwise
+ * @exception SQLException - if a database access error occurs
+ */
public boolean supportsTableCorrelationNames() throws SQLException
{
- // XXX-Not Implemented
- return false;
+ return true;
}
+ /**
+ * If table correlation names are supported, are they restricted to
+ * be different from the names of the tables?
+ *
+ * @return true if so; false otherwise
+ * @exception SQLException - if a database access error occurs
+ */
public boolean supportsDifferentTableCorrelationNames() throws SQLException
{
- // XXX-Not Implemented
return false;
}
/**
* Can an "ORDER BY" clause use columns not in the SELECT?
- * I checked it, and you can't.
*
* @return true if so
* @exception SQLException if a database access error occurs
*/
public boolean supportsOrderByUnrelated() throws SQLException
{
- return false;
+ return haveMinimumServerVersion("6.4");
}
/**
/**
* Can a "GROUP BY" clause use columns not in the SELECT?
- * I checked it - it seems to allow it
*
* @return true if so
* @exception SQLException if a database access error occurs
*/
public boolean supportsGroupByUnrelated() throws SQLException
{
- return true;
+ return haveMinimumServerVersion("6.4");
}
/**
* it specifies all the columns in the SELECT? Does anyone actually
* understand what they mean here?
*
+ * (I think this is a subset of the previous function. -- petere)
+ *
* @return true if so
* @exception SQLException if a database access error occurs
*/
public boolean supportsGroupByBeyondSelect() throws SQLException
{
- return true; // For now...
+ return supportsGroupByUnrelated();
}
/**
*/
public boolean supportsLikeEscapeClause() throws SQLException
{
- return true;
+ return haveMinimumServerVersion("7.1");
}
/**
/**
* Does this driver support the ANSI-92 entry level SQL grammar?
- * All JDBC Compliant drivers must return true. I think we have
- * to support outer joins for this to be true.
+ * All JDBC Compliant drivers must return true.
*
* @return true if so
* @exception SQLException if a database access error occurs
/**
* Does this driver support the ANSI-92 intermediate level SQL
- * grammar? Anyone who does not support Entry level cannot support
- * Intermediate level.
+ * grammar?
*
* @return true if so
* @exception SQLException if a database access error occurs
*/
public boolean supportsOuterJoins() throws SQLException
{
- return true; // yes 7.1 does
+ return haveMinimumServerVersion("7.1");
}
/**
*/
public boolean supportsFullOuterJoins() throws SQLException
{
- return true; // yes in 7.1
+ return haveMinimumServerVersion("7.1");
}
/**
*/
public boolean supportsLimitedOuterJoins() throws SQLException
{
- return true; // yes in 7.1
+ return supportsFullOuterJoins();
}
/**
- * What is the database vendor's preferred term for "schema" - well,
- * we do not provide support for schemas, so lets just use that
- * term.
+ * What is the database vendor's preferred term for "schema"?
+ * PostgreSQL doesn't have schemas, but when it does, we'll use the
+ * term "schema".
*
* @return the vendor term
* @exception SQLException if a database access error occurs
*/
public String getSchemaTerm() throws SQLException
{
- return "Schema";
+ return "schema";
}
/**
- * What is the database vendor's preferred term for "procedure" -
- * I kind of like "Procedure" myself.
+ * What is the database vendor's preferred term for "procedure"?
+ * Traditionally, "function" has been used.
*
* @return the vendor term
* @exception SQLException if a database access error occurs
*/
public String getProcedureTerm() throws SQLException
{
- return "Procedure";
+ return "function";
}
/**
- * What is the database vendor's preferred term for "catalog"? -
- * we dont have a preferred term, so just use Catalog
+ * What is the database vendor's preferred term for "catalog"?
*
* @return the vendor term
* @exception SQLException if a database access error occurs
*/
public String getCatalogTerm() throws SQLException
{
- return "Catalog";
+ return "database";
}
/**
*/
public boolean isCatalogAtStart() throws SQLException
{
- return false;
+ throw org.postgresql.Driver.notImplemented();
}
/**
- * What is the Catalog separator. Hmmm....well, I kind of like
- * a period (so we get catalog.table definitions). - I don't think
- * PostgreSQL supports catalogs anyhow, so it makes no difference.
+ * What is the Catalog separator.
*
* @return the catalog separator string
* @exception SQLException if a database access error occurs
*/
public String getCatalogSeparator() throws SQLException
{
- // PM Sep 29 97 - changed from "." as we don't support catalogs.
- return "";
+ throw org.postgresql.Driver.notImplemented();
}
/**
return false; // For now...
}
+ /**
+ * Is SELECT for UPDATE supported?
+ *
+ * @return true if so; false otherwise
+ * @exception SQLException - if a database access error occurs
+ */
public boolean supportsSelectForUpdate() throws SQLException
{
- // XXX-Not Implemented
- return false;
+ return haveMinimumServerVersion("6.5");
}
+ /**
+ * Are stored procedure calls using the stored procedure escape
+ * syntax supported?
+ *
+ * @return true if so; false otherwise
+ * @exception SQLException - if a database access error occurs
+ */
public boolean supportsStoredProcedures() throws SQLException
{
- // XXX-Not Implemented
return false;
}
+ /**
+ * Are subqueries in comparison expressions supported? A JDBC
+ * Compliant driver always returns true.
+ *
+ * @return true if so; false otherwise
+ * @exception SQLException - if a database access error occurs
+ */
public boolean supportsSubqueriesInComparisons() throws SQLException
{
- // XXX-Not Implemented
- return false;
+ return true;
}
+ /**
+ * Are subqueries in 'exists' expressions supported? A JDBC
+ * Compliant driver always returns true.
+ *
+ * @return true if so; false otherwise
+ * @exception SQLException - if a database access error occurs
+ */
public boolean supportsSubqueriesInExists() throws SQLException
{
- // XXX-Not Implemented
- return false;
+ return true;
}
+ /**
+ * Are subqueries in 'in' statements supported? A JDBC
+ * Compliant driver always returns true.
+ *
+ * @return true if so; false otherwise
+ * @exception SQLException - if a database access error occurs
+ */
public boolean supportsSubqueriesInIns() throws SQLException
{
- // XXX-Not Implemented
- return false;
+ return true;
}
+ /**
+ * Are subqueries in quantified expressions supported? A JDBC
+ * Compliant driver always returns true.
+ *
+ * (No idea what this is, but we support a good deal of
+ * subquerying.)
+ *
+ * @return true if so; false otherwise
+ * @exception SQLException - if a database access error occurs
+ */
public boolean supportsSubqueriesInQuantifieds() throws SQLException
{
- // XXX-Not Implemented
- return false;
+ return true;
}
+ /**
+ * Are correlated subqueries supported? A JDBC Compliant driver
+ * always returns true.
+ *
+ * (a.k.a. subselect in from?)
+ *
+ * @return true if so; false otherwise
+ * @exception SQLException - if a database access error occurs
+ */
public boolean supportsCorrelatedSubqueries() throws SQLException
{
- // XXX-Not Implemented
- return false;
+ return haveMinimumServerVersion("7.1");
}
/**
- * Is SQL UNION supported? Nope.
+ * Is SQL UNION supported?
*
* @return true if so
* @exception SQLException if a database access error occurs
*/
public boolean supportsUnion() throws SQLException
{
- return true; // 7.0?
+ return true; // since 6.3
}
/**
- * Is SQL UNION ALL supported? Nope.
+ * Is SQL UNION ALL supported?
*
* @return true if so
* @exception SQLException if a database access error occurs
*/
public boolean supportsUnionAll() throws SQLException
{
- return false;
+ return haveMinimumServerVersion("7.1");
}
/**
*/
public int getMaxBinaryLiteralLength() throws SQLException
{
- return 0; // For now...
+ return 0; // no limit
}
/**
*/
public int getMaxCharLiteralLength() throws SQLException
{
- return 65535;
+ return 0; // no limit
}
/**
*/
public int getMaxColumnsInGroupBy() throws SQLException
{
- return getMaxColumnsInTable();
+ return 0; // no limit
}
/**
/**
* What's the maximum number of columns in an "ORDER BY clause?
- * Theoretically, all of them!
*
* @return the max columns
* @exception SQLException if a database access error occurs
*/
public int getMaxColumnsInOrderBy() throws SQLException
{
- return getMaxColumnsInTable();
+ return 0; // no limit
}
/**
* What is the maximum number of columns in a "SELECT" list?
- * Theoretically, all of them!
*
* @return the max columns
* @exception SQLException if a database access error occurs
*/
public int getMaxColumnsInSelect() throws SQLException
{
- return getMaxColumnsInTable();
+ return 0; // no limit
}
/**
}
/**
- * What is the maximum length of an index (in bytes)? Now, does
- * the spec. mean name of an index (in which case its 32, the
- * same as a table) or does it mean length of an index element
- * (in which case its 8192, the size of a row) or does it mean
- * the number of rows it can access (in which case it 2^32 -
- * a 4 byte OID number)? I think its the length of an index
- * element, personally, so Im setting it to 8192.
+ * Retrieves the maximum number of bytes for an index, including all
+ * of the parts of the index.
*
- * @return max index length in bytes
+ * @return max index length in bytes, which includes the composite
+ * of all the constituent parts of the index; a result of zero means
+ * that there is no limit or the limit is not known
* @exception SQLException if a database access error occurs
*/
public int getMaxIndexLength() throws SQLException
{
- return 65535;
+ return 0; // no limit (larger than an int anyway)
}
public int getMaxSchemaNameLength() throws SQLException
}
/**
- * What is the maximum length of a single row? (not including
- * blobs). 65535 is defined in PostgreSQL.
+ * What is the maximum length of a single row?
*
* @return max row size in bytes
* @exception SQLException if a database access error occurs
*/
public int getMaxRowSize() throws SQLException
{
- return 65535;
+ if (haveMinimumServerVersion("7.1"))
+ return 1073741824; // 1 GB
+ else
+ return 8192; // XXX could be altered
}
/**
*/
public int getMaxStatementLength() throws SQLException
{
- return 65535;
+ if (haveMinimumServerVersion("7.0"))
+ return 0; // actually whatever fits in size_t
+ else
+ return 16384;
}
/**
/**
* What is the maximum number of tables that can be specified
- * in a SELECT? Theoretically, this is the same number as the
- * number of tables allowable. In practice tho, it is much smaller
- * since the number of tables is limited by the statement, we
- * return 1024 here - this is just a number I came up with (being
- * the number of tables roughly of three characters each that you
- * can fit inside a 8192 character buffer with comma separators).
+ * in a SELECT?
*
* @return the maximum
* @exception SQLException if a database access error occurs
*/
public int getMaxTablesInSelect() throws SQLException
{
- return 1024;
+ return 0; // no limit
}
/**
/**
* Are both data definition and data manipulation transactions
- * supported? I checked it, and could not do a CREATE TABLE
- * within a transaction, so I am assuming that we don't
+ * supported?
*
* @return true if so
* @exception SQLException if a database access error occurs
*/
public boolean supportsDataDefinitionAndDataManipulationTransactions() throws SQLException
{
- return false;
+ return true;
}
/**
*/
public boolean supportsDataManipulationTransactionsOnly() throws SQLException
{
- return true;
+ return false;
}
/**
return new ResultSet(connection, f, v, "OK", 1);
}
+
// ** JDBC 2 Extensions **
/**
- * New in 7.1 - we don't support deletes so this must be false!
+ * Does the database support the given result set type?
+ *
+ * @param type - defined in java.sql.ResultSet
+ * @return true if so; false otherwise
+ * @exception SQLException - if a database access error occurs
*/
- public boolean deletesAreDetected(int i) throws SQLException
+ public boolean supportsResultSetType(int type) throws SQLException
{
- return false;
+ // The only type we don't support
+ return type != java.sql.ResultSet.TYPE_SCROLL_SENSITIVE;
}
+
/**
- * New in 7.1 - we don't support deletes so this must be false!
- */
- public boolean othersDeletesAreVisible(int i) throws SQLException
+ * Does the database support the concurrency type in combination
+ * with the given result set type?
+ *
+ * @param type - defined in java.sql.ResultSet
+ * @param concurrency - type defined in java.sql.ResultSet
+ * @return true if so; false otherwise
+ * @exception SQLException - if a database access error occurs
+ */
+ public boolean supportsResultSetConcurrency(int type,int concurrency) throws SQLException
{
- return false;
- }
+ // These combinations are not supported!
+ if(type == java.sql.ResultSet.TYPE_SCROLL_SENSITIVE)
+ return false;
- public java.sql.Connection getConnection() throws SQLException
- {
- return (java.sql.Connection)connection;
- }
+ // We don't yet support Updateable ResultSets
+ if(concurrency == java.sql.ResultSet.CONCUR_UPDATABLE)
+ return false;
- /**
- * Return user defined types in a schema
- */
- public java.sql.ResultSet getUDTs(String catalog,
- String schemaPattern,
- String typeNamePattern,
- int[] types
- ) throws SQLException
- {
- throw org.postgresql.Driver.notImplemented();
+ // Everything else we do
+ return true;
}
- /**
- * New in 7.1 - we don't support visible inserts so this must be false!
- */
- public boolean othersInsertsAreVisible(int type) throws SQLException
+
+ /* lots of unsupported stuff... */
+ public boolean ownUpdatesAreVisible(int type) throws SQLException
{
return false;
}
- /**
- * New in 7.1 - we don't support visible updates so this must be false!
- */
- public boolean updatesAreDetected(int type) throws SQLException
+ public boolean ownDeletesAreVisible(int type) throws SQLException
{
return false;
}
- /**
- * New in 7.1 - we don't support visible updates so this must be false!
- */
- public boolean othersUpdatesAreVisible(int type) throws SQLException
+ public boolean ownInsertsAreVisible(int type) throws SQLException
{
return false;
}
- public boolean ownUpdatesAreVisible(int type) throws SQLException
+ public boolean othersUpdatesAreVisible(int type) throws SQLException
{
return false;
}
- public boolean ownInsertsAreVisible(int type) throws SQLException
+ public boolean othersDeletesAreVisible(int i) throws SQLException
{
return false;
}
- public boolean insertsAreDetected(int type) throws SQLException
+ public boolean othersInsertsAreVisible(int type) throws SQLException
{
return false;
}
- public boolean ownDeletesAreVisible(int type) throws SQLException
+ public boolean updatesAreDetected(int type) throws SQLException
{
return false;
}
- public boolean rowChangesAreDetected(int type) throws SQLException
+ public boolean deletesAreDetected(int i) throws SQLException
{
return false;
}
- public boolean rowChangesAreVisible(int type) throws SQLException
+ public boolean insertsAreDetected(int type) throws SQLException
{
return false;
}
}
/**
- * New in 7.1
+ * Return user defined types in a schema
*/
- public boolean supportsResultSetConcurrency(int type,int concurrency) throws SQLException
+ public java.sql.ResultSet getUDTs(String catalog,
+ String schemaPattern,
+ String typeNamePattern,
+ int[] types
+ ) throws SQLException
{
- // These combinations are not supported!
- if(type==java.sql.ResultSet.TYPE_SCROLL_SENSITIVE)
- return false;
+ throw org.postgresql.Driver.notImplemented();
+ }
- // We don't yet support Updateable ResultSets
- if(concurrency==java.sql.ResultSet.CONCUR_UPDATABLE)
- return false;
- // Everything else we do
- return true;
+ /**
+ * Retrieves the connection that produced this metadata object.
+ *
+ * @return the connection that produced this metadata object
+ */
+ public java.sql.Connection getConnection() throws SQLException
+ {
+ return (java.sql.Connection)connection;
}
- public boolean supportsResultSetType(int type) throws SQLException
+ /* I don't find these in the spec!?! */
+
+ public boolean rowChangesAreDetected(int type) throws SQLException
{
- // The only type we don't support
- return type!=java.sql.ResultSet.TYPE_SCROLL_SENSITIVE;
+ return false;
}
+ public boolean rowChangesAreVisible(int type) throws SQLException
+ {
+ return false;
+ }
}