diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.java b/src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.java index 95ec50f8166..dc685dca818 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc1/DatabaseMetaData.java @@ -13,7 +13,7 @@ import org.postgresql.Field; * This class provides information about the database as a whole. * *
Many of the methods here return lists of information in ResultSets. You - * can use the normal ResultSet methods such as getString and getInt to + * can use the normal ResultSet methods such as getString and getInt to * retrieve the data from these ResultSets. If a given form of metadata is * not available, these methods should throw a SQLException. * @@ -32,25 +32,25 @@ import org.postgresql.Field; * * @see java.sql.DatabaseMetaData */ -public class DatabaseMetaData implements java.sql.DatabaseMetaData +public class DatabaseMetaData implements java.sql.DatabaseMetaData { Connection connection; // The connection association - + // These define various OID's. Hopefully they will stay constant. static final int iVarcharOid = 1043; // OID for varchar static final int iBoolOid = 16; // OID for bool static final int iInt2Oid = 21; // OID for int2 static final int iInt4Oid = 23; // OID for int4 static final int VARHDRSZ = 4; // length for int4 - + // This is a default value for remarks private static final byte defaultRemarks[]="no remarks".getBytes(); - + public DatabaseMetaData(Connection conn) { this.connection = conn; } - + /** * Can all the procedures returned by getProcedures be called * by the current user? @@ -62,7 +62,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return true; // For now... } - + /** * Can all the tables returned by getTable be SELECTed by * the current user? @@ -74,7 +74,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return true; // For now... } - + /** * What is the URL for this database? * @@ -85,7 +85,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return connection.getURL(); } - + /** * What is our user name as known to the database? * @@ -96,7 +96,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return connection.getUserName(); } - + /** * Is the database in read-only mode? * @@ -107,7 +107,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return connection.isReadOnly(); } - + /** * Are NULL values sorted high? * @@ -118,7 +118,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return false; } - + /** * Are NULL values sorted low? * @@ -129,7 +129,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return false; } - + /** * Are NULL values sorted at the start regardless of sort order? * @@ -140,7 +140,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return false; } - + /** * Are NULL values sorted at the end regardless of sort order? * @@ -151,7 +151,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return true; } - + /** * What is the name of this database product - we hope that it is * PostgreSQL, so we return that explicitly. @@ -163,7 +163,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return "PostgreSQL"; } - + /** * What is the version of this database product. * @@ -181,7 +181,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData return versionNumber; } - + /** * What is the name of this JDBC driver? If we don't know this * we are doing something wrong! @@ -193,7 +193,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return "PostgreSQL Native Driver"; } - + /** * What is the version string of this JDBC driver? Again, this is * static. @@ -205,7 +205,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return connection.this_driver.getVersion(); } - + /** * What is this JDBC driver's major version number? * @@ -215,7 +215,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return connection.this_driver.getMajorVersion(); } - + /** * What is this JDBC driver's minor version number? * @@ -225,11 +225,11 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return connection.this_driver.getMinorVersion(); } - + /** * Does the database store tables in a local file? No - it * stores them in a file on the server. - * + * * @return true if so * @exception SQLException if a database access error occurs */ @@ -237,10 +237,10 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return false; } - + /** * Does the database use a file for each table? Well, not really, - * since it doesnt use local files. + * since it doesnt use local files. * * @return true if so * @exception SQLException if a database access error occurs @@ -249,7 +249,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return false; } - + /** * Does the database treat mixed case unquoted SQL identifiers * as case sensitive and as a result store them in mixed case? @@ -266,7 +266,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return false; } - + /** * Does the database treat mixed case unquoted SQL identifiers as * case insensitive and store them in upper case? @@ -277,7 +277,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return false; } - + /** * Does the database treat mixed case unquoted SQL identifiers as * case insensitive and store them in lower case? @@ -288,7 +288,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return true; } - + /** * Does the database treat mixed case unquoted SQL identifiers as * case insensitive and store them in mixed case? @@ -299,11 +299,11 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return false; } - + /** * Does the database treat mixed case quoted SQL identifiers as * case sensitive and as a result store them in mixed case? A - * JDBC compliant driver will always return true. + * 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 @@ -316,7 +316,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return true; } - + /** * Does the database treat mixed case quoted SQL identifiers as * case insensitive and store them in upper case? @@ -327,7 +327,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return false; } - + /** * Does the database treat mixed case quoted SQL identifiers as case * insensitive and store them in lower case? @@ -338,7 +338,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return false; } - + /** * Does the database treat mixed case quoted SQL identifiers as case * insensitive and store them in mixed case? @@ -349,7 +349,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return false; } - + /** * What is the string used to quote SQL identifiers? This returns * a space if identifier quoting isn't supported. A JDBC Compliant @@ -365,7 +365,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return "\""; } - + /** * Get a comma separated list of all a database's SQL keywords that * are NOT also SQL92 keywords. @@ -386,31 +386,31 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return "abort,acl,add,aggregate,append,archive,arch_store,backward,binary,change,cluster,copy,database,delimiters,do,extend,explain,forward,heavy,index,inherits,isnull,light,listen,load,merge,nothing,notify,notnull,oids,purge,rename,replace,retrieve,returns,rule,recipe,setof,stdin,stdout,store,vacuum,verbose,version"; } - + public String getNumericFunctions() throws SQLException { // XXX-Not Implemented return ""; } - + public String getStringFunctions() throws SQLException { // XXX-Not Implemented return ""; } - + public String getSystemFunctions() throws SQLException { // XXX-Not Implemented return ""; } - + public String getTimeDateFunctions() throws SQLException { // XXX-Not Implemented return ""; } - + /** * This is the string that can be used to escape '_' and '%' in * a search string pattern style catalog search parameters @@ -422,9 +422,9 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return "\\"; } - + /** - * Get all the "extra" characters that can bew used in unquoted + * Get all the "extra" characters that can be used in unquoted * identifier names (those beyond a-zA-Z0-9 and _) * *
From the file src/backend/parser/scan.l, an identifier is
@@ -438,7 +438,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return "";
}
-
+
/**
* Is "ALTER TABLE" with an add column supported?
* Yes for PostgreSQL 6.1
@@ -450,7 +450,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return true;
}
-
+
/**
* Is "ALTER TABLE" with a drop column supported?
* Peter 10/10/2000 This was set to true, but 7.1devel doesn't support it!
@@ -462,7 +462,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* Is column aliasing supported?
*
@@ -485,7 +485,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return true;
}
-
+
/**
* Are concatenations between NULL and non-NULL values NULL? A
* JDBC Compliant driver always returns true
@@ -497,34 +497,34 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return true;
}
-
+
public boolean supportsConvert() throws SQLException
{
// XXX-Not Implemented
return false;
}
-
+
public boolean supportsConvert(int fromType, int toType) throws SQLException
{
// XXX-Not Implemented
return false;
}
-
+
public boolean supportsTableCorrelationNames() throws SQLException
{
// XXX-Not Implemented
return false;
}
-
+
public boolean supportsDifferentTableCorrelationNames() throws SQLException
{
// XXX-Not Implemented
return false;
}
-
+
/**
- * Are expressions in "ORCER BY" lists supported?
- *
+ * Are expressions in "ORDER BY" lists supported?
+ *
*
e.g. select * from t order by a + b;
*
* @return true if so
@@ -534,7 +534,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return true;
}
-
+
/**
* Can an "ORDER BY" clause use columns not in the SELECT?
* I checked it, and you can't.
@@ -546,7 +546,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* Is some form of "GROUP BY" clause supported?
* I checked it, and yes it is.
@@ -558,7 +558,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return true;
}
-
+
/**
* Can a "GROUP BY" clause use columns not in the SELECT?
* I checked it - it seems to allow it
@@ -570,7 +570,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return true;
}
-
+
/**
* Can a "GROUP BY" clause add columns not in the SELECT provided
* it specifies all the columns in the SELECT? Does anyone actually
@@ -583,7 +583,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return true; // For now...
}
-
+
/**
* Is the escape character in "LIKE" clauses supported? A
* JDBC compliant driver always returns true.
@@ -595,12 +595,12 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return true;
}
-
+
/**
* Are multiple ResultSets from a single execute supported?
* Well, I implemented it, but I dont think this is possible from
* the back ends point of view.
- *
+ *
* @return true if so
* @exception SQLException if a database access error occurs
*/
@@ -608,7 +608,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* Can we have multiple transactions open at once (on different
* connections?)
@@ -621,7 +621,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return true;
}
-
+
/**
* Can columns be defined as non-nullable. A JDBC Compliant driver
* always returns true.
@@ -636,7 +636,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return true;
}
-
+
/**
* Does this driver support the minimum ODBC SQL grammar. This
* grammar is defined at:
@@ -653,7 +653,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return true;
}
-
+
/**
* Does this driver support the Core ODBC SQL grammar. We need
* SQL-92 conformance for this.
@@ -665,7 +665,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* Does this driver support the Extended (Level 2) ODBC SQL
* grammar. We don't conform to the Core (Level 1), so we can't
@@ -678,7 +678,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* Does this driver support the ANSI-92 entry level SQL grammar?
* All JDBC Compliant drivers must return true. I think we have
@@ -691,7 +691,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* Does this driver support the ANSI-92 intermediate level SQL
* grammar? Anyone who does not support Entry level cannot support
@@ -704,7 +704,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* Does this driver support the ANSI-92 full SQL grammar?
*
@@ -715,11 +715,11 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* Is the SQL Integrity Enhancement Facility supported?
* I haven't seen this mentioned anywhere, so I guess not
- *
+ *
* @return true if so
* @exception SQLException if a database access error occurs
*/
@@ -727,7 +727,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* Is some form of outer join supported? From my knowledge, nope.
*
@@ -736,9 +736,9 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
*/
public boolean supportsOuterJoins() throws SQLException
{
- return false;
+ return true; // yes 7.1 does
}
-
+
/**
* Are full nexted outer joins supported? Well, we dont support any
* form of outer join, so this is no as well
@@ -748,9 +748,9 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
*/
public boolean supportsFullOuterJoins() throws SQLException
{
- return false;
+ return true; // yes in 7.1
}
-
+
/**
* Is there limited support for outer joins? (This will be true if
* supportFullOuterJoins is true)
@@ -760,9 +760,9 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
*/
public boolean supportsLimitedOuterJoins() throws SQLException
{
- return false;
+ return true; // yes in 7.1
}
-
+
/**
* What is the database vendor's preferred term for "schema" - well,
* we do not provide support for schemas, so lets just use that
@@ -775,9 +775,9 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return "Schema";
}
-
+
/**
- * What is the database vendor's preferred term for "procedure" -
+ * What is the database vendor's preferred term for "procedure" -
* I kind of like "Procedure" myself.
*
* @return the vendor term
@@ -787,7 +787,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return "Procedure";
}
-
+
/**
* What is the database vendor's preferred term for "catalog"? -
* we dont have a preferred term, so just use Catalog
@@ -799,7 +799,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return "Catalog";
}
-
+
/**
* Does a catalog appear at the start of a qualified table name?
* (Otherwise it appears at the end).
@@ -811,7 +811,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* What is the Catalog separator. Hmmm....well, I kind of like
* a period (so we get catalog.table definitions). - I don't think
@@ -825,7 +825,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
// PM Sep 29 97 - changed from "." as we don't support catalogs.
return "";
}
-
+
/**
* Can a schema name be used in a data manipulation statement? Nope.
*
@@ -836,7 +836,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* Can a schema name be used in a procedure call statement? Nope.
*
@@ -847,7 +847,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* Can a schema be used in a table definition statement? Nope.
*
@@ -858,7 +858,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* Can a schema name be used in an index definition statement?
*
@@ -869,7 +869,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* Can a schema name be used in a privilege definition statement?
*
@@ -880,7 +880,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* Can a catalog name be used in a data manipulation statement?
*
@@ -891,7 +891,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* Can a catalog name be used in a procedure call statement?
*
@@ -902,7 +902,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* Can a catalog name be used in a table definition statement?
*
@@ -913,7 +913,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* Can a catalog name be used in an index definition?
*
@@ -924,7 +924,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* Can a catalog name be used in a privilege definition statement?
*
@@ -935,7 +935,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* We support cursors for gets only it seems. I dont see a method
* to get a positioned delete.
@@ -947,10 +947,10 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false; // For now...
}
-
+
/**
* Is positioned UPDATE supported?
- *
+ *
* @return true if so
* @exception SQLException if a database access error occurs
*/
@@ -958,49 +958,49 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false; // For now...
}
-
+
public boolean supportsSelectForUpdate() throws SQLException
{
// XXX-Not Implemented
return false;
}
-
+
public boolean supportsStoredProcedures() throws SQLException
{
// XXX-Not Implemented
return false;
}
-
+
public boolean supportsSubqueriesInComparisons() throws SQLException
{
// XXX-Not Implemented
return false;
}
-
+
public boolean supportsSubqueriesInExists() throws SQLException
{
// XXX-Not Implemented
return false;
}
-
+
public boolean supportsSubqueriesInIns() throws SQLException
{
// XXX-Not Implemented
return false;
}
-
+
public boolean supportsSubqueriesInQuantifieds() throws SQLException
{
// XXX-Not Implemented
return false;
}
-
+
public boolean supportsCorrelatedSubqueries() throws SQLException
{
// XXX-Not Implemented
return false;
}
-
+
/**
* Is SQL UNION supported? Nope.
*
@@ -1009,9 +1009,9 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
*/
public boolean supportsUnion() throws SQLException
{
- return false;
+ return true; // 7.0?
}
-
+
/**
* Is SQL UNION ALL supported? Nope.
*
@@ -1022,7 +1022,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* In PostgreSQL, Cursors are only open within transactions.
*
@@ -1033,7 +1033,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* Do we support open cursors across multiple transactions?
*
@@ -1044,7 +1044,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* Can statements remain open across commits? They may, but
* this driver cannot guarentee that. In further reflection.
@@ -1058,7 +1058,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return true;
}
-
+
/**
* Can statements remain open across rollbacks? They may, but
* this driver cannot guarentee that. In further contemplation,
@@ -1072,7 +1072,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return true;
}
-
+
/**
* How many hex characters can you have in an inline binary literal
*
@@ -1083,7 +1083,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return 0; // For now...
}
-
+
/**
* What is the maximum length for a character literal
* I suppose it is 8190 (8192 - 2 for the quotes)
@@ -1095,7 +1095,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return 65535;
}
-
+
/**
* Whats the limit on column name length. The description of
* pg_class would say '32' (length of pg_class.relname) - we
@@ -1108,18 +1108,18 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return 32;
}
-
+
/**
* What is the maximum number of columns in a "GROUP BY" clause?
*
* @return the max number of columns
- * @exception SQLException if a database access error occurs
+ * @exception SQLException if a database access error occurs
*/
public int getMaxColumnsInGroupBy() throws SQLException
{
return getMaxColumnsInTable();
}
-
+
/**
* What's the maximum number of columns allowed in an index?
* 6.0 only allowed one column, but 6.1 introduced multi-column
@@ -1132,7 +1132,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return getMaxColumnsInTable();
}
-
+
/**
* What's the maximum number of columns in an "ORDER BY clause?
* Theoretically, all of them!
@@ -1144,7 +1144,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return getMaxColumnsInTable();
}
-
+
/**
* What is the maximum number of columns in a "SELECT" list?
* Theoretically, all of them!
@@ -1156,7 +1156,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return getMaxColumnsInTable();
}
-
+
/**
* What is the maximum number of columns in a table? From the
* create_table(l) manual page...
@@ -1173,7 +1173,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return 1600;
}
-
+
/**
* How many active connection can we have at a time to this
* database? Well, since it depends on postmaster, which just
@@ -1190,7 +1190,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return 8192;
}
-
+
/**
* What is the maximum cursor name length (the same as all
* the other F***** identifiers!)
@@ -1202,13 +1202,13 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return 32;
}
-
+
/**
* 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
+ * 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 -
+ * 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.
*
@@ -1219,13 +1219,13 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return 65535;
}
-
+
public int getMaxSchemaNameLength() throws SQLException
{
// XXX-Not Implemented
return 0;
}
-
+
/**
* What is the maximum length of a procedure name?
* (length of pg_proc.proname used) - again, I really
@@ -1238,13 +1238,13 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return 32;
}
-
+
public int getMaxCatalogNameLength() throws SQLException
{
// XXX-Not Implemented
return 0;
}
-
+
/**
* What is the maximum length of a single row? (not including
* blobs). 65535 is defined in PostgreSQL.
@@ -1256,7 +1256,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return 65535;
}
-
+
/**
* Did getMaxRowSize() include LONGVARCHAR and LONGVARBINARY
* blobs? We don't handle blobs yet
@@ -1268,7 +1268,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* What is the maximum length of a SQL statement?
*
@@ -1279,7 +1279,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return 65535;
}
-
+
/**
* How many active statements can we have open at one time to
* this database? Basically, since each Statement downloads
@@ -1295,7 +1295,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return 1;
}
-
+
/**
* What is the maximum length of a table name? This was found
* from pg_class.relname length
@@ -1307,7 +1307,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return 32;
}
-
+
/**
* What is the maximum number of tables that can be specified
* in a SELECT? Theoretically, this is the same number as the
@@ -1324,7 +1324,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return 1024;
}
-
+
/**
* What is the maximum length of a user name? Well, we generally
* use UNIX like user names in PostgreSQL, so I think this would
@@ -1338,8 +1338,8 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return 32;
}
-
-
+
+
/**
* What is the database's default transaction isolation level? We
* do not support this, so all transactions are SERIALIZABLE.
@@ -1350,13 +1350,13 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
*/
public int getDefaultTransactionIsolation() throws SQLException
{
- return Connection.TRANSACTION_READ_COMMITTED;
+ return Connection.TRANSACTION_READ_COMMITTED;
}
-
+
/**
* Are transactions supported? If not, commit and rollback are noops
* and the isolation level is TRANSACTION_NONE. We do support
- * transactions.
+ * transactions.
*
* @return true if transactions are supported
* @exception SQLException if a database access error occurs
@@ -1365,11 +1365,11 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return true;
}
-
+
/**
* Does the database support the given transaction isolation level?
* We only support TRANSACTION_SERIALIZABLE and TRANSACTION_READ_COMMITTED
- *
+ *
* @param level the values are defined in java.sql.Connection
* @return true if so
* @exception SQLException if a database access error occurs
@@ -1377,15 +1377,15 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
*/
public boolean supportsTransactionIsolationLevel(int level) throws SQLException
{
- if (level == Connection.TRANSACTION_SERIALIZABLE ||
- level == Connection.TRANSACTION_READ_COMMITTED)
- return true;
- else
- return false;
+ if (level == Connection.TRANSACTION_SERIALIZABLE ||
+ level == Connection.TRANSACTION_READ_COMMITTED)
+ return true;
+ else
+ return false;
}
-
+
/**
- * Are both data definition and data manipulation transactions
+ * 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
*
@@ -1396,7 +1396,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return false;
}
-
+
/**
* Are only data manipulation statements withing a transaction
* supported?
@@ -1408,7 +1408,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
{
return true;
}
-
+
/**
* Does a data definition statement within a transaction force
* the transaction to commit? I think this means something like:
@@ -1423,7 +1423,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData
* COMMIT;
*
* - * does the CREATE TABLE call cause a commit? The answer is no. + * does the CREATE TABLE call cause a commit? The answer is no. * * @return true if so * @exception SQLException if a database access error occurs @@ -1432,7 +1432,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return false; } - + /** * Is a data definition statement within a transaction ignored? * It seems to be (from experiment in previous method) @@ -1444,10 +1444,10 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData { return true; } - + /** * 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 @@ -1483,42 +1483,42 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData Field f[] = new Field[8]; java.sql.ResultSet r; // ResultSet for the SQL query that we need to do Vector v = new Vector(); // The new ResultSet tuple stuff - + byte remarks[] = defaultRemarks; - + f[0] = new Field(connection, "PROCEDURE_CAT", iVarcharOid, 32); f[1] = new Field(connection, "PROCEDURE_SCHEM", iVarcharOid, 32); f[2] = new Field(connection, "PROCEDURE_NAME", iVarcharOid, 32); f[3] = f[4] = f[5] = new Field(connection,"reserved",iVarcharOid,32); // null; // reserved, must be null for now f[6] = new Field(connection, "REMARKS", iVarcharOid, 8192); f[7] = new Field(connection, "PROCEDURE_TYPE", iInt2Oid, 2); - + // If the pattern is null, then set it to the default if(procedureNamePattern==null) procedureNamePattern="%"; - + r = connection.ExecSQL("select proname, proretset from pg_proc where proname like '"+procedureNamePattern.toLowerCase()+"' order by proname"); - + while (r.next()) { byte[][] tuple = new byte[8][0]; - + tuple[0] = null; // Catalog name tuple[1] = null; // Schema name tuple[2] = r.getBytes(1); // Procedure name tuple[3] = tuple[4] = tuple[5] = null; // Reserved tuple[6] = remarks; // Remarks - + if (r.getBoolean(2)) tuple[7] = Integer.toString(java.sql.DatabaseMetaData.procedureReturnsResult).getBytes(); else tuple[7] = Integer.toString(java.sql.DatabaseMetaData.procedureNoResult).getBytes(); - + v.addElement(tuple); } return new ResultSet(connection, f, v, "OK", 1); } - + /** * Get a description of a catalog's stored procedure parameters * and result columns. @@ -1529,7 +1529,7 @@ public class DatabaseMetaData implements java.sql.DatabaseMetaData * 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 or column + *
Each row in the ResultSet is a parameter description or column * description with the following fields: *
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_TYPE, TABLE_SCHEM and TABLE_NAME. + * + *
Each table description has the following columns: * *