0001: package com.quadcap.jdbc;
0002:
0003: /* Copyright 1999 - 2003 Quadcap Software. All rights reserved.
0004: *
0005: * This software is distributed under the Quadcap Free Software License.
0006: * This software may be used or modified for any purpose, personal or
0007: * commercial. Open Source redistributions are permitted. Commercial
0008: * redistribution of larger works derived from, or works which bundle
0009: * this software requires a "Commercial Redistribution License"; see
0010: * http://www.quadcap.com/purchase.
0011: *
0012: * Redistributions qualify as "Open Source" under one of the following terms:
0013: *
0014: * Redistributions are made at no charge beyond the reasonable cost of
0015: * materials and delivery.
0016: *
0017: * Redistributions are accompanied by a copy of the Source Code or by an
0018: * irrevocable offer to provide a copy of the Source Code for up to three
0019: * years at the cost of materials and delivery. Such redistributions
0020: * must allow further use, modification, and redistribution of the Source
0021: * Code under substantially the same terms as this license.
0022: *
0023: * Redistributions of source code must retain the copyright notices as they
0024: * appear in each source code file, these license terms, and the
0025: * disclaimer/limitation of liability set forth as paragraph 6 below.
0026: *
0027: * Redistributions in binary form must reproduce this Copyright Notice,
0028: * these license terms, and the disclaimer/limitation of liability set
0029: * forth as paragraph 6 below, in the documentation and/or other materials
0030: * provided with the distribution.
0031: *
0032: * The Software is provided on an "AS IS" basis. No warranty is
0033: * provided that the Software is free of defects, or fit for a
0034: * particular purpose.
0035: *
0036: * Limitation of Liability. Quadcap Software shall not be liable
0037: * for any damages suffered by the Licensee or any third party resulting
0038: * from use of the Software.
0039: */
0040:
0041: import java.io.IOException;
0042:
0043: import java.sql.SQLException;
0044:
0045: import com.quadcap.sql.Database;
0046: import com.quadcap.sql.Expression;
0047: import com.quadcap.sql.Session;
0048: import com.quadcap.sql.SQLParser;
0049: import com.quadcap.sql.Version;
0050:
0051: import com.quadcap.sql.types.ValuePattern;
0052:
0053: import com.quadcap.sql.meta.MetaBestRowId;
0054: import com.quadcap.sql.meta.MetaColumns;
0055: import com.quadcap.sql.meta.MetaCrossReference;
0056: import com.quadcap.sql.meta.MetaCursor;
0057: import com.quadcap.sql.meta.MetaIndexInfo;
0058: import com.quadcap.sql.meta.MetaPrimaryKeys;
0059: import com.quadcap.sql.meta.MetaTableTypes;
0060: import com.quadcap.sql.meta.MetaTables;
0061: import com.quadcap.sql.meta.MetaTypes;
0062:
0063: /**
0064: * This class implements the <code>java.sql.DatabaseMetaData</code> interface,
0065: * which provides a way for the JDBC application to determine which features
0066: * a database supports and also a way to explore the database schema, through
0067: * information analagous to the SQL "INFORMATION_SCHEMA".
0068: *
0069: * @author Stan Bailes
0070: */
0071: public class DatabaseMetaData implements java.sql.DatabaseMetaData {
0072: Database database;
0073: com.quadcap.sql.Connection qConn;
0074: Session session;
0075: Connection connection;
0076:
0077: DatabaseMetaData(Connection connection) throws IOException,
0078: SQLException {
0079: this .connection = connection;
0080: this .qConn = connection.getConnection();
0081: this .session = qConn.createSession();
0082: this .database = connection.getDatabase();
0083: }
0084:
0085: /**
0086: * Return true if the current user has the privileges necessary to
0087: * invoke all procedures returned by <code>getProcedures()</code>.
0088: * Since QED doesn't support access privileges,
0089: * this function always returns false, though since it doesn't support
0090: * stored procedures, this isn't likely to matter.
0091: *
0092: * @return true
0093: */
0094: public boolean allProceduresAreCallable() {
0095: return true;
0096: }
0097:
0098: /**
0099: * Return true if the current user can use a <code>SELECT</code>
0100: * statement with all tables returned by <code>getTables()</code>.
0101: * Since QED doesn't support access privileges, this function always
0102: * returns true.
0103: *
0104: * @return true
0105: */
0106: public boolean allTablesAreSelectable() {
0107: return true;
0108: }
0109:
0110: /**
0111: * A data definition statement within a transaction does not force
0112: * a commit in QED.
0113: *
0114: * @return false
0115: */
0116: public boolean dataDefinitionCausesTransactionCommit() {
0117: return false;
0118: }
0119:
0120: /**
0121: * Data definition statements within transactions are not ignored
0122: * in QED.
0123: *
0124: * @return false
0125: */
0126: public boolean dataDefinitionIgnoredInTransactions() {
0127: return false;
0128: }
0129:
0130: /**
0131: * For all types of ResultSets, deleted rows are simply removed
0132: * from the ResultSet, so this function always returns false.
0133: *
0134: * @return false
0135: */
0136: public boolean deletesAreDetected(int type) {
0137: return false;
0138: }
0139:
0140: /**
0141: * QED doesn't impose any maximum row size, so this function is
0142: * really a don't care, but we return true anyway.
0143: *
0144: * @return true
0145: */
0146: public boolean doesMaxRowSizeIncludeBlobs() {
0147: return true;
0148: }
0149:
0150: /**
0151: * Return a resultset containing the set of columns that "best uniquely
0152: * identify a row". In QED, this is interpreted to mean the 'primary key'
0153: * constraint, if specified, otherwise a 'unique' constraint, maybe...
0154: *
0155: * @return the specified ResultSet
0156: * @exception SQLException may be thrown
0157: */
0158: public java.sql.ResultSet getBestRowIdentifier(String catalog,
0159: String schema, String table, int scope, boolean nullable)
0160: throws SQLException {
0161: StringBuffer sb = new StringBuffer();
0162: if (schema != null && schema.trim().length() > 0) {
0163: sb.append(schema.trim());
0164: sb.append('.');
0165: }
0166: if (table != null)
0167: sb.append(table);
0168: MetaBestRowId mt = new MetaBestRowId(session, sb.toString(),
0169: scope, nullable);
0170: return new ResultSet(mt);
0171: }
0172:
0173: /**
0174: * QED doesn't support catalogs, so there is no separator.
0175: *
0176: * @return the empty string
0177: */
0178: public String getCatalogSeparator() {
0179: return "";
0180: }
0181:
0182: /**
0183: * Call it what you like, but QED doesn't support catalogs.
0184: *
0185: * @return "catalog"
0186: */
0187: public String getCatalogTerm() {
0188: return "catalog";
0189: }
0190:
0191: /**
0192: * QED doesn't support catalogs, but we return an empty ResultSet
0193: * of the right signature as a courtesy.
0194: */
0195: public java.sql.ResultSet getCatalogs() throws SQLException {
0196: return new ResultSet(MetaCursor
0197: .find(session, "SYSTEM.CATALOGS"));
0198: }
0199:
0200: /**
0201: * QED doesn't support access controls, but we return an empty ResultSet
0202: * of the right signature as a courtesy.
0203: */
0204: public java.sql.ResultSet getColumnPrivileges(String catalog,
0205: String schema, String table, String columnNamePattern)
0206: throws SQLException {
0207: return new ResultSet(MetaCursor.find(session,
0208: "SYSTEM.COLUMNPRIVILEGES"));
0209: }
0210:
0211: /**
0212: * Helper function to handle a single metadata pattern matcher
0213: */
0214: final void doPattern(StringBuffer sb, String name, String pattern) {
0215: if (pattern != null) {
0216: if (sb.length() > 0) {
0217: sb.append(" and ");
0218: }
0219: sb.append(name);
0220: sb.append(" like '");
0221: sb.append(pattern.toUpperCase());
0222: sb.append('\'');
0223: }
0224: }
0225:
0226: /**
0227: * Helper function to handle a single metadata string specifier
0228: */
0229: final void doString(StringBuffer sb, String name, String val) {
0230: if (val != null) {
0231: if (sb.length() > 0) {
0232: sb.append(" and ");
0233: }
0234: sb.append(name);
0235: sb.append(" = '");
0236: sb.append(val.toUpperCase());
0237: sb.append('\'');
0238: }
0239: }
0240:
0241: /**
0242: * This function returns a <code>ResultSet</code> object containing
0243: * information about the specified columns.
0244: *
0245: * @param catalog not used
0246: * @param schemaPattern a SQL "like" pattern. All schema names matching
0247: * this pattern are selected. If this parameter is the empty
0248: * string, all schemas are selected.
0249: * @param tableNamePattern a SQL "like" pattern. All table names
0250: * matching this pattern are selected.
0251: * @param columnNamePattern a SQL "like" pattern. All column names
0252: * matching this pattern are selected.
0253: * @return a <code>ResultSet</code> object, with each row being a
0254: * description of a table column.<p>
0255: * The columns in the <code>ResultSet</code> object have the
0256: * following definition:
0257: *
0258: * <variablelist>
0259: * <varlistentry><term>1: TABLE_CAT</term>
0260: * <listitem>
0261: * <code>null</code> (Catalogs not supported by QED)</listitem>
0262: * </varlistentry>
0263: * <varlistentry><term>2: TABLE_SCHEM</term>
0264: * <listitem>
0265: * <code>String</code> giving the table's schema</listitem>
0266: * </varlistentry>
0267: * <varlistentry><term>3: TABLE_NAME</term>
0268: * <listitem>
0269: * <code>String</code> giving the table's name</listitem>
0270: * </varlistentry>
0271: * <varlistentry><term>4: COLUMN_NAME</term>
0272: * <listitem>
0273: * <code>String</code> giving the column name</listitem>
0274: * </varlistentry>
0275: * <varlistentry><term>5: DATA_TYPE</term>
0276: * <listitem>
0277: * <code>short</code> type from <code>java.sql.types</code></listitem>
0278: * </varlistentry>
0279: * <varlistentry><term>6: TYPE_NAME</term>
0280: * <listitem>
0281: * <code>String</code> giving the SQL type</listitem>
0282: * </varlistentry>
0283: * <varlistentry><term>7: COLUMN_SIZE</term>
0284: * <listitem>
0285: * <code>int</code> For numeric types, this is the precision;
0286: * for character types, it's the maximum width</listitem>
0287: * </varlistentry>
0288: * <varlistentry><term>8: BUFFER_LENGTH</term>
0289: * <listitem>
0290: * <code>null</code> unused</listitem>
0291: * </varlistentry>
0292: * <varlistentry><term>9: DECIMAL_DIGITS</term>
0293: * <listitem>
0294: * <code>int</code> For numeric types, the number of
0295: * digits to the right of the decimal point.
0296: * For other types, <code>-1</code></listitem>
0297: * </varlistentry>
0298: * <varlistentry><term>10: NUM_PREC_RADIX</term>
0299: * <listitem>
0300: * <code>int</code> 10</listitem>
0301: * </varlistentry>
0302: * <varlistentry><term>11: NULLABLE</term>
0303: * <listitem>
0304: * <code>int</code> One of: <ul>
0305: * <li><code>ResultSetMetaData.columnNoNulls</code></li>
0306: * <li><code>ResultSetMetaData.columnNullable</code></li>
0307: * <li><code>ResultSetMetaData.columnNullableUnknown</code>
0308: * </li></ul></listitem>
0309: * </varlistentry>
0310: * <varlistentry><term>12: REMARKS</term>
0311: * <listitem>
0312: * <code>null</code></listitem>
0313: * </varlistentry>
0314: * <varlistentry><term>13: COLUMN_DEF</term>
0315: * <listitem>
0316: * <code>String</code> The column's default value,
0317: * cast to a <code>String</code>.
0318: * <code>null</code> if the column doesn't have a default value</listitem>
0319: * </varlistentry>
0320: * <varlistentry><term>14: SQL_DATA_TYPE</term>
0321: * <listitem>
0322: * <code>null</code></listitem>
0323: * </varlistentry>
0324: * <varlistentry><term>15: SQL_DATETIME_SUB</term>
0325: * <listitem>
0326: * <code>null</code></listitem>
0327: * </varlistentry>
0328: * <varlistentry><term>16: CHAR_OCTET_LENGTH</term>
0329: * <listitem>
0330: * <code>int</code> For character types,
0331: * two times the maximum number
0332: * of characters in the column.
0333: * <code>null</code> for other types.</listitem>
0334: * </varlistentry>
0335: * <varlistentry><term>17: ORDINAL_POSITION</term>
0336: * <listitem>
0337: * <code>int</code> The index of the column
0338: * in its table.</listitem>
0339: * </varlistentry>
0340: * <varlistentry><term>18: IS_NULLABLE</term>
0341: * <listitem>
0342: * <code>String</code> One of <code>"NO"</code>,
0343: * <code>"YES"</code>, or <code>""</code>
0344: * </listitem>
0345: * </varlistentry>
0346: * </variablelist>
0347: *
0348: * @exception SQLException may be thrown.
0349: */
0350: public java.sql.ResultSet getColumns(String catalog,
0351: String schemaPattern, String tableNamePattern,
0352: String columnNamePattern) throws SQLException {
0353: if (schemaPattern == null || schemaPattern.equals("")) {
0354: schemaPattern = null;
0355: }
0356: StringBuffer sb = new StringBuffer();
0357: doPattern(sb, "TABLE_SCHEM", schemaPattern);
0358: doPattern(sb, "TABLE_NAME", tableNamePattern);
0359: doPattern(sb, "COLUMN_NAME", columnNamePattern);
0360: Expression ex = parseExpression(sb.toString());
0361: MetaColumns mt = new MetaColumns(session, ex);
0362: return new ResultSet(mt);
0363: }
0364:
0365: /**
0366: * Return the <code>Connection</code> object that was used to create this
0367: * <code>DatabaseMetaData</code> object.
0368: *
0369: * @return a Connection object
0370: */
0371: public java.sql.Connection getConnection() {
0372: return connection;
0373: }
0374:
0375: /**
0376: * This function returns a <code>ResultSet</code> object containing
0377: * information about the foreign key relationships in the database.
0378: *
0379: * @param primaryCatalog not used
0380: * @param primarySchema a schema name. Used to specify the schema name
0381: * of the table containing the primary key. <code>null</code>
0382: * specifies all schemas.
0383: * @param foreignCatalog not used
0384: * @param foreignSchema a schema name. Used to specify the schema name
0385: * of the table containing the foreign key. <code>null</code>
0386: * specifies all schemas.
0387: * @param foreignTable the name of the table containing the foreign key.
0388: * @return a <code>ResultSet</code> object, with each row being a
0389: * description of a foreign key column.<p>
0390: * @exception SQLException may be thrown.
0391: *
0392: * The columns in the <code>ResultSet</code> object have the following
0393: * definition:
0394: * <p>
0395: * <variablelist>
0396: * <varlistentry><term>1: PKTABLE_CAT</term>
0397: * <listitem>
0398: * <code>null</code> (Catalogs not supported by QED)</listitem>
0399: * </varlistentry>
0400: * <varlistentry><term>2: PKTABLE_SCHEM</term>
0401: * <listitem>
0402: * <code>String</code> giving the schema of the
0403: * primary key's table.</listitem>
0404: * </varlistentry>
0405: * <varlistentry><term>3: PKTABLE_NAME</term>
0406: * <listitem>
0407: * <code>String</code> giving the name of the
0408: * primary key's table</listitem>
0409: * </varlistentry>
0410: * <varlistentry><term>4: PKCOLUMN_NAME</term>
0411: * <listitem>
0412: * <code>String</code> giving the column name
0413: * of the primary key</listitem>
0414: * </varlistentry>
0415: * <varlistentry><term>5: FKTABLE_CAT</term>
0416: * <listitem>
0417: * <code>String</code> (An empty string in QED)</listitem>
0418: * </varlistentry>
0419: * <varlistentry><term>6: FKTABLE_SCHEM</term>
0420: * <listitem>
0421: * <code>String</code> giving the schema of
0422: * the foreign key's table.</listitem>
0423: * </varlistentry>
0424: * <varlistentry><term>7: FKTABLE_NAME</term>
0425: * <listitem>
0426: * <code>String</code> giving the name of the
0427: * foreign key's table</listitem>
0428: * </varlistentry>
0429: * <varlistentry><term>8: FKCOLUMN_NAME</term>
0430: * <listitem>
0431: * <code>String</code> giving the column name
0432: * of the foreign key</listitem>
0433: * </varlistentry>
0434: * <varlistentry><term>9: KEY_SEQ</term>
0435: * <listitem>
0436: * <code>short</code> indicating the column number
0437: * within the foreign key, if the foreign key has
0438: * more than one column</listitem>
0439: * </varlistentry>
0440: * <varlistentry><term>10: UPDATE_RULE</term>
0441: * <listitem>
0442: * <code>short</code> indicating what happens when the
0443: * primary key is updated: The values supported by QED
0444: * are: <ul>
0445: * <li><code>DatabaseMetaData.importedKeyRestrict</code></li>
0446: * <li><code>DatabaseMetaData.importedKeyCascade</code></li>
0447: * </ul></listitem>
0448: * </varlistentry>
0449: * <varlistentry><term>11: DELETE_RULE</term>
0450: * <listitem>
0451: * <code>short</code> indicating what happens when the
0452: * primary key is deleted: The values supported by QED
0453: * are: <ul>
0454: * <li><code>DatabaseMetaData.importedKeyRestrict</code></li>
0455: * <li><code>DatabaseMetaData.importedKeyCascade</code></li>
0456: * </ul></listitem>
0457: * </varlistentry>
0458: * <varlistentry><term>12: FK_NAME</term>
0459: * <listitem>
0460: * <code>null</code></listitem>
0461: * </varlistentry>
0462: * <varlistentry><term>13: PK_NAME</term>
0463: * <listitem>
0464: * <code>null</code></listitem>
0465: * </varlistentry>
0466: * <varlistentry><term>14: DEFERRABILITY</term>
0467: * <listitem>
0468: * <code>short</code> indicating whether
0469: * foreign key constraint
0470: * checking can be deferred. One of: <ul>
0471: * <li><code>DatabaseMetaData.importedKeyInitiallyDeferred</code></li>
0472: * <li><code>DatabaseMetaData.importedKeyInitiallyImmediate</code></li>
0473: * <li><code>DatabaseMetaData.importedKeyNotDeferrable</code></li>
0474: * </ul>
0475: * <p>This QED release remembers the deferability specification
0476: * in the original DDL statement, but deferred constraint checking
0477: * is not supported in this release.
0478: *
0479: * </listitem>
0480: * </varlistentry>
0481: * </variablelist>
0482: */
0483: public java.sql.ResultSet getCrossReference(String primaryCatalog,
0484: String primarySchema, String primaryTable,
0485: String foreignCatalog, String foreignSchema,
0486: String foreignTable) throws SQLException {
0487: StringBuffer sb = new StringBuffer();
0488: doString(sb, "PKTABLE_SCHEM", primarySchema);
0489: doString(sb, "PKTABLE_NAME", primaryTable);
0490: doString(sb, "FKTABLE_SCHEM", foreignSchema);
0491: doString(sb, "FKTABLE_NAME", foreignTable);
0492: Expression ex = parseExpression(sb.toString());
0493: MetaCrossReference mx = new MetaCrossReference(session, ex);
0494: return new ResultSet(mx);
0495: }
0496:
0497: /**
0498: * Return the database product name, "QED"
0499: *
0500: * @return QED
0501: */
0502: public String getDatabaseProductName() {
0503: return "QED";
0504: }
0505:
0506: /**
0507: * Return the version for this product. QED version strings are
0508: * strings of the form <i>major.minor</i>, where <i>major</i>
0509: * and <i>minor</i> are the driver major and minor version numbers
0510: *
0511: * @see #getDriverMajorVersion()
0512: * @see #getDriverMinorVersion()
0513: *
0514: * @return the QED version string.
0515: */
0516: public String getDatabaseProductVersion() {
0517: return "" + getDriverMajorVersion() + "."
0518: + getDriverMinorVersion();
0519: }
0520:
0521: /**
0522: * Return the default transaction isolation level. For QED, the
0523: * default (and only supported) transaction isolation level is
0524: * <code>Connection.TRANSACTION_SERIALIZABLE</code>.
0525: *
0526: * @returnt the default transaction isolation level.
0527: */
0528: public int getDefaultTransactionIsolation() {
0529: return Connection.TRANSACTION_SERIALIZABLE;
0530: }
0531:
0532: /**
0533: * Return the driver major version number.
0534: *
0535: * @return the driver's major version number
0536: */
0537: public int getDriverMajorVersion() {
0538: return Version.majorVersion;
0539: }
0540:
0541: /**
0542: * Return the driver minor version number.
0543: *
0544: * @return the driver's minor version number
0545: */
0546: public int getDriverMinorVersion() {
0547: return Version.minorVersion;
0548: }
0549:
0550: /**
0551: * Return the name of this JDBC driver
0552: *
0553: * @return the string <code>"com.quadcap.jdbc.JdbcDriver"</code>
0554: */
0555: public String getDriverName() {
0556: return "com.quadcap.jdbc.JdbcDriver";
0557: }
0558:
0559: /**
0560: * Return the version for this JDBC Driver. QED version strings are
0561: * strings of the form <i>major.minor</i>, where <i>major</i>
0562: * and <i>minor</i> are the driver major and minor version numbers
0563: *
0564: * @see #getDriverMajorVersion()
0565: * @see #getDriverMinorVersion()
0566: *
0567: * @return the QED version string.
0568: */
0569: public String getDriverVersion() throws SQLException {
0570: return getDatabaseProductVersion();
0571: }
0572:
0573: /**
0574: * This function returns a <code>ResultSet</code> object that
0575: * contains information about the foreign key columns that reference
0576: * the primary keys in the specified table.
0577: *
0578: * @param catalog ignored, since catalogs not supported by QED.
0579: * @param schema a schema name. Used to specify the schema name
0580: * of the table containing the primary key. <code>null</code>
0581: * specifies any schema.
0582: * @param table the name of the table containing the primary key.
0583: * @return a <code>ResultSet</code> object, with each row being a
0584: * description of a foreign key column.<p>
0585: * @exception SQLException may be thrown.
0586: *
0587: * The columns in the <code>ResultSet</code> object have the following
0588: * definition:
0589: * <p>
0590: * <variablelist>
0591: * <varlistentry><term>1: PKTABLE_CAT</term>
0592: * <listitem>
0593: * <code>null</code> (Catalogs not supported by QED)</listitem>
0594: * </varlistentry>
0595: * <varlistentry><term>2: PKTABLE_SCHEM</term>
0596: * <listitem>
0597: * <code>String</code> giving the schema of the
0598: * primary key's table.</listitem>
0599: * </varlistentry>
0600: * <varlistentry><term>3: PKTABLE_NAME</term>
0601: * <listitem>
0602: * <code>String</code> giving the name of the
0603: * primary key's table</listitem>
0604: * </varlistentry>
0605: * <varlistentry><term>4: PKCOLUMN_NAME</term>
0606: * <listitem>
0607: * <code>String</code> giving the column name
0608: * of the primary key</listitem>
0609: * </varlistentry>
0610: * <varlistentry><term>5: FKTABLE_CAT</term>
0611: * <listitem>
0612: * <code>null</code> (Catalogs not supported by QED)</listitem>
0613: * </varlistentry>
0614: * <varlistentry><term>6: FKTABLE_SCHEM</term>
0615: * <listitem>
0616: * <code>String</code> giving the schema of
0617: * the foreign key's table.</listitem>
0618: * </varlistentry>
0619: * <varlistentry><term>7: FKTABLE_NAME</term>
0620: * <listitem>
0621: * <code>String</code> giving the name of the
0622: * foreign key's table</listitem>
0623: * </varlistentry>
0624: * <varlistentry><term>8: FKCOLUMN_NAME</term>
0625: * <listitem>
0626: * <code>String</code> giving the column name
0627: * of the foreign key</listitem>
0628: * </varlistentry>
0629: * <varlistentry><term>9: KEY_SEQ</term>
0630: * <listitem>
0631: * <code>short</code> indicating the column number
0632: * within the foreign key, if the foreign key has
0633: * more than one column</listitem>
0634: * </varlistentry>
0635: * <varlistentry><term>10: UPDATE_RULE</term>
0636: * <listitem>
0637: * <code>short</code> indicating what happens when the
0638: * primary key is updated: The values supported by QED
0639: * are: <ul>
0640: * <li><code>DatabaseMetaData.importedKeyRestrict</code></li>
0641: * <li><code>DatabaseMetaData.importedKeyCascade</code></li>
0642: * </ul></listitem>
0643: * </varlistentry>
0644: * <varlistentry><term>11: DELETE_RULE</term>
0645: * <listitem>
0646: * <code>short</code> indicating what happens when the
0647: * primary key is deleted: The values supported by QED
0648: * are: <ul>
0649: * <li><code>DatabaseMetaData.importedKeyRestrict</code></li>
0650: * <li><code>DatabaseMetaData.importedKeyCascade</code></li>
0651: * </ul></listitem>
0652: * </varlistentry>
0653: * <varlistentry><term>12: FK_NAME</term>
0654: * <listitem>
0655: * <code>null</code></listitem>
0656: * </varlistentry>
0657: * <varlistentry><term>13: PK_NAME</term>
0658: * <listitem>
0659: * <code>null</code></listitem>
0660: * </varlistentry>
0661: * <varlistentry><term>14: DEFERRABILITY</term>
0662: * <listitem>
0663: * <code>short</code> indicating whether
0664: * foreign key constraint
0665: * checking can be deferred. One of: <ul>
0666: * <li><code>DatabaseMetaData.importedKeyInitiallyDeferred</code></li>
0667: * <li><code>DatabaseMetaData.importedKeyInitiallyImmediate</code></li>
0668: * <li><code>DatabaseMetaData.importedKeyNotDeferrable</code></li>
0669: * </ul>
0670: * <p>This QED release remembers the deferability specification
0671: * in the original DDL statement, but deferred constraint checking
0672: * is not supported in this release.
0673: *
0674: * </listitem>
0675: * </varlistentry>
0676: * </variablelist>
0677: *
0678: */
0679: public java.sql.ResultSet getExportedKeys(String catalog,
0680: String schema, String table) throws SQLException {
0681: StringBuffer sb = new StringBuffer("");
0682: doString(sb, "PKTABLE_SCHEM", schema);
0683: doString(sb, "PKTABLE_NAME", table);
0684: Expression ex = parseExpression(sb.toString());
0685: MetaCrossReference mt = new MetaCrossReference(session, ex);
0686: return new ResultSet(mt);
0687: }
0688:
0689: /**
0690: * Returns a string consisting of all characters that can be used
0691: * in unquoted identifier names other than alphanumerics and _).
0692: * In QED, this returns the empty string, since only alphanumerics
0693: * and underscore are valid identifier characters.
0694: *
0695: * @return the empty string
0696: */
0697: public String getExtraNameCharacters() {
0698: return "";
0699: }
0700:
0701: /**
0702: * Return the string used to quote SQL identifiers.
0703: *
0704: * @return the double-quote character: <code>"</code>
0705: */
0706: public String getIdentifierQuoteString() {
0707: return "\"";
0708: }
0709:
0710: /**
0711: * This function returns a <code>ResultSet</code> object that
0712: * contains information about the primary key columns that are
0713: * referenced by the foreign keys in the specified table.
0714: *
0715: * @param catalog ignored, since catalogs not supported by QED.
0716: * @param schema a schema name. Used to specify the schema name
0717: * of the table containing the foreign key. <code>null</code>
0718: * specifies any schema.
0719: * @param table the name of the table containing the foreign key.
0720: * @return a <code>ResultSet</code> object, with each row being a
0721: * description of a foreign key column.<p>
0722: * @exception SQLException may be thrown.
0723: *
0724: * The columns in the <code>ResultSet</code> object have the following
0725: * definition:
0726: * <p>
0727: * <variablelist>
0728: * <varlistentry><term>1: PKTABLE_CAT</term>
0729: * <listitem>
0730: * <code>null</code> (Catalogs not supported by QED)</listitem>
0731: * </varlistentry>
0732: * <varlistentry><term>2: PKTABLE_SCHEM</term>
0733: * <listitem>
0734: * <code>String</code> giving the schema of the
0735: * primary key's table.</listitem>
0736: * </varlistentry>
0737: * <varlistentry><term>3: PKTABLE_NAME</term>
0738: * <listitem>
0739: * <code>String</code> giving the name of the
0740: * primary key's table</listitem>
0741: * </varlistentry>
0742: * <varlistentry><term>4: PKCOLUMN_NAME</term>
0743: * <listitem>
0744: * <code>String</code> giving the column name
0745: * of the primary key</listitem>
0746: * </varlistentry>
0747: * <varlistentry><term>5: FKTABLE_CAT</term>
0748: * <listitem>
0749: * <code>null</code> (Catalogs not supported by QED)</listitem>
0750: * </varlistentry>
0751: * <varlistentry><term>6: FKTABLE_SCHEM</term>
0752: * <listitem>
0753: * <code>String</code> giving the schema of
0754: * the foreign key's table.</listitem>
0755: * </varlistentry>
0756: * <varlistentry><term>7: FKTABLE_NAME</term>
0757: * <listitem>
0758: * <code>String</code> giving the name of the
0759: * foreign key's table</listitem>
0760: * </varlistentry>
0761: * <varlistentry><term>8: FKCOLUMN_NAME</term>
0762: * <listitem>
0763: * <code>String</code> giving the column name
0764: * of the foreign key</listitem>
0765: * </varlistentry>
0766: * <varlistentry><term>9: KEY_SEQ</term>
0767: * <listitem>
0768: * <code>short</code> indicating the column number
0769: * within the foreign key, if the foreign key has
0770: * more than one column</listitem>
0771: * </varlistentry>
0772: * <varlistentry><term>10: UPDATE_RULE</term>
0773: * <listitem>
0774: * <code>short</code> indicating what happens when the
0775: * primary key is updated: The values supported by QED
0776: * are: <ul>
0777: * <li><code>DatabaseMetaData.importedKeyRestrict</code></li>
0778: * <li><code>DatabaseMetaData.importedKeyCascade</code></li>
0779: * </ul></listitem>
0780: * </varlistentry>
0781: * <varlistentry><term>11: DELETE_RULE</term>
0782: * <listitem>
0783: * <code>short</code> indicating what happens when the
0784: * primary key is deleted: The values supported by QED
0785: * are: <ul>
0786: * <li><code>DatabaseMetaData.importedKeyRestrict</code></li>
0787: * <li><code>DatabaseMetaData.importedKeyCascade</code></li>
0788: * </ul></listitem>
0789: * </varlistentry>
0790: * <varlistentry><term>12: FK_NAME</term>
0791: * <listitem>
0792: * the name of the foreign key constraint</listitem>
0793: * </varlistentry>
0794: * <varlistentry><term>13: PK_NAME</term>
0795: * <listitem>
0796: * <code>null</code></listitem>
0797: * </varlistentry>
0798: * <varlistentry><term>14: DEFERRABILITY</term>
0799: * <listitem>
0800: * <code>short</code> indicating whether
0801: * foreign key constraint
0802: * checking can be deferred. One of: <ul>
0803: * <li><code>DatabaseMetaData.importedKeyInitiallyDeferred</code></li>
0804: * <li><code>DatabaseMetaData.importedKeyInitiallyImmediate</code></li>
0805: * <li><code>DatabaseMetaData.importedKeyNotDeferrable</code></li>
0806: * </ul>
0807: * <p>This QED release remembers the deferability specification
0808: * in the original DDL statement, but deferred constraint checking
0809: * is not supported in this release.
0810: *
0811: * </listitem>
0812: * </varlistentry>
0813: * </variablelist>
0814: *
0815: */
0816: public java.sql.ResultSet getImportedKeys(String catalog,
0817: String schema, String table) throws SQLException {
0818: StringBuffer sb = new StringBuffer("");
0819: doString(sb, "FKTABLE_SCHEM", schema);
0820: doString(sb, "FKTABLE_NAME", table);
0821: Expression ex = parseExpression(sb.toString());
0822: MetaCrossReference mt = new MetaCrossReference(session, ex);
0823: return new ResultSet(mt);
0824: }
0825:
0826: /**
0827: * This function returns a <code>ResultSet</code> object that
0828: * contains information about the index columns in the specified
0829: * table.
0830: *
0831: * @param catalog ignored, since catalogs not supported by QED.
0832: * @param schema a schema name. Used to specify the schema name
0833: * of the table. <code>null</code>
0834: * specifies any schema.
0835: * @param table the name of the table.
0836: * @return a <code>ResultSet</code> object, with each row being a
0837: * description of an index column.<p>
0838: * @exception SQLException may be thrown.
0839: *
0840: * The columns in the <code>ResultSet</code> object have the following
0841: * definition:
0842: * <p>
0843: * <variablelist>
0844: * <varlistentry><term>1: TABLE_CAT</term>
0845: * <listitem>
0846: * <code>null</code> (Catalogs not supported by QED)</listitem>
0847: * </varlistentry>
0848: * <varlistentry><term>2: TABLE_SCHEM</term>
0849: * <listitem>
0850: * <code>String</code> giving the table's schema</listitem>
0851: * </varlistentry>
0852: * <varlistentry><term>3: TABLE_NAME</term>
0853: * <listitem>
0854: * <code>String</code> giving the table's name</listitem>
0855: * </varlistentry>
0856: * <varlistentry><term>4: NON_UNIQUE</term>
0857: * <listitem>
0858: * <code>boolean</code> <code>false</code> if index values
0859: * must be unique, <code>true</code> otherwise.</listitem>
0860: * </varlistentry>
0861: * <varlistentry><term>5: INDEX_QUALIFIER</term>
0862: * <listitem>
0863: * QED returns <code>"global"</code> if this is a global
0864: * index, <code>null</code> otherwise.</listitem>
0865: * </varlistentry>
0866: * <varlistentry><term>6: INDEX_NAME</term>
0867: * <listitem>
0868: * <code>String</code> the name of the index</listitem>
0869: * </varlistentry>
0870: * <varlistentry><term>7: TYPE</term>
0871: * <listitem>
0872: * <code>short</code> <code>DatabaseMetaData.tableIndexOther</code></listitem>
0873: * </varlistentry>
0874: * <varlistentry><term>8: ORDINAL_POSITION</term>
0875: * <listitem>
0876: * <code>short</code> indicating the column sequence
0877: * within the index</listitem>
0878: * </varlistentry>
0879: * <varlistentry><term>9: COLUMN_NAME</term>
0880: * <listitem>
0881: * <code>String</code> The name of the column</listitem>
0882: * </varlistentry>
0883: * <varlistentry><term>10: ASC_OR_DESC</term>
0884: * <listitem>
0885: * <code>String</code> always <code>"A"</code></listitem>
0886: * </varlistentry>
0887: * <varlistentry><term>11: CARDINALITY</term>
0888: * <listitem>
0889: * <code>null</code> The JDBC specification says that
0890: * this returns the number of unique values in the index,
0891: * a statistic which is not kept in this release of
0892: * QED.</listitem>
0893: * </varlistentry>
0894: * <varlistentry><term>12: PAGES</term>
0895: * <listitem>
0896: * <code>null</code> The JDBC specification says that
0897: * this returns the number of pages used by the index,
0898: * a statistic which is not kept in this release of
0899: * QED.</listitem>
0900: * </varlistentry>
0901: * <varlistentry><term>13: FILTER_CONDITION</term>
0902: * <listitem>
0903: * <code>null</code> not supported by QED
0904: * </listitem>
0905: * </varlistentry>
0906: * </variablelist>
0907: */
0908: public java.sql.ResultSet getIndexInfo(String catalog,
0909: String schema, String table, boolean unique,
0910: boolean approximate) throws SQLException {
0911: StringBuffer sb = new StringBuffer("");
0912: doString(sb, "TABLE_SCHEM", schema);
0913: doString(sb, "TABLE_NAME", table);
0914: if (unique) {
0915: if (sb.length() > 0)
0916: sb.append(" and ");
0917: sb.append("not NON_UNIQUE");
0918: }
0919: Expression ex = parseExpression(sb.toString());
0920: MetaIndexInfo mi = new MetaIndexInfo(session, ex);
0921: return new ResultSet(mi);
0922: }
0923:
0924: /**
0925: * Return the maximum size of a binary literal. QED has no
0926: * architectural limitation on literal sizes, and so always
0927: * returns zero.
0928: *
0929: * @return zero, meaning unlimited.
0930: */
0931: public int getMaxBinaryLiteralLength() {
0932: return 0;
0933: }
0934:
0935: /**
0936: * QED doesn't support catalogs, but if it did, it wouldn't impose
0937: * a limit on the length of their names.
0938: *
0939: * @return zero, meaning unlimited.
0940: */
0941: public int getMaxCatalogNameLength() {
0942: return 0;
0943: }
0944:
0945: /**
0946: * Return the maximum size of a character literal. QED has no
0947: * architectural limitation on literal sizes, and so always
0948: * returns zero.
0949: *
0950: * @return zero, meaning unlimited.
0951: */
0952: public int getMaxCharLiteralLength() {
0953: return 0;
0954: }
0955:
0956: /**
0957: * Return the maximum length of a column name. QED has no
0958: * architectural limitation on name sizes, and so always
0959: * returns zero.
0960: *
0961: * @return zero, meaning unlimited.
0962: */
0963: public int getMaxColumnNameLength() {
0964: return 0;
0965: }
0966:
0967: /**
0968: * Return the maximum number of columns in a <code>GROUP BY</code>
0969: * clause. QED has no architectural limitation on
0970: * <code>GROUP BY</code> clauses, and so always
0971: * returns zero.
0972: *
0973: * @return zero, meaning unlimited.
0974: */
0975: public int getMaxColumnsInGroupBy() {
0976: return 0;
0977: }
0978:
0979: /**
0980: * Return the maximum number of columns in an index.
0981: * QED has no architectural limitation on index columns,
0982: * and so always returns zero.
0983: *
0984: * @return zero, meaning unlimited.
0985: */
0986: public int getMaxColumnsInIndex() {
0987: return 0;
0988: }
0989:
0990: /**
0991: * Return the maximum number of columns in an <code>ORDER BY</code>
0992: * clause. QED has no architectural limitation on
0993: * <code>ORDER BY</code> clauses, and so always
0994: * returns zero.
0995: *
0996: * @return zero, meaning unlimited.
0997: */
0998: public int getMaxColumnsInOrderBy() {
0999: return 0;
1000: }
1001:
1002: /**
1003: * Return the maximum number of columns in a <code>SELECT</code>
1004: * clause. QED has no architectural limitation on
1005: * <code>SELECT</code> clauses, and so always
1006: * returns zero.
1007: *
1008: * @return zero, meaning unlimited.
1009: */
1010: public int getMaxColumnsInSelect() {
1011: return 0;
1012: }
1013:
1014: /**
1015: * Return the maximum number of columns in an table.
1016: * QED has no architectural limitation on table columns,
1017: * and so always returns zero.
1018: *
1019: * @return zero, meaning unlimited.
1020: */
1021: public int getMaxColumnsInTable() {
1022: return 0;
1023: }
1024:
1025: /**
1026: * Return the maximum number of active connections that can
1027: * be maintained by this driver instance.
1028: * QED has no architectural limitation on datbase connections,
1029: * and so always returns zero.
1030: *
1031: * @return zero, meaning unlimited.
1032: */
1033: public int getMaxConnections() {
1034: return 0;
1035: }
1036:
1037: /**
1038: * QED doesn't support named cursors, but if it did, it wouldn't impose
1039: * a limit on the length of their names.
1040: *
1041: * @return zero, meaning unlimited.
1042: */
1043: public int getMaxCursorNameLength() {
1044: return 0;
1045: }
1046:
1047: /**
1048: * Return the maximum number of bytes in an index. QED has no
1049: * architectural limitation on index sizes, and so always returns zero.
1050: *
1051: * @return zero, meaning unlimited.
1052: */
1053: public int getMaxIndexLength() {
1054: return 0;
1055: }
1056:
1057: /**
1058: * QED doesn't support stored procedures, but if it did, it wouldn't impose
1059: * a limit on the length of their names.
1060: *
1061: * @return zero, meaning unlimited.
1062: */
1063: public int getMaxProcedureNameLength() {
1064: return 0;
1065: }
1066:
1067: /**
1068: * Return the maximum number of bytes in a single row. QED has no
1069: * architectural limitation on row sizes, and so always returns zero.
1070: *
1071: * @return zero, meaning unlimited.
1072: */
1073: public int getMaxRowSize() {
1074: return 0;
1075: }
1076:
1077: /**
1078: * Return the maximum length of a schema name. QED has no
1079: * architectural limitation on schema sizes, and so always
1080: * returns zero.
1081: *
1082: * @return zero, meaning unlimited.
1083: */
1084: public int getMaxSchemaNameLength() {
1085: return 0;
1086: }
1087:
1088: /**
1089: * Return the maximum number of characters in an SQL statement. QED has no
1090: * architectural limitation on statement sizes, and so always
1091: * returns zero.
1092: *
1093: * @return zero, meaning unlimited.
1094: */
1095: public int getMaxStatementLength() {
1096: return 0;
1097: }
1098:
1099: /**
1100: * Return the maximum number of concurrently active statements that
1101: * can be open on a single connection. The QED threading model
1102: * essentially restricts the application to a single active
1103: * <code>ResultSet</code> per connection. If another statement
1104: * is executed which creates a <code>ResultSet</code>, the first
1105: * <code>ResultSet</code> will be automatically closed.
1106: *
1107: * @return one
1108: */
1109: public int getMaxStatements() {
1110: return 1;
1111: }
1112:
1113: /**
1114: * Return the maximum length of a table name. QED has no
1115: * architectural limitation on name lengths, and so always
1116: * returns zero.
1117: *
1118: * @return zero, meaning unlimited.
1119: */
1120: public int getMaxTableNameLength() {
1121: return 0;
1122: }
1123:
1124: /**
1125: * Return the maximum number of tables allowed in a <code>SELECT</code>
1126: * clause. QED has no
1127: * architectural limitation on this, and so always
1128: * returns zero.
1129: *
1130: * @return zero, meaning unlimited.
1131: */
1132: public int getMaxTablesInSelect() {
1133: return 0;
1134: }
1135:
1136: /**
1137: * Return the maximum length of a user name. QED has no
1138: * architectural limitation on name lengths, and so always
1139: * returns zero.
1140: *
1141: * @return zero, meaning unlimited.
1142: */
1143: public int getMaxUserNameLength() {
1144: return 0;
1145: }
1146:
1147: /**
1148: * Return a comma-separated string containing the names of the
1149: * numeric functions supported by QED.
1150: * This string contains the Open Group
1151: * CLI names for the following functions:
1152: *
1153: * <p><code>
1154: * ABS,ACOS,ASIN,ATAN,ATAN2,CEILING,COS,COT,DEGREES,EXP,FLOOR
1155: * LOG,LOG10,MOD,PI,POWER,RADIANS,RAND,ROUND,SIGN,SIN,SQRT,TAN
1156: * TRUNCATE
1157: * </code></p>
1158: */
1159: public String getNumericFunctions() {
1160: return "ABS,ACOS,ASIN,ATAN,ATAN2,CEILING,COS,COT,DEGREES,EXP,FLOOR,"
1161: + "LOG,LOG10,MOD,PI,POWER,RADIANS,RAND,ROUND,SIGN,SIN,SQRT,TAN,"
1162: + "TRUNCATE";
1163: }
1164:
1165: /**
1166: * This function returns a <code>ResultSet</code> describing the
1167: * primary key columns of the specified table.
1168: *
1169: * @param catalog ignored, since catalogs not supported by QED.
1170: * @param schema a schema name. Used to specify the schema name
1171: * of the table. <code>null</code>
1172: * specifies any schema.
1173: * @param table the name of the table.
1174: * @return a <code>ResultSet</code> object, with each row being a
1175: * description of an index column.<p>
1176: * @exception SQLException may be thrown.
1177: *
1178: * The columns in the <code>ResultSet</code> object have the following
1179: * definition:
1180: * <p>
1181: * <variablelist>
1182: * <varlistentry><term>1: TABLE_CAT</term>
1183: * <listitem>
1184: * <code>null</code> (Catalogs not supported by QED)</listitem>
1185: * </varlistentry>
1186: * <varlistentry><term>2: TABLE_SCHEM</term>
1187: * <listitem>
1188: * <code>String</code> giving the table's schema</listitem>
1189: * </varlistentry>
1190: * <varlistentry><term>3: TABLE_NAME</term>
1191: * <listitem>
1192: * <code>String</code> giving the table's name</listitem>
1193: * </varlistentry>
1194: * <varlistentry><term>4: COLUMN_NAME</term>
1195: * <listitem>
1196: * <code>String</code> giving the column name</listitem>
1197: * </varlistentry>
1198: * <varlistentry><term>5: KEY_SEQ</term>
1199: * <listitem>
1200: * <code>short</code> indicating the column sequence
1201: * within the primary key</listitem>
1202: * </varlistentry>
1203: * <varlistentry><term>6: PK_NAME</term>
1204: * <listitem>
1205: * <code>String</code> The name of the primary key constraint</listitem>
1206: * </varlistentry>
1207: * </variablelist>
1208: */
1209: public java.sql.ResultSet getPrimaryKeys(String catalog,
1210: String schema, String table) throws SQLException {
1211: StringBuffer sb = new StringBuffer("");
1212: doString(sb, "TABLE_SCHEM", schema);
1213: doString(sb, "TABLE_NAME", table);
1214: Expression ex = parseExpression(sb.toString());
1215: MetaPrimaryKeys mt = new MetaPrimaryKeys(session, ex);
1216: return new ResultSet(mt);
1217: }
1218:
1219: /**
1220: * Stored procedures aren't supported by QED, but
1221: * we return an empty result set with the right signature as a courtesy.
1222: *
1223: * @param catalog N/A
1224: * @param schemaNamePattern N/A
1225: * @param procedureNamePattern N/A
1226: * @param columnNamePattern N/A
1227: */
1228: public java.sql.ResultSet getProcedureColumns(String catalog,
1229: String schemaNamePattern, String procedureNamePattern,
1230: String columnNamePattern) throws SQLException {
1231: return new ResultSet(MetaCursor.find(session,
1232: "SYSTEM.PROCEDURECOLUMNS"));
1233: }
1234:
1235: /**
1236: * Stored procedures aren't supported by QED, but
1237: * we return an empty result set with the right signature as a courtesy.
1238: *
1239: * @param catalog N/A
1240: * @param schemaNamePattern N/A
1241: * @param procedureNamePattern N/A
1242: */
1243: public java.sql.ResultSet getProcedures(String catalog,
1244: String schemaNamePattern, String procedureNamePattern)
1245: throws SQLException {
1246: return new ResultSet(MetaCursor.find(session,
1247: "SYSTEM.PROCEDURES"));
1248: }
1249:
1250: /**
1251: * Whatever.
1252: */
1253: public String getProcedureTerm() throws SQLException {
1254: return "proc";
1255: }
1256:
1257: /**
1258: * Return a result set containing the names of the database schemas.
1259: *
1260: */
1261: public java.sql.ResultSet getSchemas() throws SQLException {
1262: return new ResultSet(MetaCursor.find(session, "SYSTEM.SCHEMAS"));
1263: }
1264:
1265: /**
1266: * Get the "database vendor's preferred term for 'schema'".
1267: *
1268: * @return "schema"
1269: */
1270: public String getSchemaTerm() {
1271: return "schema";
1272: }
1273:
1274: /**
1275: * Return the default value for the escape sequence that can be
1276: * used to escape literal "_" and "%" pattern characters in
1277: * <code>LIKE</code> pattern strings.
1278: *
1279: * @return the string "\"
1280: */
1281: public String getSearchStringEscape() {
1282: return ValuePattern.defaultEscape;
1283: }
1284:
1285: /**
1286: * Returns a list of database keywords that are not also SQL-92
1287: * keywords. For this release of QED, this is currently the
1288: * empty string.
1289: *
1290: * @return ""
1291: */
1292: public String getSQLKeywords() {
1293: return "";
1294: }
1295:
1296: /**
1297: * Return a comma-separated string containing the names of the
1298: * string functions supported by QED.
1299: * This string contains the Open Group
1300: * CLI names for the following functions:
1301: *
1302: * <p><code>
1303: * ASCII, CHAR, CONCAT, DIFFERENCE, INSERT, LCASE, LOWER, LEFT, LENGTH
1304: * LOCATE, LTRIM, REPEAT, REPLACE, RIGHT, RTRIM, SOUNDEX, SPACE
1305: * SUBSTRING, UCASE, UPPER
1306: * </code</p>
1307: */
1308: public String getStringFunctions() {
1309: return "ASCII,CHAR,CONCAT,DIFFERENCE,INSERT,LCASE,LOWER,LEFT,LENGTH,"
1310: + "LOCATE,LTRIM,REPEAT,REPLACE,RIGHT,RTRIM,SOUNDEX,SPACE,"
1311: + "SUBSTRING,UCASE,UPPER";
1312: }
1313:
1314: /**
1315: * Return a comma-separated string containing the names of the
1316: * system functions supported by QED.
1317: * This string contains the Open Group
1318: * CLI names for the following functions:
1319: *
1320: * <p><code>DATABASE, IFNULL, USER</code></p>
1321: */
1322: public String getSystemFunctions() {
1323: return "DATABASE,IFULL,USER";
1324: }
1325:
1326: /**
1327: * QED doesn't support column privs, but we return an empty ResultSet
1328: * of the right signature as a courtesy.
1329: */
1330: public java.sql.ResultSet getTablePrivileges(String catalog,
1331: String schema, String tableNamePattern) throws SQLException {
1332: return new ResultSet(MetaCursor.find(session,
1333: "SYSTEM.TABLEPRIVILEGES"));
1334: }
1335:
1336: /**
1337: * This function returns a <code>ResultSet<code> describing the
1338: * tables in the database.
1339: *
1340: * @param catalog ignored, since catalogs not supported by QED.
1341: * @param schemaPattern a SQL "like" pattern. All schema names matching
1342: * this pattern are selected. If this parameter is the empty
1343: * string, all schemas are selected.
1344: * @param tableNamePattern a SQL "like" pattern. All table names
1345: * matching this pattern are selected.
1346: * @param types an array of strings specifying the table types to
1347: * be returned, from the set: <code>"TABLE", "VIEW",
1348: * "LOCAL TEMPORARY", "GLOBAL TEMPORARY"</code>
1349: * @return a <code>ResultSet</code> object, with each row being a
1350: * description of a table.<p>
1351: * @exception SQLException may be thrown.
1352: *
1353: * The columns in the <code>ResultSet</code> object have the following
1354: * definition:
1355: * <p>
1356: * <variablelist>
1357: * <varlistentry><term>1: TABLE_CAT</term>
1358: * <listitem>
1359: * <code>null</code> (Catalogs not supported by QED)</listitem>
1360: * </varlistentry>
1361: * <varlistentry><term>2: TABLE_SCHEM</term>
1362: * <listitem>
1363: * <code>String</code> giving the table's schema</listitem>
1364: * </varlistentry>
1365: * <varlistentry><term>3: TABLE_NAME</term>
1366: * <listitem>
1367: * <code>String</code> giving the table's name</listitem>
1368: * </varlistentry>
1369: * <varlistentry><term>4: TABLE_TYPE</term>
1370: * <listitem>
1371: * <code>String</code> The table type. One of: <ul>
1372: * <li><code>TABLE</code></li>
1373: * <li><code>VIEW</code></li>
1374: * <li><code>GLOBAL TEMPORARY</code></li>
1375: * <li><code>LOCAL TEMPORARY</code></li>
1376: * </ul></listitem>
1377: * </varlistentry>
1378: * <varlistentry><term>5: REMARKS</term>
1379: * <listitem>
1380: * <code>null</code></listitem>
1381: * </varlistentry>
1382: * </variablelist>
1383: */
1384: public java.sql.ResultSet getTables(String catalog,
1385: String schemaPattern, String tableNamePattern,
1386: String[] types) throws SQLException {
1387: StringBuffer sb = new StringBuffer();
1388: doPattern(sb, "TABLE_SCHEM", schemaPattern);
1389: doPattern(sb, "TABLE_NAME", tableNamePattern);
1390: if (types != null) {
1391: if (sb.length() > 0)
1392: sb.append(" AND ");
1393: sb.append("TABLE_TYPE in (");
1394: for (int i = 0; i < types.length; i++) {
1395: if (i > 0)
1396: sb.append(',');
1397: sb.append('\'');
1398: sb.append(types[i].toUpperCase());
1399: sb.append('\'');
1400: }
1401: sb.append(")");
1402: }
1403: Expression ex = parseExpression(sb.toString());
1404: MetaTables mt = new MetaTables(session, ex);
1405: return new ResultSet(mt);
1406: }
1407:
1408: /**
1409: * This function returns a <code>ResultSet</code> which describes
1410: * the table types supported by QED.
1411: *
1412: * @exception SQLException may be thrown.
1413: *
1414: * The column in the <code>ResultSet</code> object has the following
1415: * definition:
1416: * <p>
1417: * <variablelist>
1418: * <varlistentry><term>1: TABLE_TYPE</term>
1419: * <listitem>
1420: * <code>String</code> listing the table type.
1421: * One of: <ul>
1422: * <li><code>TABLE</code></li>
1423: * <li><code>VIEW</code></li>
1424: * <li><code>GLOBAL TEMPORARY</code></li>
1425: * <li><code>LOCAL TEMPORARY</code></li>
1426: * </ul></listitem>
1427: * </varlistentry>
1428: * </variablelist>
1429: */
1430: public java.sql.ResultSet getTableTypes() throws SQLException {
1431: MetaTableTypes mt = new MetaTableTypes(session);
1432: return new ResultSet(mt);
1433: }
1434:
1435: Expression parseExpression(String s) throws SQLException {
1436: if (s.length() == 0)
1437: return null;
1438: try {
1439: session.makeTransaction();
1440: SQLParser p = new SQLParser(session, s, false);
1441: return p.expression();
1442: } catch (antlr.TokenStreamException e) {
1443: throw new SQLException(e.toString(), "Q000Y");
1444: } catch (antlr.RecognitionException e) {
1445: throw new SQLException(e.toString(), "42000");
1446: }
1447: }
1448:
1449: /**
1450: * Return a comma-separated string containing the names of the
1451: * date-time functions supported by QED.
1452: * This string contains the Open Group
1453: * CLI names for the following functions:
1454: *
1455: * <p><code>
1456: * CURDATE,CURTIME,DAYNAME,DAYOFMONTH,DAYOFWEEK,DAYOFYEAR
1457: * HOUR,MINUTE,MONTH,MONTHNAME,NOW,QUARTER,SECOND,TIMESTAMPADD
1458: * TIMESTAMPDIFF,WEEK,YEAR
1459: * </code></p>
1460: */
1461: public String getTimeDateFunctions() throws SQLException {
1462: return "CURDATE,CURTIME,DAYNAME,DAYOFMONTH,DAYOFWEEK,DAYOFYEAR,"
1463: + "HOUR,MINUTE,MONTH,MONTHNAME,NOW,QUARTER,SECOND,TIMESTAMPADD,"
1464: + "TIMESTAMPDIFF,WEEK,YEAR";
1465: }
1466:
1467: /**
1468: * This function returns a <code>ResultSet</code> listing the data
1469: * types supported by QED.
1470: *
1471: * @exception SQLException may be thrown.
1472: *
1473: * The column in the <code>ResultSet</code> object has the following
1474: * definition:
1475: * <p>
1476: * <variablelist>
1477: * <varlistentry><term>1: TYPE_NAME</term>
1478: * <listitem>
1479: * <code>String</code> Containing the SQL-92 name of the type</listitem>
1480: * </varlistentry>
1481: * <varlistentry><term>2: DATA_TYPE</term>
1482: * <listitem>
1483: * <code>short</code> Giving the JDBC type, from
1484: * <code>java.sql.Types</code></listitem>
1485: * </varlistentry>
1486: * <varlistentry><term>3: PRECISION</term>
1487: * <listitem>
1488: * <code>int</code> indicating the maximum precision for
1489: * numeric types, and <code>-1</code> for non-numeric types</listitem>
1490: * </varlistentry>
1491: * <varlistentry><term>4: LITERAL_PREFIX</term>
1492: * <listitem>
1493: * <code>String</code> for character types, the <code>'</code>
1494: * character; for other types, <code>null</code></listitem>
1495: * </varlistentry>
1496: * <varlistentry><term>5: LITERAL_SUFFIX</term>
1497: * <listitem>
1498: * <code>String</code> for character types, the <code>'</code>
1499: * character; for other types, <code>null</code></listitem>
1500: * </varlistentry>
1501: * <varlistentry><term>6: CREATE_PARAMS</term>
1502: * <listitem>
1503: * <code>String</code> Giving the parameters used when
1504: * creating the type. Typically, for character types,
1505: * <code>"length"</code>, and for numeric
1506: * types, <code>"precision"</code> </listitem>
1507: * </varlistentry>
1508: * <varlistentry><term>7: NULLABLE</term>
1509: * <listitem>
1510: * <code>int</code> indicating whether a type is nullable.
1511: * All types are nullable in QED, so this always
1512: * contains <code>DatabaseMetaData.typeNullable</code>.</listitem>
1513: * </varlistentry>
1514: * <varlistentry><term>8: CASE_SENSITIVE</term>
1515: * <listitem>
1516: * <code>boolean</code> if the type is case-sensitive.
1517: * Always <code>true</code> in QED.</listitem>
1518: * </varlistentry>
1519: * <varlistentry><term>9: SEARCHABLE</term>
1520: * <listitem>
1521: * <code>short</code> indicating if this type can be used
1522: * in a <code>WHERE</code> clause. QED always returns
1523: * <code>DatabaseMetaData.typeSearchable</code></listitem>
1524: * </varlistentry>
1525: * <varlistentry><term>10: UNSIGNED_ATTRIBUTE</term>
1526: * <listitem>
1527: * <code>boolean</code> <code>true</code> if
1528: * this type is unsigned, <code>false</code> otherwise</listitem>
1529: * </varlistentry>
1530: * <varlistentry><term>11: FIXED_PREC_SCALE</term>
1531: * <listitem>
1532: * <code>boolean</code> <code>true</code> if
1533: * this type can be a currency value</listitem>
1534: * </varlistentry>
1535: * <varlistentry><term>12: AUTO_INCREMENT</term>
1536: * <listitem>
1537: * <code>false</code> in QED, no auto-increment types
1538: * are supported.</listitem>
1539: * </varlistentry>
1540: * <varlistentry><term>13: LOCAL_TYPE_NAME</term>
1541: * <listitem>
1542: * <code>null</code></listitem>
1543: * </varlistentry>
1544: * <varlistentry><term>14: MINIMUM_SCALE</term>
1545: * <listitem>
1546: * <code>short</code> indicating the minimum scale
1547: * supported for tthis type</listitem>
1548: * </varlistentry>
1549: * <varlistentry><term>15: MAXIMUM_SCALE</term>
1550: * <listitem>
1551: * <code>short</code> indicating the maximum scale
1552: * supported for tthis type</listitem>
1553: * </varlistentry>
1554: * <varlistentry><term>16: SQL_DATA_TYPE</term>
1555: * <listitem>
1556: * <code>int</code> <code>null</code></listitem>
1557: * </varlistentry>
1558: * <varlistentry><term>17: SQL_DATETIME_SUB</term>
1559: * <listitem>
1560: * <code>int</code> <code>null</code></listitem>
1561: * </varlistentry>
1562: * <varlistentry><term>18: NUM_PREC_RADIX</term>
1563: * <listitem>
1564: * <code>int</code> <code>10</code></listitem>
1565: * </varlistentry>
1566: * </variablelist>
1567: */
1568: public java.sql.ResultSet getTypeInfo() throws SQLException {
1569: return new ResultSet(new MetaTypes(session));
1570: }
1571:
1572: /**
1573: * Not implemented in this QED release.
1574: * Just returns an empty resultset
1575: */
1576: public java.sql.ResultSet getUDTs(String catalog,
1577: String schemaPattern, String typeNamePattern, int[] types)
1578: throws SQLException {
1579: return new ResultSet(MetaCursor.find(session, "SYSTEM.UDTS"));
1580: }
1581:
1582: /**
1583: * Return the URL used to connect to this database.
1584: *
1585: * @return the database URL.
1586: */
1587: public String getURL() {
1588: return database.getURL();
1589: }
1590:
1591: /**
1592: * Return the user name used to connect to this database.
1593: *
1594: * @return the user name
1595: */
1596: public String getUserName() {
1597: return qConn.getAuth();
1598: }
1599:
1600: /**
1601: * QED doesn't support this feature, but we return an empty ResultSet
1602: * of the right signature as a courtesy.
1603: */
1604: public java.sql.ResultSet getVersionColumns(String catalog,
1605: String schema, String table) throws SQLException {
1606: return new ResultSet(MetaCursor.find(session,
1607: "SYSTEM.VERSIONCOLUMNS"));
1608: }
1609:
1610: /**
1611: * JDBC specifies two criteria for determining whether inserts are
1612: * detected.
1613: *
1614: * <ol>
1615: * <li>A row that has been inserted appears in the <code>ResultSet</code>
1616: * object without having to close and reopen it</li>
1617: * and
1618: * <li>The method <code>ResultSet.rowInserted</code> will return
1619: * <code>true</code> if the current row was one inserted after
1620: * the <code>ResultSet</code> was opened</li>
1621: * </ol>
1622: * <p>
1623: * This release of QED always returns <code>false</code>
1624: * to <code>ResultSet.rowInserted</code>.
1625: *
1626: * @param type the type of <code>ResultSet</code>
1627: * @return false
1628: */
1629: public boolean insertsAreDetected(int type) {
1630: return false;
1631: }
1632:
1633: /**
1634: * Catalogs aren't supported in QED, but we'll play along at thig point.
1635: * Return true, yep, catalog is at start
1636: */
1637: public boolean isCatalogAtStart() throws SQLException {
1638: return true;
1639: }
1640:
1641: /**
1642: * This release of QED doesn't support read-only connections or
1643: * databases, completely....
1644: *
1645: * @return false
1646: */
1647: public boolean isReadOnly() {
1648: return false;
1649: }
1650:
1651: /**
1652: * Most boolean operators (e.g, arithmetic, logical, string operators)
1653: * produce a <code>NULL</code> result when one of the operands is
1654: * <code>NULL</code>. One notable exception is logical operators
1655: * such as <code>AND</code> and <code>OR</code>, where, e.g.,
1656: * <code>(NULL AND FALSE) = FALSE</code>
1657: *
1658: * @return true
1659: */
1660: public boolean nullPlusNonNullIsNull() {
1661: return true;
1662: }
1663:
1664: /**
1665: * In QED, <code>NULL</code>s are sorted low.
1666: *
1667: * @return false
1668: */
1669: public boolean nullsAreSortedAtEnd() {
1670: return false;
1671: }
1672:
1673: /**
1674: * In QED, <code>NULL</code>s are sorted low.
1675: *
1676: * @return false
1677: */
1678: public boolean nullsAreSortedAtStart() {
1679: return false;
1680: }
1681:
1682: /**
1683: * In QED, <code>NULL</code>s are sorted low.
1684: *
1685: * @return false
1686: */
1687: public boolean nullsAreSortedHigh() {
1688: return false;
1689: }
1690:
1691: /**
1692: * In QED, <code>NULL</code>s are sorted low.
1693: *
1694: * @return true
1695: */
1696: public boolean nullsAreSortedLow() {
1697: return true;
1698: }
1699:
1700: /**
1701: * Due to QED's table-level locking strategy, combined with
1702: * strictly serializable transaction execution, it's not possible
1703: * to see other transaction's deletes
1704: *
1705: * @param type the <code>ResultSet</code> type, ignored
1706: * @return false
1707: */
1708: public boolean othersDeletesAreVisible(int type) {
1709: return false;
1710: }
1711:
1712: /**
1713: * Due to QED's table-level locking strategy, combined with
1714: * strictly serializable transaction execution, it's not possible
1715: * to see other transaction's inserts
1716: *
1717: * @param type the <code>ResultSet</code> type, ignored
1718: * @return false
1719: */
1720: public boolean othersInsertsAreVisible(int type) {
1721: return false;
1722: }
1723:
1724: /**
1725: * Due to QED's table-level locking strategy, combined with
1726: * strictly serializable transaction execution, it's not possible
1727: * to see other transaction's updates
1728: *
1729: * @param type the <code>ResultSet</code> type, ignored
1730: * @return false
1731: */
1732: public boolean othersUpdatesAreVisible(int type) {
1733: return false;
1734: }
1735:
1736: /**
1737: * This release of QED doesn't fully support visible change detection.
1738: *
1739: * @param type the <code>ResultSet</code> type, ignored
1740: * @return false
1741: */
1742: public boolean ownDeletesAreVisible(int type) {
1743: return false;
1744: }
1745:
1746: /**
1747: * This release of QED doesn't fully support visible change detection.
1748: *
1749: * @param type the <code>ResultSet</code> type, ignored
1750: * @return false
1751: */
1752: public boolean ownInsertsAreVisible(int type) {
1753: return false;
1754: }
1755:
1756: /**
1757: * This release of QED doesn't fully support visible change detection.
1758: *
1759: * @param type the <code>ResultSet</code> type, ignored
1760: * @return true
1761: */
1762: public boolean ownUpdatesAreVisible(int type) {
1763: return true;
1764: }
1765:
1766: /**
1767: * QED treats mixed case identifiers in SQL statements as case-insensitve
1768: * and stores them internally in upper case.
1769: *
1770: * @return false
1771: */
1772: public boolean storesLowerCaseIdentifiers() {
1773: return false;
1774: }
1775:
1776: /**
1777: * QED treats mixed case quoted identifiers in SQL statements as
1778: * case-insensitve
1779: * and stores them internally in upper case.
1780: *
1781: * @return false
1782: */
1783: public boolean storesLowerCaseQuotedIdentifiers() {
1784: return false;
1785: }
1786:
1787: /**
1788: * QED treats mixed case identifiers in SQL statements as case-insensitve
1789: * and stores them internally in upper case.
1790: *
1791: * @return false
1792: */
1793: public boolean storesMixedCaseIdentifiers() {
1794: return false;
1795: }
1796:
1797: /**
1798: * QED treats mixed case quoted identifiers in SQL statements as
1799: * case-insensitve
1800: * and stores them internally in upper case.
1801: *
1802: * @return false
1803: */
1804: public boolean storesMixedCaseQuotedIdentifiers() {
1805: return false;
1806: }
1807:
1808: /**
1809: * QED treats mixed case identifiers in SQL statements as case-insensitve
1810: * and stores them internally in upper case.
1811: *
1812: * @return true
1813: */
1814: public boolean storesUpperCaseIdentifiers() {
1815: return true;
1816: }
1817:
1818: /**
1819: * QED treats mixed case quoted identifiers in SQL statements as
1820: * case-insensitve
1821: * and stores them internally in upper case.
1822: *
1823: * @return true
1824: */
1825: public boolean storesUpperCaseQuotedIdentifiers() {
1826: return true;
1827: }
1828:
1829: /**
1830: * QED supports Entry Level SQL 92
1831: *
1832: * @return true
1833: */
1834: public boolean supportsANSI92EntryLevelSQL() {
1835: return true;
1836: }
1837:
1838: /**
1839: * QED supports many Intermediate Level features from SQL 92:
1840: *
1841: * <ul>
1842: * <li>Long identifiers, lowercase identifiers, named constraints</li>
1843: * <li>Datetimes, intervals</li>
1844: * <li>CHARACTER_LENGTH(), OCTET_LENGTH(), SUBSTRING(), TRIM(), CAST()</li>
1845: * <li>JOIN, EXCEPT, INTERSECT, UNION CORRESPONDING</li>
1846: * <li>SELECT AS, SELECT column-commalist, SELECT X.*</li>
1847: * <li>UNIQUE</li>
1848: * <li>ALTER TABLE, DROP TABLE, DROP VIEW</li>
1849: * <li>Many other entry level restrictions are relaxed.</li>
1850: * </ul>
1851: *
1852: * Not supported are the following:
1853: *
1854: * <ul>
1855: * <li>CURRENT_USER(), SYSTEM_USER()</li>
1856: * <li>DROP SCHEMA</li>
1857: * <li>ON DELETE in foreign key definitions</li>
1858: * <li>Dynamic SQL, explicit SQL CURSOR support (e.g., FOR UPDATE),
1859: * anything that basically overlaps with JDBC functionality.</li>
1860: * <ul>
1861: *
1862: * @return false
1863: */
1864: public boolean supportsANSI92IntermediateSQL() {
1865: return false;
1866: }
1867:
1868: /**
1869: * QED supports many, but not all, of the features of Full
1870: * SQL 92.
1871: *
1872: * <ul>
1873: * <li>Bit Strings, Timestamps with explicit precision</li>
1874: * <li>UPPER(), LOWER()</li>
1875: * <li>CROSS JOIN, UNION JOIN</li>
1876: * <li>IS [NOT] {TRUE|FALSE|UNKNOWN}</li>
1877: * <li>MATCH conditions in foreign key constraints</li>
1878: * <li>TABLE table</li>
1879: * </ul>
1880: *
1881: * Not supported are the following:
1882: *
1883: * <ul>
1884: * <li>CONNECT, SET CONNECTION, DISCONNECT</li>
1885: * <li>SET CATALOG (or catalogs at all), SET SCHEMA, SET NAMES</li>
1886: * <li>POSITION()</li>
1887: * <li>CREATE ASSERTION, DROP ASSERTION</li>
1888: * <li>ON UPDATE in foreign key constraints</li>
1889: * <li>TEMPORARY tables</li>
1890: * </ul>
1891: *
1892: * @return false
1893: */
1894: public boolean supportsANSI92FullSQL() {
1895: return false;
1896: }
1897:
1898: /**
1899: * QED supports <code>ALTER TABLE ADD COLUMN</code>
1900: *
1901: * @return true
1902: */
1903: public boolean supportsAlterTableWithAddColumn() {
1904: return true;
1905: }
1906:
1907: /**
1908: * This release of QED doesn't support
1909: * <code>ALTER TABLE DROP COLUMN</code>
1910: *
1911: * @return false
1912: */
1913: public boolean supportsAlterTableWithDropColumn() {
1914: return false;
1915: }
1916:
1917: /**
1918: * This release of QED doesn't support batch updates
1919: *
1920: * @return false
1921: */
1922: public boolean supportsBatchUpdates() {
1923: return false;
1924: }
1925:
1926: /**
1927: * QED doesn't support catalogs
1928: *
1929: * @return false
1930: */
1931: public boolean supportsCatalogsInDataManipulation() {
1932: return false;
1933: }
1934:
1935: /**
1936: * QED doesn't support catalogs
1937: *
1938: * @return false
1939: */
1940: public boolean supportsCatalogsInIndexDefinitions()
1941: throws SQLException {
1942: return false;
1943: }
1944:
1945: /**
1946: * QED doesn't support catalogs
1947: *
1948: * @return false
1949: */
1950: public boolean supportsCatalogsInPrivilegeDefinitions() {
1951: return false;
1952: }
1953:
1954: /**
1955: * QED doesn't support catalogs
1956: *
1957: * @return false
1958: */
1959: public boolean supportsCatalogsInProcedureCalls() {
1960: return false;
1961: }
1962:
1963: /**
1964: * QED doesn't support catalogs
1965: *
1966: * @return false
1967: */
1968: public boolean supportsCatalogsInTableDefinitions() {
1969: return false;
1970: }
1971:
1972: /**
1973: * QED supports column aliasing via the <code>AS</code> clause
1974: * of the <code>SELECT</code> statement.
1975: *
1976: * @return true
1977: */
1978: public boolean supportsColumnAliasing() {
1979: return true;
1980: }
1981:
1982: /**
1983: * This QED release doesn't implement the <code>CONVERT</code>
1984: * function. Use the SQL
1985: * <code>CAST <i>expression</i> AS <i>type</i></code> construct
1986: * instead.
1987: *
1988: * @return false
1989: */
1990: public boolean supportsConvert() {
1991: return true;
1992: }
1993:
1994: /**
1995: * This QED release doesn't implement the <code>CONVERT</code>
1996: * function. Use the SQL
1997: * <code>CAST <i>expression</i> AS <i>type</i></code> construct
1998: * instead.
1999: *
2000: * @param fromType the type to convert from
2001: * @param toType the type to conver to
2002: * @return false
2003: */
2004: public boolean supportsConvert(int fromType, int toType) {
2005: return true;
2006: }
2007:
2008: /**
2009: * QED supports everything in the ODBC Core SQL grammar except
2010: * <code>GRANT</code> and <code>REVOKE</code>.
2011: *
2012: * @return false
2013: */
2014: public boolean supportsCoreSQLGrammar() {
2015: return false;
2016: }
2017:
2018: /**
2019: * QED supports correlated sub-queries
2020: *
2021: * @return true
2022: */
2023: public boolean supportsCorrelatedSubqueries() {
2024: return true;
2025: }
2026:
2027: /**
2028: * Both data definition statements and data manipulation statements
2029: * can be arbitrarily mixed within a transaction.
2030: *
2031: * @return true
2032: */
2033: public boolean supportsDataDefinitionAndDataManipulationTransactions() {
2034: return true;
2035: }
2036:
2037: /**
2038: * The JDBC spec says that this function should return true if
2039: * <blockquote>
2040: * this database supports only data manipulation statements within
2041: * a transaction
2042: * </blockquote>.
2043: *
2044: * It's not clear what this is supposed to mean. (If data definition
2045: * statements can be included in a transaction, should this function
2046: * return <code>false</code>?).
2047: *
2048: * In any case QED allows transactions that contain only data
2049: * manipulation statements, so this function returns <code>true</code>.
2050: *
2051: * @return true
2052: */
2053: public boolean supportsDataManipulationTransactionsOnly() {
2054: return true;
2055: }
2056:
2057: /**
2058: * Table correlation names are supported in QED, but they are not
2059: * required to be different from the names of the source tables,
2060: * so this function returns <code>false</code>.
2061: *
2062: * @return false
2063: */
2064: public boolean supportsDifferentTableCorrelationNames() {
2065: return false;
2066: }
2067:
2068: /**
2069: * In QED, <code>ORDER BY</code> clauses must specify column names
2070: *
2071: * @return false
2072: */
2073: public boolean supportsExpressionsInOrderBy() {
2074: return false;
2075: }
2076:
2077: /**
2078: * QED doesn't fully support the ODBC Extended SQL grammar
2079: *
2080: * @return false
2081: */
2082: public boolean supportsExtendedSQLGrammar() {
2083: return false;
2084: }
2085:
2086: /**
2087: * QED supports full nested outer joins
2088: *
2089: * @return true
2090: */
2091: public boolean supportsFullOuterJoins() {
2092: return true;
2093: }
2094:
2095: /**
2096: * QED supports <code>GROUP BY</code>
2097: *
2098: * @return true
2099: */
2100: public boolean supportsGroupBy() {
2101: return true;
2102: }
2103:
2104: /**
2105: * In QED, the <code>GROUP BY</code> clause can only specify columns
2106: * that are in the <code>SELECT</code> clause.
2107: *
2108: * @return false
2109: */
2110: public boolean supportsGroupByBeyondSelect() {
2111: return false;
2112: }
2113:
2114: /**
2115: * In QED, the <code>GROUP BY</code> clause can only specify columns
2116: * that are in the <code>SELECT</code> clause.
2117: *
2118: * @return false
2119: */
2120: public boolean supportsGroupByUnrelated() {
2121: return false;
2122: }
2123:
2124: /**
2125: * QED supports the SQL "integrity enhancement facility"
2126: *
2127: * @return true
2128: */
2129: public boolean supportsIntegrityEnhancementFacility() {
2130: return false;
2131: }
2132:
2133: /**
2134: * QED supports the <code>LIKE</code> escape clause using the standard
2135: * SQL-92 escape syntax.
2136: *
2137: * @return true
2138: */
2139: public boolean supportsLikeEscapeClause() {
2140: return true;
2141: }
2142:
2143: /**
2144: * Since <code>supportsFullOuterJoins()</code> returns <code>true</code>,
2145: * this method should return <code>true</code> as well. And so it
2146: * does.
2147: *
2148: * @return true
2149: */
2150: public boolean supportsLimitedOuterJoins() {
2151: return true;
2152: }
2153:
2154: /**
2155: * QED supports the ODBC Minimum SQL grammar
2156: *
2157: * @return true
2158: */
2159: public boolean supportsMinimumSQLGrammar() {
2160: return true;
2161: }
2162:
2163: /**
2164: * QED converts mixed case identifiers to upper case for storage
2165: * in the metadata structures.
2166: *
2167: * @return false
2168: */
2169: public boolean supportsMixedCaseIdentifiers() {
2170: return false;
2171: }
2172:
2173: /**
2174: * QED converts mixed case quoted identifiers to upper case for storage
2175: * in the metadata structures.
2176: *
2177: * @return false
2178: */
2179: public boolean supportsMixedCaseQuotedIdentifiers() {
2180: return true;
2181: }
2182:
2183: /**
2184: * This QED release supports only a single active result set per
2185: * <code>Statement</code>.
2186: *
2187: * @return false
2188: */
2189: public boolean supportsMultipleResultSets() {
2190: return true;
2191: }
2192:
2193: /**
2194: * QED supports multiple simultaneous transactions (on different
2195: * connections)
2196: *
2197: * @return true
2198: */
2199: public boolean supportsMultipleTransactions() {
2200: return true;
2201: }
2202:
2203: /**
2204: * QED supports definining columns as non-nullable, via the
2205: * standard SQL-92 <code>NOT NULL</code> constraint.
2206: *
2207: * @return true
2208: */
2209: public boolean supportsNonNullableColumns() {
2210: return true;
2211: }
2212:
2213: /**
2214: * A commit causes any open cursors in this connection to be closed
2215: *
2216: * @return false
2217: */
2218: public boolean supportsOpenCursorsAcrossCommit() {
2219: return false;
2220: }
2221:
2222: /**
2223: * A rollback causes any open cursors in this connection to be closed
2224: *
2225: * @return false
2226: */
2227: public boolean supportsOpenCursorsAcrossRollback() {
2228: return false;
2229: }
2230:
2231: /**
2232: * Statements per se are not closed by QED on commit, but the
2233: * <code>ResultSet</code> associated with a statement is.
2234: *
2235: * @return true
2236: */
2237: public boolean supportsOpenStatementsAcrossCommit() {
2238: return true;
2239: }
2240:
2241: /**
2242: * Statements per se are not closed by QED on rollback, but the
2243: * <code>ResultSet</code> associated with a statement is.
2244: *
2245: * @return true
2246: */
2247: public boolean supportsOpenStatementsAcrossRollback() {
2248: return true;
2249: }
2250:
2251: /**
2252: * In QED, the <code>ORDER BY</code> clause can only specify columns
2253: * that are in the <code>SELECT</code> clause.
2254: *
2255: * @return false
2256: */
2257: public boolean supportsOrderByUnrelated() {
2258: return false;
2259: }
2260:
2261: /**
2262: * QED supports the full set of SQL-92 outer join operations.
2263: *
2264: * @return true
2265: */
2266: public boolean supportsOuterJoins() {
2267: return true;
2268: }
2269:
2270: /**
2271: * QED supports positioned <code>DELETE</code> statements.
2272: *
2273: * @return true
2274: */
2275: public boolean supportsPositionedDelete() {
2276: return true;
2277: }
2278:
2279: /**
2280: * QED supports positioned <code>UPDATE</code> statements.
2281: *
2282: * @return true
2283: */
2284: public boolean supportsPositionedUpdate() {
2285: return true;
2286: }
2287:
2288: /**
2289: * QED supports using schema names in data manipulation statements.
2290: *
2291: * @return true
2292: */
2293: public boolean supportsSchemasInDataManipulation() {
2294: return true;
2295: }
2296:
2297: /**
2298: * QED supports using schema names in index definition statements.
2299: *
2300: * @return true
2301: */
2302: public boolean supportsSchemasInIndexDefinitions() {
2303: return true;
2304: }
2305:
2306: /**
2307: * QED doesn't support privilege definitions.
2308: *
2309: * @return false
2310: */
2311: public boolean supportsSchemasInPrivilegeDefinitions() {
2312: return false;
2313: }
2314:
2315: /**
2316: * QED doesn't support stored procedures
2317: *
2318: * @return false
2319: */
2320: public boolean supportsSchemasInProcedureCalls() {
2321: return false;
2322: }
2323:
2324: /**
2325: * QED supports using schema names in table definition statements.
2326: *
2327: * @return true
2328: */
2329: public boolean supportsSchemasInTableDefinitions() {
2330: return true;
2331: }
2332:
2333: /**
2334: * QED supports the <code>SELECT ... FOR UPDATE</code> statement.
2335: *
2336: * @return true
2337: */
2338: public boolean supportsSelectForUpdate() {
2339: return true;
2340: }
2341:
2342: /**
2343: * QED doesn't support stored procedures
2344: *
2345: * @return false
2346: */
2347: public boolean supportsStoredProcedures() {
2348: return false;
2349: }
2350:
2351: /**
2352: * QED supports sub-queries in comparisons
2353: *
2354: * @return true
2355: */
2356: public boolean supportsSubqueriesInComparisons() {
2357: return true;
2358: }
2359:
2360: /**
2361: * QED supports sub-queries in <code>EXISTS</code> expressions
2362: *
2363: * @return true
2364: */
2365: public boolean supportsSubqueriesInExists() {
2366: return true;
2367: }
2368:
2369: /**
2370: * QED supports sub-queries in <code>IN</code> expressions
2371: *
2372: * @return true
2373: */
2374: public boolean supportsSubqueriesInIns() {
2375: return true;
2376: }
2377:
2378: /**
2379: * QED supports sub-queries in quantified expressions
2380: *
2381: * @return true
2382: */
2383: public boolean supportsSubqueriesInQuantifieds() {
2384: return true;
2385: }
2386:
2387: /**
2388: * QED supports table correlation names
2389: *
2390: * @return true
2391: */
2392: public boolean supportsTableCorrelationNames() {
2393: return true;
2394: }
2395:
2396: /**
2397: * This release of QED only supports the transaction level
2398: * <code>Connection.TRANSACTION_SERIALIZABLE</code>
2399: *
2400: * @return true if
2401: * <code>level == Connection.TRANSACTION_SERIALIZABLE</code>
2402: */
2403: public boolean supportsTransactionIsolationLevel(int level) {
2404: return level == Connection.TRANSACTION_SERIALIZABLE;
2405: }
2406:
2407: /**
2408: * QED supports transactions
2409: *
2410: * @return true
2411: */
2412: public boolean supportsTransactions() {
2413: return true;
2414: }
2415:
2416: /**
2417: * QED supports <code>UNION</code>
2418: *
2419: * @return true
2420: */
2421: public boolean supportsUnion() {
2422: return true;
2423: }
2424:
2425: /**
2426: * QED supports <code>UNION ALL</code>
2427: *
2428: * @return true
2429: */
2430: public boolean supportsUnionAll() {
2431: return true;
2432: }
2433:
2434: /**
2435: * This release of QED doesn't fully support detection of updates
2436: *
2437: * @param type the <code>ResultSet</code> type
2438: *
2439: * @return false
2440: */
2441: public boolean updatesAreDetected(int type) {
2442: return false;
2443: }
2444:
2445: /**
2446: * QED doesn't use a separate file per table
2447: *
2448: * @return false
2449: */
2450: public boolean usesLocalFilePerTable() {
2451: return false;
2452: }
2453:
2454: /**
2455: * QED uses local files to store the database, the lock file,
2456: * and the transaction logs.
2457: *
2458: * @return true
2459: */
2460: public boolean usesLocalFiles() {
2461: return true;
2462: }
2463:
2464: //#ifndef JDK11
2465: /**
2466: * This release of QED supports <code>TYPE_FORWARD_ONLY</code>
2467: * <code>ResultSet</code>s, with either
2468: * <code>ResultSet.CONCUR_READ_ONLY</code> or
2469: * <code>ResultSet.CONCUR_UPDATABLE</code> concurrency
2470: *
2471: * @param type the <code>ResultSet</code> type
2472: * @param concurrency the concurrency level
2473: *
2474: * @return true if the type == <code>ResultSet.TYPE_FORWARD_ONLY</code>.
2475: */
2476: public boolean supportsResultSetConcurrency(int type,
2477: int concurrency) {
2478: return supportsResultSetType(type);
2479: }
2480:
2481: /**
2482: * This release of QED supports <code>TYPE_FORWARD_ONLY</code>
2483: * <code>ResultSet</code>s.
2484: *
2485: * @param type the <code>ResultSet</code> type
2486: *
2487: * @return true if the type == <code>ResultSet.TYPE_FORWARD_ONLY</code>.
2488: */
2489: public boolean supportsResultSetType(int type) {
2490: return type == ResultSet.TYPE_FORWARD_ONLY;
2491: }
2492:
2493: //#endif
2494:
2495: // ------------------- JDBC 3.0 -------------------------
2496:
2497: //#ifdef JDK14
2498: /**
2499: * Retrieves whether this database supports savepoints.
2500: *
2501: * @return <code>true</code> if savepoints are supported;
2502: * <code>false</code> otherwise
2503: * @exception SQLException if a database access error occurs
2504: * @since 1.4
2505: */
2506: public boolean supportsSavepoints() throws SQLException {
2507: return false;
2508: }
2509:
2510: /**
2511: * Retrieves whether this database supports named parameters to callable
2512: * statements.
2513: *
2514: * @return <code>true</code> if named parameters are supported;
2515: * <code>false</code> otherwise
2516: * @exception SQLException if a database access error occurs
2517: * @since 1.4
2518: */
2519: public boolean supportsNamedParameters() throws SQLException {
2520: return false;
2521: }
2522:
2523: /**
2524: * Retrieves whether it is possible to have multiple
2525: * <code>ResultSet</code> objects
2526: * returned from a <code>CallableStatement</code> object
2527: * simultaneously.
2528: *
2529: * @return <code>true</code> if a <code>CallableStatement</code> object
2530: * can return multiple <code>ResultSet</code> objects
2531: * simultaneously; <code>false</code> otherwise
2532: * @exception SQLException if a datanase access error occurs
2533: * @since 1.4
2534: */
2535: public boolean supportsMultipleOpenResults() throws SQLException {
2536: return false;
2537: }
2538:
2539: /**
2540: * Retrieves whether auto-generated keys can be retrieved after
2541: * a statement has been executed.
2542: *
2543: * @return <code>true</code> if auto-generated keys can be retrieved
2544: * after a statement has executed; <code>false</code> otherwise
2545: * @exception SQLException if a database access error occurs
2546: * @since 1.4
2547: */
2548: public boolean supportsGetGeneratedKeys() throws SQLException {
2549: return false;
2550: }
2551:
2552: /**
2553: * Retrieves a description of the user-defined type (UDT) hierarchies
2554: * defined in a
2555: * particular schema in this database. Only the immediate super type/
2556: * sub type relationship is modeled.
2557: * <P>
2558: * Only supertype information for UDTs matching the catalog,
2559: * schema, and type name is returned. The type name parameter
2560: * may be a fully-qualified name. When the UDT name supplied is a
2561: * fully-qualified name, the catalog and schemaPattern parameters are
2562: * ignored.
2563: * <P>
2564: * If a UDT does not have a direct super type, it is not listed here.
2565: * A row of the <code>ResultSet</code> object returned by this method
2566: * describes the designated UDT and a direct supertype. A row has the
2567: * following
2568: * columns:
2569: * <OL>
2570: * <LI><B>TYPE_CAT</B> String => the UDT's catalog (may be
2571: * <code>null</code>)
2572: * <LI><B>TYPE_SCHEM</B> String => UDT's schema (may be
2573: * <code>null</code>)
2574: * <LI><B>TYPE_NAME</B> String => type name of the UDT
2575: * <LI><B>SUPERTYPE_CAT</B> String => the direct super type's catalog
2576: * (may be <code>null</code>)
2577: * <LI><B>SUPERTYPE_SCHEM</B> String => the direct super type's schema
2578: * (may be <code>null</code>)
2579: * <LI><B>SUPERTYPE_NAME</B> String => the direct super type's name
2580: * </OL>
2581: *
2582: * <P><B>Note:</B> If the driver does not support type hierarchies, an
2583: * empty result set is returned.
2584: *
2585: * @param catalog a catalog name; "" retrieves those without a catalog;
2586: * <code>null</code> means drop catalog name from the selection
2587: * criteria
2588: * @param schemaPattern a schema name pattern; "" retrieves those
2589: * without a schema
2590: * @param typeNamePattern a UDT name pattern; may be a fully-qualified
2591: * name
2592: * @return a <code>ResultSet</code> object in which a row gives information
2593: * about the designated UDT
2594: * @throws SQLException if a database access error occurs
2595: * @since 1.4
2596: */
2597: public java.sql.ResultSet getSuperTypes(String catalog,
2598: String schemaPattern, String typeNamePattern)
2599: throws SQLException {
2600: throw new SQLException("Not implemented");
2601: }
2602:
2603: /**
2604: * Retrieves a description of the table hierarchies defined in a
2605: * particular
2606: * schema in this database.
2607: *
2608: * <P>Only supertable information for tables matching the catalog, schema
2609: * and table name are returned. The table name parameter may be a fully-
2610: * qualified name, in which case, the catalog and schemaPattern parameters
2611: * are ignored. If a table does not have a super table, it is not
2612: * listed here.
2613: * Supertables have to be defined in the same catalog and schema as the
2614: * sub tables. Therefore, the type description does not need to include
2615: * this information for the supertable.
2616: *
2617: * <P>Each type description has the following columns:
2618: * <OL>
2619: * <LI><B>TABLE_CAT</B> String => the type's catalog (may be
2620: * <code>null</code>)
2621: * <LI><B>TABLE_SCHEM</B> String => type's schema (may be
2622: * <code>null</code>)
2623: * <LI><B>TABLE_NAME</B> String => type name
2624: * <LI><B>SUPERTABLE_NAME</B> String => the direct super type's name
2625: * </OL>
2626: *
2627: * <P><B>Note:</B> If the driver does not support type hierarchies, an
2628: * empty result set is returned.
2629: *
2630: * @param catalog a catalog name; "" retrieves those without a catalog;
2631: * <code>null</code> means drop catalog name from the selection
2632: * criteria
2633: * @param schemaPattern a schema name pattern; "" retrieves those
2634: * without a schema
2635: * @param tableNamePattern a table name pattern; may be a fully-qualified
2636: * name
2637: * @return a <code>ResultSet</code> object in which each row is a type
2638: * description
2639: * @throws SQLException if a database access error occurs
2640: * @since 1.4
2641: */
2642: public java.sql.ResultSet getSuperTables(String catalog,
2643: String schemaPattern, String tableNamePattern)
2644: throws SQLException {
2645: throw new SQLException("Not implemented");
2646: }
2647:
2648: /**
2649: * Indicates that <code>NULL</code> values might not be allowed.
2650: * <P>
2651: * A possible value for the column
2652: * <code>NULLABLE</code> in the <code>ResultSet</code> object
2653: * returned by the method <code>getAttributes</code>.
2654: */
2655: //short attributeNoNulls = 0;
2656: /**
2657: * Indicates that <code>NULL</code> values are definitely allowed.
2658: * <P>
2659: * A possible value for the column <code>NULLABLE</code>
2660: * in the <code>ResultSet</code> object
2661: * returned by the method <code>getAttributes</code>.
2662: */
2663: //short attributeNullable = 1;
2664: /**
2665: * Indicates that whether <code>NULL</code> values are allowed is not
2666: * known.
2667: * <P>
2668: * A possible value for the column <code>NULLABLE</code>
2669: * in the <code>ResultSet</code> object
2670: * returned by the method <code>getAttributes</code>.
2671: */
2672: //short attributeNullableUnknown = 2;
2673: /**
2674: * Retrieves a description of the given attribute of the given type
2675: * for a user-defined type (UDT) that is available in the given schema
2676: * and catalog.
2677: * <P>
2678: * Descriptions are returned only for attributes of UDTs matching the
2679: * catalog, schema, type, and attribute name criteria. They are ordered by
2680: * TYPE_SCHEM, TYPE_NAME and ORDINAL_POSITION. This description
2681: * does not contain inherited attributes.
2682: * <P>
2683: * The <code>ResultSet</code> object that is returned has the following
2684: * columns:
2685: * <OL>
2686: * <LI><B>TYPE_CAT</B> String => type catalog (may be <code>null</code>)
2687: * <LI><B>TYPE_SCHEM</B> String => type schema (may be <code>null</code>)
2688: * <LI><B>TYPE_NAME</B> String => type name
2689: * <LI><B>ATTR_NAME</B> String => attribute name
2690: * <LI><B>DATA_TYPE</B> short => attribute type SQL type from
2691: * java.sql.Types
2692: * <LI><B>ATTR_TYPE_NAME</B> String => Data source dependent type name.
2693: * For a UDT, the type name is fully qualified. For a REF, the type
2694: * name is
2695: * fully qualified and represents the target type of the reference type.
2696: * <LI><B>ATTR_SIZE</B> int => column size. For char or date
2697: * types this is the maximum number of characters; for numeric or
2698: * decimal types this is precision.
2699: * <LI><B>DECIMAL_DIGITS</B> int => the number of fractional digits
2700: * <LI><B>NUM_PREC_RADIX</B> int => Radix (typically either 10 or 2)
2701: * <LI><B>NULLABLE</B> int => whether NULL is allowed
2702: * <UL>
2703: * <LI> attributeNoNulls - might not allow NULL values
2704: * <LI> attributeNullable - definitely allows NULL values
2705: * <LI> attributeNullableUnknown - nullability unknown
2706: * </UL>
2707: * <LI><B>REMARKS</B> String => comment describing column (may be
2708: * <code>null</code>)
2709: * <LI><B>ATTR_DEF</B> String => default value (may be <code>null</code>)
2710: * <LI><B>SQL_DATA_TYPE</B> int => unused
2711: * <LI><B>SQL_DATETIME_SUB</B> int => unused
2712: * <LI><B>CHAR_OCTET_LENGTH</B> int => for char types the
2713: * maximum number of bytes in the column
2714: * <LI><B>ORDINAL_POSITION</B> int => index of column in table
2715: * (starting at 1)
2716: * <LI><B>IS_NULLABLE</B> String => "NO" means column definitely
2717: * does not allow NULL values; "YES" means the column might
2718: * allow NULL values. An empty string means unknown.
2719: * <LI><B>SCOPE_CATALOG</B> String => catalog of table that is the
2720: * scope of a reference attribute (<code>null</code> if DATA_TYPE
2721: * isn't REF)
2722: * <LI><B>SCOPE_SCHEMA</B> String => schema of table that is the
2723: * scope of a reference attribute (<code>null</code> if DATA_TYPE
2724: * isn't REF)
2725: * <LI><B>SCOPE_TABLE</B> String => table name that is the scope of a
2726: * reference attribute (<code>null</code> if the DATA_TYPE isn't REF)
2727: * <LI><B>SOURCE_DATA_TYPE</B> short => source type of a distinct type or
2728: * user-generated
2729: * Ref type,SQL type from java.sql.Types (<code>null</code> if
2730: * DATA_TYPE
2731: * isn't DISTINCT or user-generated REF)
2732: * </OL>
2733: * @param catalog a catalog name; must match the catalog name as it
2734: * is stored in the database; "" retrieves those without a catalog;
2735: * <code>null</code> means that the catalog name should not be
2736: * used to narrow
2737: * the search
2738: * @param schemaPattern a schema name pattern; must match the schema name
2739: * as it is stored in the database; "" retrieves those without a
2740: * schema;
2741: * <code>null</code> means that the schema name should not be
2742: * used to narrow
2743: * the search
2744: * @param typeNamePattern a type name pattern; must match the
2745: * type name as it is stored in the database
2746: * @param attributeNamePattern an attribute name pattern; must match
2747: * the attribute
2748: * name as it is declared in the database
2749: * @return a <code>ResultSet</code> object in which each row is an
2750: * attribute description
2751: * @exception SQLException if a database access error occurs
2752: * @since 1.4
2753: */
2754: public java.sql.ResultSet getAttributes(String catalog,
2755: String schemaPattern, String typeNamePattern,
2756: String attributeNamePattern) throws SQLException {
2757: throw new SQLException("Not implemented");
2758: }
2759:
2760: /**
2761: * Retrieves whether this database supports the given result set
2762: * holdability.
2763: *
2764: * @param holdability one of the following constants:
2765: * <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
2766: * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT<code>
2767: * @return <code>true</code> if so; <code>false</code> otherwise
2768: * @exception SQLException if a database access error occurs
2769: * @see Connection
2770: * @since 1.4
2771: */
2772: public boolean supportsResultSetHoldability(int holdability)
2773: throws SQLException {
2774: return (holdability == ResultSet.CLOSE_CURSORS_AT_COMMIT);
2775: }
2776:
2777: /**
2778: * Retrieves the default holdability of this <code>ResultSet</code>
2779: * object.
2780: *
2781: * @return the default holdability; either
2782: * <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
2783: * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
2784: * @exception SQLException if a database access error occurs
2785: * @since 1.4
2786: */
2787: public int getResultSetHoldability() throws SQLException {
2788: return ResultSet.CLOSE_CURSORS_AT_COMMIT;
2789: }
2790:
2791: /**
2792: * Retrieves the major version number of the underlying database.
2793: *
2794: * @return the underlying database's major version
2795: * @exception SQLException if a database access error occurs
2796: * @since 1.4
2797: */
2798: public int getDatabaseMajorVersion() throws SQLException {
2799: return Version.majorVersion;
2800: }
2801:
2802: /**
2803: * Retrieves the minor version number of the underlying database.
2804: *
2805: * @return underlying database's minor version
2806: * @exception SQLException if a database access error occurs
2807: * @since 1.4
2808: */
2809: public int getDatabaseMinorVersion() throws SQLException {
2810: return Version.minorVersion;
2811: }
2812:
2813: /**
2814: * Retrieves the major JDBC version number for this
2815: * driver.
2816: *
2817: * @return JDBC version major number
2818: * @exception SQLException if a database access error occurs
2819: * @since 1.4
2820: */
2821: public int getJDBCMajorVersion() throws SQLException {
2822: return 3;
2823: }
2824:
2825: /**
2826: * Retrieves the minor JDBC version number for this
2827: * driver.
2828: *
2829: * @return JDBC version minor number
2830: * @exception SQLException if a database access error occurs
2831: * @since 1.4
2832: */
2833: public int getJDBCMinorVersion() throws SQLException {
2834: return 0;
2835: }
2836:
2837: /**
2838: * Indicates that the value is an
2839: * X/Open (now know as Open Group) SQL CLI SQLSTATE value.
2840: * <P>
2841: * A possible return value for the method
2842: * <code>SQLException.getSQLState</code>.
2843: * @since 1.4
2844: */
2845: //int sqlStateXOpen = 1;
2846: /**
2847: * Indicates that the value is an SQL99 SQLSTATE value.
2848: * <P>
2849: * A possible return value for the method
2850: * <code>SQLException.getSQLState</code>.
2851: * @since 1.4
2852: */
2853: //int sqlStateSQL99 = 2;
2854: /**
2855: * Indicates whether the SQLSTATEs returned by
2856: * <code>SQLException.getSQLState</code>
2857: * is X/Open (now known as Open Group) SQL CLI or SQL99.
2858: * @return the type of SQLSTATEs, one of:
2859: * sqlStateXOpen or
2860: * sqlStateSQL99
2861: * @throws SQLException if a database access error occurs
2862: * @since 1.4
2863: */
2864: public int getSQLStateType() throws SQLException {
2865: return sqlStateXOpen;
2866: }
2867:
2868: /**
2869: * Indicates whether updates made to a LOB are made on a copy or directly
2870: * to the LOB.
2871: * @return <code>true</code> if updates are made to a copy of the LOB;
2872: * <code>false</code> if updates are made directly to the LOB
2873: * @throws SQLException if a database access error occurs
2874: * @since 1.4
2875: */
2876: public boolean locatorsUpdateCopy() throws SQLException {
2877: return true;
2878: }
2879:
2880: /**
2881: * Retrieves weather this database supports statement pooling.
2882: *
2883: * @return <code>true</code> is so;
2884: <code>false</code> otherwise
2885: * @throws SQLExcpetion if a database access error occurs
2886: * @since 1.4
2887: */
2888: public boolean supportsStatementPooling() throws SQLException {
2889: return false;
2890: }
2891: //#endif
2892: }
|