KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > quadcap > jdbc > DatabaseMetaData


1 package com.quadcap.jdbc;
2
3 /* Copyright 1999 - 2003 Quadcap Software. All rights reserved.
4  *
5  * This software is distributed under the Quadcap Free Software License.
6  * This software may be used or modified for any purpose, personal or
7  * commercial. Open Source redistributions are permitted. Commercial
8  * redistribution of larger works derived from, or works which bundle
9  * this software requires a "Commercial Redistribution License"; see
10  * http://www.quadcap.com/purchase.
11  *
12  * Redistributions qualify as "Open Source" under one of the following terms:
13  *
14  * Redistributions are made at no charge beyond the reasonable cost of
15  * materials and delivery.
16  *
17  * Redistributions are accompanied by a copy of the Source Code or by an
18  * irrevocable offer to provide a copy of the Source Code for up to three
19  * years at the cost of materials and delivery. Such redistributions
20  * must allow further use, modification, and redistribution of the Source
21  * Code under substantially the same terms as this license.
22  *
23  * Redistributions of source code must retain the copyright notices as they
24  * appear in each source code file, these license terms, and the
25  * disclaimer/limitation of liability set forth as paragraph 6 below.
26  *
27  * Redistributions in binary form must reproduce this Copyright Notice,
28  * these license terms, and the disclaimer/limitation of liability set
29  * forth as paragraph 6 below, in the documentation and/or other materials
30  * provided with the distribution.
31  *
32  * The Software is provided on an "AS IS" basis. No warranty is
33  * provided that the Software is free of defects, or fit for a
34  * particular purpose.
35  *
36  * Limitation of Liability. Quadcap Software shall not be liable
37  * for any damages suffered by the Licensee or any third party resulting
38  * from use of the Software.
39  */

40
41 import java.io.IOException JavaDoc;
42
43 import java.sql.SQLException JavaDoc;
44
45 import com.quadcap.sql.Database;
46 import com.quadcap.sql.Expression;
47 import com.quadcap.sql.Session;
48 import com.quadcap.sql.SQLParser;
49 import com.quadcap.sql.Version;
50
51 import com.quadcap.sql.types.ValuePattern;
52
53 import com.quadcap.sql.meta.MetaBestRowId;
54 import com.quadcap.sql.meta.MetaColumns;
55 import com.quadcap.sql.meta.MetaCrossReference;
56 import com.quadcap.sql.meta.MetaCursor;
57 import com.quadcap.sql.meta.MetaIndexInfo;
58 import com.quadcap.sql.meta.MetaPrimaryKeys;
59 import com.quadcap.sql.meta.MetaTableTypes;
60 import com.quadcap.sql.meta.MetaTables;
61 import com.quadcap.sql.meta.MetaTypes;
62
63 /**
64  * This class implements the <code>java.sql.DatabaseMetaData</code> interface,
65  * which provides a way for the JDBC application to determine which features
66  * a database supports and also a way to explore the database schema, through
67  * information analagous to the SQL "INFORMATION_SCHEMA".
68  *
69  * @author Stan Bailes
70  */

71 public class DatabaseMetaData implements java.sql.DatabaseMetaData JavaDoc {
72     Database database;
73     com.quadcap.sql.Connection qConn;
74     Session session;
75     Connection connection;
76
77     DatabaseMetaData(Connection connection) throws IOException JavaDoc, SQLException JavaDoc {
78     this.connection = connection;
79         this.qConn = connection.getConnection();
80     this.session = qConn.createSession();
81     this.database = connection.getDatabase();
82     }
83
84     /**
85      * Return true if the current user has the privileges necessary to
86      * invoke all procedures returned by <code>getProcedures()</code>.
87      * Since QED doesn't support access privileges,
88      * this function always returns false, though since it doesn't support
89      * stored procedures, this isn't likely to matter.
90      *
91      * @return true
92      */

93     public boolean allProceduresAreCallable() {
94     return true;
95     }
96     
97     /**
98      * Return true if the current user can use a <code>SELECT</code>
99      * statement with all tables returned by <code>getTables()</code>.
100      * Since QED doesn't support access privileges, this function always
101      * returns true.
102      *
103      * @return true
104      */

105     public boolean allTablesAreSelectable() {
106     return true;
107     }
108     
109     /**
110      * A data definition statement within a transaction does not force
111      * a commit in QED.
112      *
113      * @return false
114      */

115     public boolean dataDefinitionCausesTransactionCommit() {
116     return false;
117     }
118     
119     /**
120      * Data definition statements within transactions are not ignored
121      * in QED.
122      *
123      * @return false
124      */

125     public boolean dataDefinitionIgnoredInTransactions() {
126     return false;
127     }
128     
129     /**
130      * For all types of ResultSets, deleted rows are simply removed
131      * from the ResultSet, so this function always returns false.
132      *
133      * @return false
134      */

135     public boolean deletesAreDetected(int type) {
136     return false;
137     }
138     
139     /**
140      * QED doesn't impose any maximum row size, so this function is
141      * really a don't care, but we return true anyway.
142      *
143      * @return true
144      */

145     public boolean doesMaxRowSizeIncludeBlobs() {
146     return true;
147     }
148     
149     /**
150      * Return a resultset containing the set of columns that "best uniquely
151      * identify a row". In QED, this is interpreted to mean the 'primary key'
152      * constraint, if specified, otherwise a 'unique' constraint, maybe...
153      *
154      * @return the specified ResultSet
155      * @exception SQLException may be thrown
156      */

157     public java.sql.ResultSet JavaDoc getBestRowIdentifier(
158     String JavaDoc catalog, String JavaDoc schema, String JavaDoc table, int scope,
159     boolean nullable)
160     throws SQLException JavaDoc
161     {
162         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
163         if (schema != null && schema.trim().length() > 0) {
164             sb.append(schema.trim());
165             sb.append('.');
166         }
167         if (table != null) sb.append(table);
168         MetaBestRowId mt = new MetaBestRowId(session, sb.toString(),
169                                              scope, nullable);
170         return new ResultSet(mt);
171     }
172     
173     /**
174      * QED doesn't support catalogs, so there is no separator.
175      *
176      * @return the empty string
177      */

178     public String JavaDoc getCatalogSeparator() {
179     return "";
180     }
181     
182     /**
183      * Call it what you like, but QED doesn't support catalogs.
184      *
185      * @return "catalog"
186      */

187     public String JavaDoc getCatalogTerm() {
188     return "catalog";
189     }
190     
191     /**
192      * QED doesn't support catalogs, but we return an empty ResultSet
193      * of the right signature as a courtesy.
194      */

195     public java.sql.ResultSet JavaDoc getCatalogs()
196     throws SQLException JavaDoc
197     {
198     return new ResultSet(MetaCursor.find(session, "SYSTEM.CATALOGS"));
199     }
200     
201     /**
202      * QED doesn't support access controls, but we return an empty ResultSet
203      * of the right signature as a courtesy.
204      */

205     public java.sql.ResultSet JavaDoc
206     getColumnPrivileges(String JavaDoc catalog, String JavaDoc schema,
207             String JavaDoc table,
208             String JavaDoc columnNamePattern)
209     throws SQLException JavaDoc
210     {
211     return new ResultSet(MetaCursor.find(session,
212                                              "SYSTEM.COLUMNPRIVILEGES"));
213     }
214     
215     /**
216      * Helper function to handle a single metadata pattern matcher
217      */

218     final void doPattern(StringBuffer JavaDoc sb, String JavaDoc name, String JavaDoc pattern) {
219         if (pattern != null) {
220             if (sb.length() > 0) {
221                 sb.append(" and ");
222             }
223             sb.append(name);
224             sb.append(" like '");
225             sb.append(pattern.toUpperCase());
226             sb.append('\'');
227         }
228     }
229
230     /**
231      * Helper function to handle a single metadata string specifier
232      */

233     final void doString(StringBuffer JavaDoc sb, String JavaDoc name, String JavaDoc val) {
234         if (val != null) {
235             if (sb.length() > 0) {
236                 sb.append(" and ");
237             }
238             sb.append(name);
239             sb.append(" = '");
240             sb.append(val.toUpperCase());
241             sb.append('\'');
242         }
243     }
244                                      
245     /**
246      * This function returns a <code>ResultSet</code> object containing
247      * information about the specified columns.
248      *
249      * @param catalog not used
250      * @param schemaPattern a SQL "like" pattern. All schema names matching
251      * this pattern are selected. If this parameter is the empty
252      * string, all schemas are selected.
253      * @param tableNamePattern a SQL "like" pattern. All table names
254      * matching this pattern are selected.
255      * @param columnNamePattern a SQL "like" pattern. All column names
256      * matching this pattern are selected.
257      * @return a <code>ResultSet</code> object, with each row being a
258      * description of a table column.<p>
259      * The columns in the <code>ResultSet</code> object have the
260      * following definition:
261      *
262      * <variablelist>
263      * <varlistentry><term>1: TABLE_CAT</term>
264      * <listitem>
265      * <code>null</code> (Catalogs not supported by QED)</listitem>
266      * </varlistentry>
267      * <varlistentry><term>2: TABLE_SCHEM</term>
268      * <listitem>
269      * <code>String</code> giving the table's schema</listitem>
270      * </varlistentry>
271      * <varlistentry><term>3: TABLE_NAME</term>
272      * <listitem>
273      * <code>String</code> giving the table's name</listitem>
274      * </varlistentry>
275      * <varlistentry><term>4: COLUMN_NAME</term>
276      * <listitem>
277      * <code>String</code> giving the column name</listitem>
278      * </varlistentry>
279      * <varlistentry><term>5: DATA_TYPE</term>
280      * <listitem>
281      * <code>short</code> type from <code>java.sql.types</code></listitem>
282      * </varlistentry>
283      * <varlistentry><term>6: TYPE_NAME</term>
284      * <listitem>
285      * <code>String</code> giving the SQL type</listitem>
286      * </varlistentry>
287      * <varlistentry><term>7: COLUMN_SIZE</term>
288      * <listitem>
289      * <code>int</code> For numeric types, this is the precision;
290      * for character types, it's the maximum width</listitem>
291      * </varlistentry>
292      * <varlistentry><term>8: BUFFER_LENGTH</term>
293      * <listitem>
294      * <code>null</code> unused</listitem>
295      * </varlistentry>
296      * <varlistentry><term>9: DECIMAL_DIGITS</term>
297      * <listitem>
298      * <code>int</code> For numeric types, the number of
299      * digits to the right of the decimal point.
300      * For other types, <code>-1</code></listitem>
301      * </varlistentry>
302      * <varlistentry><term>10: NUM_PREC_RADIX</term>
303      * <listitem>
304      * <code>int</code> 10</listitem>
305      * </varlistentry>
306      * <varlistentry><term>11: NULLABLE</term>
307      * <listitem>
308      * <code>int</code> One of: <ul>
309      * <li><code>ResultSetMetaData.columnNoNulls</code></li>
310      * <li><code>ResultSetMetaData.columnNullable</code></li>
311      * <li><code>ResultSetMetaData.columnNullableUnknown</code>
312      * </li></ul></listitem>
313      * </varlistentry>
314      * <varlistentry><term>12: REMARKS</term>
315      * <listitem>
316      * <code>null</code></listitem>
317      * </varlistentry>
318      * <varlistentry><term>13: COLUMN_DEF</term>
319      * <listitem>
320      * <code>String</code> The column's default value,
321      * cast to a <code>String</code>.
322      * <code>null</code> if the column doesn't have a default value</listitem>
323      * </varlistentry>
324      * <varlistentry><term>14: SQL_DATA_TYPE</term>
325      * <listitem>
326      * <code>null</code></listitem>
327      * </varlistentry>
328      * <varlistentry><term>15: SQL_DATETIME_SUB</term>
329      * <listitem>
330      * <code>null</code></listitem>
331      * </varlistentry>
332      * <varlistentry><term>16: CHAR_OCTET_LENGTH</term>
333      * <listitem>
334      * <code>int</code> For character types,
335      * two times the maximum number
336      * of characters in the column.
337      * <code>null</code> for other types.</listitem>
338      * </varlistentry>
339      * <varlistentry><term>17: ORDINAL_POSITION</term>
340      * <listitem>
341      * <code>int</code> The index of the column
342      * in its table.</listitem>
343      * </varlistentry>
344      * <varlistentry><term>18: IS_NULLABLE</term>
345      * <listitem>
346      * <code>String</code> One of <code>"NO"</code>,
347      * <code>"YES"</code>, or <code>""</code>
348      * </listitem>
349      * </varlistentry>
350      * </variablelist>
351      *
352      * @exception SQLException may be thrown.
353      */

354     public java.sql.ResultSet JavaDoc
355     getColumns(String JavaDoc catalog, String JavaDoc schemaPattern,
356            String JavaDoc tableNamePattern,
357            String JavaDoc columnNamePattern)
358     throws SQLException JavaDoc
359     {
360     if (schemaPattern == null || schemaPattern.equals("")) {
361         schemaPattern = null;
362     }
363     StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
364         doPattern(sb, "TABLE_SCHEM", schemaPattern);
365         doPattern(sb, "TABLE_NAME", tableNamePattern);
366         doPattern(sb, "COLUMN_NAME", columnNamePattern);
367     Expression ex = parseExpression(sb.toString());
368     MetaColumns mt = new MetaColumns(session, ex);
369     return new ResultSet(mt);
370     }
371
372     /**
373      * Return the <code>Connection</code> object that was used to create this
374      * <code>DatabaseMetaData</code> object.
375      *
376      * @return a Connection object
377      */

378     public java.sql.Connection JavaDoc getConnection() {
379     return connection;
380     }
381     
382     /**
383      * This function returns a <code>ResultSet</code> object containing
384      * information about the foreign key relationships in the database.
385      *
386      * @param primaryCatalog not used
387      * @param primarySchema a schema name. Used to specify the schema name
388      * of the table containing the primary key. <code>null</code>
389      * specifies all schemas.
390      * @param foreignCatalog not used
391      * @param foreignSchema a schema name. Used to specify the schema name
392      * of the table containing the foreign key. <code>null</code>
393      * specifies all schemas.
394      * @param foreignTable the name of the table containing the foreign key.
395      * @return a <code>ResultSet</code> object, with each row being a
396      * description of a foreign key column.<p>
397      * @exception SQLException may be thrown.
398      *
399      * The columns in the <code>ResultSet</code> object have the following
400      * definition:
401      * <p>
402      * <variablelist>
403      * <varlistentry><term>1: PKTABLE_CAT</term>
404      * <listitem>
405      * <code>null</code> (Catalogs not supported by QED)</listitem>
406      * </varlistentry>
407      * <varlistentry><term>2: PKTABLE_SCHEM</term>
408      * <listitem>
409      * <code>String</code> giving the schema of the
410      * primary key's table.</listitem>
411      * </varlistentry>
412      * <varlistentry><term>3: PKTABLE_NAME</term>
413      * <listitem>
414      * <code>String</code> giving the name of the
415      * primary key's table</listitem>
416      * </varlistentry>
417      * <varlistentry><term>4: PKCOLUMN_NAME</term>
418      * <listitem>
419      * <code>String</code> giving the column name
420      * of the primary key</listitem>
421      * </varlistentry>
422      * <varlistentry><term>5: FKTABLE_CAT</term>
423      * <listitem>
424      * <code>String</code> (An empty string in QED)</listitem>
425      * </varlistentry>
426      * <varlistentry><term>6: FKTABLE_SCHEM</term>
427      * <listitem>
428      * <code>String</code> giving the schema of
429      * the foreign key's table.</listitem>
430      * </varlistentry>
431      * <varlistentry><term>7: FKTABLE_NAME</term>
432      * <listitem>
433      * <code>String</code> giving the name of the
434      * foreign key's table</listitem>
435      * </varlistentry>
436      * <varlistentry><term>8: FKCOLUMN_NAME</term>
437      * <listitem>
438      * <code>String</code> giving the column name
439      * of the foreign key</listitem>
440      * </varlistentry>
441      * <varlistentry><term>9: KEY_SEQ</term>
442      * <listitem>
443      * <code>short</code> indicating the column number
444      * within the foreign key, if the foreign key has
445      * more than one column</listitem>
446      * </varlistentry>
447      * <varlistentry><term>10: UPDATE_RULE</term>
448      * <listitem>
449      * <code>short</code> indicating what happens when the
450      * primary key is updated: The values supported by QED
451      * are: <ul>
452      * <li><code>DatabaseMetaData.importedKeyRestrict</code></li>
453      * <li><code>DatabaseMetaData.importedKeyCascade</code></li>
454      * </ul></listitem>
455      * </varlistentry>
456      * <varlistentry><term>11: DELETE_RULE</term>
457      * <listitem>
458      * <code>short</code> indicating what happens when the
459      * primary key is deleted: The values supported by QED
460      * are: <ul>
461      * <li><code>DatabaseMetaData.importedKeyRestrict</code></li>
462      * <li><code>DatabaseMetaData.importedKeyCascade</code></li>
463      * </ul></listitem>
464      * </varlistentry>
465      * <varlistentry><term>12: FK_NAME</term>
466      * <listitem>
467      * <code>null</code></listitem>
468      * </varlistentry>
469      * <varlistentry><term>13: PK_NAME</term>
470      * <listitem>
471      * <code>null</code></listitem>
472      * </varlistentry>
473      * <varlistentry><term>14: DEFERRABILITY</term>
474      * <listitem>
475      * <code>short</code> indicating whether
476      * foreign key constraint
477      * checking can be deferred. One of: <ul>
478      * <li><code>DatabaseMetaData.importedKeyInitiallyDeferred</code></li>
479      * <li><code>DatabaseMetaData.importedKeyInitiallyImmediate</code></li>
480      * <li><code>DatabaseMetaData.importedKeyNotDeferrable</code></li>
481      * </ul>
482      * <p>This QED release remembers the deferability specification
483      * in the original DDL statement, but deferred constraint checking
484      * is not supported in this release.
485      *
486      * </listitem>
487      * </varlistentry>
488      * </variablelist>
489      */

490     public java.sql.ResultSet JavaDoc getCrossReference(String JavaDoc primaryCatalog,
491                         String JavaDoc primarySchema,
492                         String JavaDoc primaryTable,
493                         String JavaDoc foreignCatalog,
494                         String JavaDoc foreignSchema,
495                         String JavaDoc foreignTable)
496     throws SQLException JavaDoc
497     {
498     StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
499         doString(sb, "PKTABLE_SCHEM", primarySchema);
500         doString(sb, "PKTABLE_NAME", primaryTable);
501         doString(sb, "FKTABLE_SCHEM", foreignSchema);
502         doString(sb, "FKTABLE_NAME", foreignTable);
503     Expression ex = parseExpression(sb.toString());
504     MetaCrossReference mx = new MetaCrossReference(session, ex);
505     return new ResultSet(mx);
506     }
507     
508     /**
509      * Return the database product name, "QED"
510      *
511      * @return QED
512      */

513     public String JavaDoc getDatabaseProductName() {
514     return "QED";
515     }
516     
517     /**
518      * Return the version for this product. QED version strings are
519      * strings of the form <i>major.minor</i>, where <i>major</i>
520      * and <i>minor</i> are the driver major and minor version numbers
521      *
522      * @see #getDriverMajorVersion()
523      * @see #getDriverMinorVersion()
524      *
525      * @return the QED version string.
526      */

527     public String JavaDoc getDatabaseProductVersion() {
528     return "" + getDriverMajorVersion() + "." + getDriverMinorVersion();
529     }
530     
531     /**
532      * Return the default transaction isolation level. For QED, the
533      * default (and only supported) transaction isolation level is
534      * <code>Connection.TRANSACTION_SERIALIZABLE</code>.
535      *
536      * @returnt the default transaction isolation level.
537      */

538     public int getDefaultTransactionIsolation() {
539     return Connection.TRANSACTION_SERIALIZABLE;
540     }
541     
542     /**
543      * Return the driver major version number.
544      *
545      * @return the driver's major version number
546      */

547     public int getDriverMajorVersion() {
548     return Version.majorVersion;
549     }
550
551     /**
552      * Return the driver minor version number.
553      *
554      * @return the driver's minor version number
555      */

556     public int getDriverMinorVersion() { return Version.minorVersion; }
557     
558     /**
559      * Return the name of this JDBC driver
560      *
561      * @return the string <code>"com.quadcap.jdbc.JdbcDriver"</code>
562      */

563     public String JavaDoc getDriverName() {
564     return "com.quadcap.jdbc.JdbcDriver";
565     }
566
567     /**
568      * Return the version for this JDBC Driver. QED version strings are
569      * strings of the form <i>major.minor</i>, where <i>major</i>
570      * and <i>minor</i> are the driver major and minor version numbers
571      *
572      * @see #getDriverMajorVersion()
573      * @see #getDriverMinorVersion()
574      *
575      * @return the QED version string.
576      */

577     public String JavaDoc getDriverVersion()
578     throws SQLException JavaDoc
579     {
580     return getDatabaseProductVersion();
581     }
582     
583     /**
584      * This function returns a <code>ResultSet</code> object that
585      * contains information about the foreign key columns that reference
586      * the primary keys in the specified table.
587      *
588      * @param catalog ignored, since catalogs not supported by QED.
589      * @param schema a schema name. Used to specify the schema name
590      * of the table containing the primary key. <code>null</code>
591      * specifies any schema.
592      * @param table the name of the table containing the primary key.
593      * @return a <code>ResultSet</code> object, with each row being a
594      * description of a foreign key column.<p>
595      * @exception SQLException may be thrown.
596      *
597      * The columns in the <code>ResultSet</code> object have the following
598      * definition:
599      * <p>
600      * <variablelist>
601      * <varlistentry><term>1: PKTABLE_CAT</term>
602      * <listitem>
603      * <code>null</code> (Catalogs not supported by QED)</listitem>
604      * </varlistentry>
605      * <varlistentry><term>2: PKTABLE_SCHEM</term>
606      * <listitem>
607      * <code>String</code> giving the schema of the
608      * primary key's table.</listitem>
609      * </varlistentry>
610      * <varlistentry><term>3: PKTABLE_NAME</term>
611      * <listitem>
612      * <code>String</code> giving the name of the
613      * primary key's table</listitem>
614      * </varlistentry>
615      * <varlistentry><term>4: PKCOLUMN_NAME</term>
616      * <listitem>
617      * <code>String</code> giving the column name
618      * of the primary key</listitem>
619      * </varlistentry>
620      * <varlistentry><term>5: FKTABLE_CAT</term>
621      * <listitem>
622      * <code>null</code> (Catalogs not supported by QED)</listitem>
623      * </varlistentry>
624      * <varlistentry><term>6: FKTABLE_SCHEM</term>
625      * <listitem>
626      * <code>String</code> giving the schema of
627      * the foreign key's table.</listitem>
628      * </varlistentry>
629      * <varlistentry><term>7: FKTABLE_NAME</term>
630      * <listitem>
631      * <code>String</code> giving the name of the
632      * foreign key's table</listitem>
633      * </varlistentry>
634      * <varlistentry><term>8: FKCOLUMN_NAME</term>
635      * <listitem>
636      * <code>String</code> giving the column name
637      * of the foreign key</listitem>
638      * </varlistentry>
639      * <varlistentry><term>9: KEY_SEQ</term>
640      * <listitem>
641      * <code>short</code> indicating the column number
642      * within the foreign key, if the foreign key has
643      * more than one column</listitem>
644      * </varlistentry>
645      * <varlistentry><term>10: UPDATE_RULE</term>
646      * <listitem>
647      * <code>short</code> indicating what happens when the
648      * primary key is updated: The values supported by QED
649      * are: <ul>
650      * <li><code>DatabaseMetaData.importedKeyRestrict</code></li>
651      * <li><code>DatabaseMetaData.importedKeyCascade</code></li>
652      * </ul></listitem>
653      * </varlistentry>
654      * <varlistentry><term>11: DELETE_RULE</term>
655      * <listitem>
656      * <code>short</code> indicating what happens when the
657      * primary key is deleted: The values supported by QED
658      * are: <ul>
659      * <li><code>DatabaseMetaData.importedKeyRestrict</code></li>
660      * <li><code>DatabaseMetaData.importedKeyCascade</code></li>
661      * </ul></listitem>
662      * </varlistentry>
663      * <varlistentry><term>12: FK_NAME</term>
664      * <listitem>
665      * <code>null</code></listitem>
666      * </varlistentry>
667      * <varlistentry><term>13: PK_NAME</term>
668      * <listitem>
669      * <code>null</code></listitem>
670      * </varlistentry>
671      * <varlistentry><term>14: DEFERRABILITY</term>
672      * <listitem>
673      * <code>short</code> indicating whether
674      * foreign key constraint
675      * checking can be deferred. One of: <ul>
676      * <li><code>DatabaseMetaData.importedKeyInitiallyDeferred</code></li>
677      * <li><code>DatabaseMetaData.importedKeyInitiallyImmediate</code></li>
678      * <li><code>DatabaseMetaData.importedKeyNotDeferrable</code></li>
679      * </ul>
680      * <p>This QED release remembers the deferability specification
681      * in the original DDL statement, but deferred constraint checking
682      * is not supported in this release.
683      *
684      * </listitem>
685      * </varlistentry>
686      * </variablelist>
687      *
688      */

689     public java.sql.ResultSet JavaDoc getExportedKeys(String JavaDoc catalog, String JavaDoc schema,
690                           String JavaDoc table)
691     throws SQLException JavaDoc
692     {
693     StringBuffer JavaDoc sb = new StringBuffer JavaDoc("");
694         doString(sb, "PKTABLE_SCHEM", schema);
695         doString(sb, "PKTABLE_NAME", table);
696     Expression ex = parseExpression(sb.toString());
697     MetaCrossReference mt = new MetaCrossReference(session, ex);
698     return new ResultSet(mt);
699     }
700     
701     /**
702      * Returns a string consisting of all characters that can be used
703      * in unquoted identifier names other than alphanumerics and _).
704      * In QED, this returns the empty string, since only alphanumerics
705      * and underscore are valid identifier characters.
706      *
707      * @return the empty string
708      */

709     public String JavaDoc getExtraNameCharacters() {
710     return "";
711     }
712     
713     /**
714      * Return the string used to quote SQL identifiers.
715      *
716      * @return the double-quote character: <code>"</code>
717      */

718     public String JavaDoc getIdentifierQuoteString() {
719     return "\"";
720     }
721     
722     /**
723      * This function returns a <code>ResultSet</code> object that
724      * contains information about the primary key columns that are
725      * referenced by the foreign keys in the specified table.
726      *
727      * @param catalog ignored, since catalogs not supported by QED.
728      * @param schema a schema name. Used to specify the schema name
729      * of the table containing the foreign key. <code>null</code>
730      * specifies any schema.
731      * @param table the name of the table containing the foreign key.
732      * @return a <code>ResultSet</code> object, with each row being a
733      * description of a foreign key column.<p>
734      * @exception SQLException may be thrown.
735      *
736      * The columns in the <code>ResultSet</code> object have the following
737      * definition:
738      * <p>
739      * <variablelist>
740      * <varlistentry><term>1: PKTABLE_CAT</term>
741      * <listitem>
742      * <code>null</code> (Catalogs not supported by QED)</listitem>
743      * </varlistentry>
744      * <varlistentry><term>2: PKTABLE_SCHEM</term>
745      * <listitem>
746      * <code>String</code> giving the schema of the
747      * primary key's table.</listitem>
748      * </varlistentry>
749      * <varlistentry><term>3: PKTABLE_NAME</term>
750      * <listitem>
751      * <code>String</code> giving the name of the
752      * primary key's table</listitem>
753      * </varlistentry>
754      * <varlistentry><term>4: PKCOLUMN_NAME</term>
755      * <listitem>
756      * <code>String</code> giving the column name
757      * of the primary key</listitem>
758      * </varlistentry>
759      * <varlistentry><term>5: FKTABLE_CAT</term>
760      * <listitem>
761      * <code>null</code> (Catalogs not supported by QED)</listitem>
762      * </varlistentry>
763      * <varlistentry><term>6: FKTABLE_SCHEM</term>
764      * <listitem>
765      * <code>String</code> giving the schema of
766      * the foreign key's table.</listitem>
767      * </varlistentry>
768      * <varlistentry><term>7: FKTABLE_NAME</term>
769      * <listitem>
770      * <code>String</code> giving the name of the
771      * foreign key's table</listitem>
772      * </varlistentry>
773      * <varlistentry><term>8: FKCOLUMN_NAME</term>
774      * <listitem>
775      * <code>String</code> giving the column name
776      * of the foreign key</listitem>
777      * </varlistentry>
778      * <varlistentry><term>9: KEY_SEQ</term>
779      * <listitem>
780      * <code>short</code> indicating the column number
781      * within the foreign key, if the foreign key has
782      * more than one column</listitem>
783      * </varlistentry>
784      * <varlistentry><term>10: UPDATE_RULE</term>
785      * <listitem>
786      * <code>short</code> indicating what happens when the
787      * primary key is updated: The values supported by QED
788      * are: <ul>
789      * <li><code>DatabaseMetaData.importedKeyRestrict</code></li>
790      * <li><code>DatabaseMetaData.importedKeyCascade</code></li>
791      * </ul></listitem>
792      * </varlistentry>
793      * <varlistentry><term>11: DELETE_RULE</term>
794      * <listitem>
795      * <code>short</code> indicating what happens when the
796      * primary key is deleted: The values supported by QED
797      * are: <ul>
798      * <li><code>DatabaseMetaData.importedKeyRestrict</code></li>
799      * <li><code>DatabaseMetaData.importedKeyCascade</code></li>
800      * </ul></listitem>
801      * </varlistentry>
802      * <varlistentry><term>12: FK_NAME</term>
803      * <listitem>
804      * the name of the foreign key constraint</listitem>
805      * </varlistentry>
806      * <varlistentry><term>13: PK_NAME</term>
807      * <listitem>
808      * <code>null</code></listitem>
809      * </varlistentry>
810      * <varlistentry><term>14: DEFERRABILITY</term>
811      * <listitem>
812      * <code>short</code> indicating whether
813      * foreign key constraint
814      * checking can be deferred. One of: <ul>
815      * <li><code>DatabaseMetaData.importedKeyInitiallyDeferred</code></li>
816      * <li><code>DatabaseMetaData.importedKeyInitiallyImmediate</code></li>
817      * <li><code>DatabaseMetaData.importedKeyNotDeferrable</code></li>
818      * </ul>
819      * <p>This QED release remembers the deferability specification
820      * in the original DDL statement, but deferred constraint checking
821      * is not supported in this release.
822      *
823      * </listitem>
824      * </varlistentry>
825      * </variablelist>
826      *
827      */

828     public java.sql.ResultSet JavaDoc getImportedKeys(String JavaDoc catalog, String JavaDoc schema,
829                           String JavaDoc table)
830     throws SQLException JavaDoc
831     {
832     StringBuffer JavaDoc sb = new StringBuffer JavaDoc("");
833         doString(sb, "FKTABLE_SCHEM", schema);
834         doString(sb, "FKTABLE_NAME", table);
835     Expression ex = parseExpression(sb.toString());
836     MetaCrossReference mt = new MetaCrossReference(session, ex);
837     return new ResultSet(mt);
838     }
839     
840     /**
841      * This function returns a <code>ResultSet</code> object that
842      * contains information about the index columns in the specified
843      * table.
844      *
845      * @param catalog ignored, since catalogs not supported by QED.
846      * @param schema a schema name. Used to specify the schema name
847      * of the table. <code>null</code>
848      * specifies any schema.
849      * @param table the name of the table.
850      * @return a <code>ResultSet</code> object, with each row being a
851      * description of an index column.<p>
852      * @exception SQLException may be thrown.
853      *
854      * The columns in the <code>ResultSet</code> object have the following
855      * definition:
856      * <p>
857      * <variablelist>
858      * <varlistentry><term>1: TABLE_CAT</term>
859      * <listitem>
860      * <code>null</code> (Catalogs not supported by QED)</listitem>
861      * </varlistentry>
862      * <varlistentry><term>2: TABLE_SCHEM</term>
863      * <listitem>
864      * <code>String</code> giving the table's schema</listitem>
865      * </varlistentry>
866      * <varlistentry><term>3: TABLE_NAME</term>
867      * <listitem>
868      * <code>String</code> giving the table's name</listitem>
869      * </varlistentry>
870      * <varlistentry><term>4: NON_UNIQUE</term>
871      * <listitem>
872      * <code>boolean</code> <code>false</code> if index values
873      * must be unique, <code>true</code> otherwise.</listitem>
874      * </varlistentry>
875      * <varlistentry><term>5: INDEX_QUALIFIER</term>
876      * <listitem>
877      * QED returns <code>"global"</code> if this is a global
878      * index, <code>null</code> otherwise.</listitem>
879      * </varlistentry>
880      * <varlistentry><term>6: INDEX_NAME</term>
881      * <listitem>
882      * <code>String</code> the name of the index</listitem>
883      * </varlistentry>
884      * <varlistentry><term>7: TYPE</term>
885      * <listitem>
886      * <code>short</code> <code>DatabaseMetaData.tableIndexOther</code></listitem>
887      * </varlistentry>
888      * <varlistentry><term>8: ORDINAL_POSITION</term>
889      * <listitem>
890      * <code>short</code> indicating the column sequence
891      * within the index</listitem>
892      * </varlistentry>
893      * <varlistentry><term>9: COLUMN_NAME</term>
894      * <listitem>
895      * <code>String</code> The name of the column</listitem>
896      * </varlistentry>
897      * <varlistentry><term>10: ASC_OR_DESC</term>
898      * <listitem>
899      * <code>String</code> always <code>"A"</code></listitem>
900      * </varlistentry>
901      * <varlistentry><term>11: CARDINALITY</term>
902      * <listitem>
903      * <code>null</code> The JDBC specification says that
904      * this returns the number of unique values in the index,
905      * a statistic which is not kept in this release of
906      * QED.</listitem>
907      * </varlistentry>
908      * <varlistentry><term>12: PAGES</term>
909      * <listitem>
910      * <code>null</code> The JDBC specification says that
911      * this returns the number of pages used by the index,
912      * a statistic which is not kept in this release of
913      * QED.</listitem>
914      * </varlistentry>
915      * <varlistentry><term>13: FILTER_CONDITION</term>
916      * <listitem>
917      * <code>null</code> not supported by QED
918      * </listitem>
919      * </varlistentry>
920      * </variablelist>
921      */

922     public java.sql.ResultSet JavaDoc getIndexInfo(String JavaDoc catalog, String JavaDoc schema,
923                        String JavaDoc table, boolean unique,
924                        boolean approximate)
925     throws SQLException JavaDoc
926     {
927     StringBuffer JavaDoc sb = new StringBuffer JavaDoc("");
928         doString(sb, "TABLE_SCHEM", schema);
929         doString(sb, "TABLE_NAME", table);
930     if (unique) {
931             if (sb.length() > 0) sb.append(" and ");
932             sb.append("not NON_UNIQUE");
933     }
934     Expression ex = parseExpression(sb.toString());
935     MetaIndexInfo mi = new MetaIndexInfo(session, ex);
936     return new ResultSet(mi);
937     }
938
939     /**
940      * Return the maximum size of a binary literal. QED has no
941      * architectural limitation on literal sizes, and so always
942      * returns zero.
943      *
944      * @return zero, meaning unlimited.
945      */

946     public int getMaxBinaryLiteralLength() {
947     return 0;
948     }
949     
950     /**
951      * QED doesn't support catalogs, but if it did, it wouldn't impose
952      * a limit on the length of their names.
953      *
954      * @return zero, meaning unlimited.
955      */

956     public int getMaxCatalogNameLength() {
957     return 0;
958     }
959     
960     /**
961      * Return the maximum size of a character literal. QED has no
962      * architectural limitation on literal sizes, and so always
963      * returns zero.
964      *
965      * @return zero, meaning unlimited.
966      */

967     public int getMaxCharLiteralLength() {
968     return 0;
969     }
970     
971     /**
972      * Return the maximum length of a column name. QED has no
973      * architectural limitation on name sizes, and so always
974      * returns zero.
975      *
976      * @return zero, meaning unlimited.
977      */

978     public int getMaxColumnNameLength() {
979     return 0;
980     }
981     
982     /**
983      * Return the maximum number of columns in a <code>GROUP BY</code>
984      * clause. QED has no architectural limitation on
985      * <code>GROUP BY</code> clauses, and so always
986      * returns zero.
987      *
988      * @return zero, meaning unlimited.
989      */

990     public int getMaxColumnsInGroupBy() {
991     return 0;
992     }
993     
994     /**
995      * Return the maximum number of columns in an index.
996      * QED has no architectural limitation on index columns,
997      * and so always returns zero.
998      *
999      * @return zero, meaning unlimited.
1000     */

1001    public int getMaxColumnsInIndex() {
1002    return 0;
1003    }
1004    
1005    /**
1006     * Return the maximum number of columns in an <code>ORDER BY</code>
1007     * clause. QED has no architectural limitation on
1008     * <code>ORDER BY</code> clauses, and so always
1009     * returns zero.
1010     *
1011     * @return zero, meaning unlimited.
1012     */

1013    public int getMaxColumnsInOrderBy() {
1014    return 0;
1015    }
1016    
1017    /**
1018     * Return the maximum number of columns in a <code>SELECT</code>
1019     * clause. QED has no architectural limitation on
1020     * <code>SELECT</code> clauses, and so always
1021     * returns zero.
1022     *
1023     * @return zero, meaning unlimited.
1024     */

1025    public int getMaxColumnsInSelect() {
1026    return 0;
1027    }
1028    
1029    /**
1030     * Return the maximum number of columns in an table.
1031     * QED has no architectural limitation on table columns,
1032     * and so always returns zero.
1033     *
1034     * @return zero, meaning unlimited.
1035     */

1036    public int getMaxColumnsInTable() {
1037    return 0;
1038    }
1039    
1040    /**
1041     * Return the maximum number of active connections that can
1042     * be maintained by this driver instance.
1043     * QED has no architectural limitation on datbase connections,
1044     * and so always returns zero.
1045     *
1046     * @return zero, meaning unlimited.
1047     */

1048    public int getMaxConnections() {
1049    return 0;
1050    }
1051    
1052    /**
1053     * QED doesn't support named cursors, but if it did, it wouldn't impose
1054     * a limit on the length of their names.
1055     *
1056     * @return zero, meaning unlimited.
1057     */

1058    public int getMaxCursorNameLength() {
1059    return 0;
1060    }
1061    
1062    /**
1063     * Return the maximum number of bytes in an index. QED has no
1064     * architectural limitation on index sizes, and so always returns zero.
1065     *
1066     * @return zero, meaning unlimited.
1067     */

1068    public int getMaxIndexLength() {
1069    return 0;
1070    }
1071    
1072    /**
1073     * QED doesn't support stored procedures, but if it did, it wouldn't impose
1074     * a limit on the length of their names.
1075     *
1076     * @return zero, meaning unlimited.
1077     */

1078    public int getMaxProcedureNameLength() {
1079    return 0;
1080    }
1081    
1082    /**
1083     * Return the maximum number of bytes in a single row. QED has no
1084     * architectural limitation on row sizes, and so always returns zero.
1085     *
1086     * @return zero, meaning unlimited.
1087     */

1088    public int getMaxRowSize() {
1089    return 0;
1090    }
1091    
1092    /**
1093     * Return the maximum length of a schema name. QED has no
1094     * architectural limitation on schema sizes, and so always
1095     * returns zero.
1096     *
1097     * @return zero, meaning unlimited.
1098     */

1099    public int getMaxSchemaNameLength() {
1100    return 0;
1101    }
1102    
1103    /**
1104     * Return the maximum number of characters in an SQL statement. QED has no
1105     * architectural limitation on statement sizes, and so always
1106     * returns zero.
1107     *
1108     * @return zero, meaning unlimited.
1109     */

1110    public int getMaxStatementLength() {
1111    return 0;
1112    }
1113    
1114    /**
1115     * Return the maximum number of concurrently active statements that
1116     * can be open on a single connection. The QED threading model
1117     * essentially restricts the application to a single active
1118     * <code>ResultSet</code> per connection. If another statement
1119     * is executed which creates a <code>ResultSet</code>, the first
1120     * <code>ResultSet</code> will be automatically closed.
1121     *
1122     * @return one
1123     */

1124    public int getMaxStatements() {
1125    return 1;
1126    }
1127    
1128    /**
1129     * Return the maximum length of a table name. QED has no
1130     * architectural limitation on name lengths, and so always
1131     * returns zero.
1132     *
1133     * @return zero, meaning unlimited.
1134     */

1135    public int getMaxTableNameLength() {
1136    return 0;
1137    }
1138    
1139    /**
1140     * Return the maximum number of tables allowed in a <code>SELECT</code>
1141     * clause. QED has no
1142     * architectural limitation on this, and so always
1143     * returns zero.
1144     *
1145     * @return zero, meaning unlimited.
1146     */

1147    public int getMaxTablesInSelect() {
1148    return 0;
1149    }
1150    
1151    /**
1152     * Return the maximum length of a user name. QED has no
1153     * architectural limitation on name lengths, and so always
1154     * returns zero.
1155     *
1156     * @return zero, meaning unlimited.
1157     */

1158    public int getMaxUserNameLength() {
1159    return 0;
1160    }
1161    
1162    /**
1163     * Return a comma-separated string containing the names of the
1164     * numeric functions supported by QED.
1165     * This string contains the Open Group
1166     * CLI names for the following functions:
1167     *
1168     * <p><code>
1169     * ABS,ACOS,ASIN,ATAN,ATAN2,CEILING,COS,COT,DEGREES,EXP,FLOOR
1170     * LOG,LOG10,MOD,PI,POWER,RADIANS,RAND,ROUND,SIGN,SIN,SQRT,TAN
1171     * TRUNCATE
1172     * </code></p>
1173     */

1174    public String JavaDoc getNumericFunctions() {
1175    return
1176        "ABS,ACOS,ASIN,ATAN,ATAN2,CEILING,COS,COT,DEGREES,EXP,FLOOR," +
1177        "LOG,LOG10,MOD,PI,POWER,RADIANS,RAND,ROUND,SIGN,SIN,SQRT,TAN," +
1178        "TRUNCATE";
1179    }
1180    
1181    /**
1182     * This function returns a <code>ResultSet</code> describing the
1183     * primary key columns of the specified table.
1184     *
1185     * @param catalog ignored, since catalogs not supported by QED.
1186     * @param schema a schema name. Used to specify the schema name
1187     * of the table. <code>null</code>
1188     * specifies any schema.
1189     * @param table the name of the table.
1190     * @return a <code>ResultSet</code> object, with each row being a
1191     * description of an index column.<p>
1192     * @exception SQLException may be thrown.
1193     *
1194     * The columns in the <code>ResultSet</code> object have the following
1195     * definition:
1196     * <p>
1197     * <variablelist>
1198     * <varlistentry><term>1: TABLE_CAT</term>
1199     * <listitem>
1200     * <code>null</code> (Catalogs not supported by QED)</listitem>
1201     * </varlistentry>
1202     * <varlistentry><term>2: TABLE_SCHEM</term>
1203     * <listitem>
1204     * <code>String</code> giving the table's schema</listitem>
1205     * </varlistentry>
1206     * <varlistentry><term>3: TABLE_NAME</term>
1207     * <listitem>
1208     * <code>String</code> giving the table's name</listitem>
1209     * </varlistentry>
1210     * <varlistentry><term>4: COLUMN_NAME</term>
1211     * <listitem>
1212     * <code>String</code> giving the column name</listitem>
1213     * </varlistentry>
1214     * <varlistentry><term>5: KEY_SEQ</term>
1215     * <listitem>
1216     * <code>short</code> indicating the column sequence
1217     * within the primary key</listitem>
1218     * </varlistentry>
1219     * <varlistentry><term>6: PK_NAME</term>
1220     * <listitem>
1221     * <code>String</code> The name of the primary key constraint</listitem>
1222     * </varlistentry>
1223     * </variablelist>
1224     */

1225    public java.sql.ResultSet JavaDoc getPrimaryKeys(String JavaDoc catalog, String JavaDoc schema,
1226                         String JavaDoc table)
1227    throws SQLException JavaDoc
1228    {
1229    StringBuffer JavaDoc sb = new StringBuffer JavaDoc("");
1230        doString(sb, "TABLE_SCHEM", schema);
1231        doString(sb, "TABLE_NAME", table);
1232    Expression ex = parseExpression(sb.toString());
1233    MetaPrimaryKeys mt = new MetaPrimaryKeys(session, ex);
1234    return new ResultSet(mt);
1235    }
1236
1237    /**
1238     * Stored procedures aren't supported by QED, but
1239     * we return an empty result set with the right signature as a courtesy.
1240     *
1241     * @param catalog N/A
1242     * @param schemaNamePattern N/A
1243     * @param procedureNamePattern N/A
1244     * @param columnNamePattern N/A
1245     */

1246    public java.sql.ResultSet JavaDoc getProcedureColumns(String JavaDoc catalog,
1247                          String JavaDoc schemaNamePattern,
1248                          String JavaDoc procedureNamePattern,
1249                          String JavaDoc columnNamePattern)
1250    throws SQLException JavaDoc
1251    {
1252        return new ResultSet(MetaCursor.find(session,
1253                                             "SYSTEM.PROCEDURECOLUMNS"));
1254    }
1255    /**
1256     * Stored procedures aren't supported by QED, but
1257     * we return an empty result set with the right signature as a courtesy.
1258     *
1259     * @param catalog N/A
1260     * @param schemaNamePattern N/A
1261     * @param procedureNamePattern N/A
1262     */

1263    public java.sql.ResultSet JavaDoc getProcedures(String JavaDoc catalog,
1264                        String JavaDoc schemaNamePattern,
1265                        String JavaDoc procedureNamePattern)
1266    throws SQLException JavaDoc
1267    {
1268    return new ResultSet(MetaCursor.find(session, "SYSTEM.PROCEDURES"));
1269    }
1270    
1271    
1272    /**
1273     * Whatever.
1274     */

1275    public String JavaDoc getProcedureTerm()
1276    throws SQLException JavaDoc
1277    {
1278    return "proc";
1279    }
1280
1281    /**
1282     * Return a result set containing the names of the database schemas.
1283     *
1284     */

1285    public java.sql.ResultSet JavaDoc getSchemas()
1286    throws SQLException JavaDoc
1287    {
1288        return new ResultSet(MetaCursor.find(session, "SYSTEM.SCHEMAS"));
1289    }
1290
1291    /**
1292     * Get the "database vendor's preferred term for 'schema'".
1293     *
1294     * @return "schema"
1295     */

1296    public String JavaDoc getSchemaTerm() {
1297    return "schema";
1298    }
1299
1300    /**
1301     * Return the default value for the escape sequence that can be
1302     * used to escape literal "_" and "%" pattern characters in
1303     * <code>LIKE</code> pattern strings.
1304     *
1305     * @return the string "\"
1306     */

1307    public String JavaDoc getSearchStringEscape() {
1308    return ValuePattern.defaultEscape;
1309    }
1310    
1311    /**
1312     * Returns a list of database keywords that are not also SQL-92
1313     * keywords. For this release of QED, this is currently the
1314     * empty string.
1315     *
1316     * @return ""
1317     */

1318    public String JavaDoc getSQLKeywords() {
1319    return "";
1320    }
1321    
1322    /**
1323     * Return a comma-separated string containing the names of the
1324     * string functions supported by QED.
1325     * This string contains the Open Group
1326     * CLI names for the following functions:
1327     *
1328     * <p><code>
1329     * ASCII, CHAR, CONCAT, DIFFERENCE, INSERT, LCASE, LOWER, LEFT, LENGTH
1330     * LOCATE, LTRIM, REPEAT, REPLACE, RIGHT, RTRIM, SOUNDEX, SPACE
1331     * SUBSTRING, UCASE, UPPER
1332     * </code</p>
1333     */

1334    public String JavaDoc getStringFunctions() {
1335    return
1336        "ASCII,CHAR,CONCAT,DIFFERENCE,INSERT,LCASE,LOWER,LEFT,LENGTH," +
1337        "LOCATE,LTRIM,REPEAT,REPLACE,RIGHT,RTRIM,SOUNDEX,SPACE," +
1338        "SUBSTRING,UCASE,UPPER";
1339    }
1340    
1341    /**
1342     * Return a comma-separated string containing the names of the
1343     * system functions supported by QED.
1344     * This string contains the Open Group
1345     * CLI names for the following functions:
1346     *
1347     * <p><code>DATABASE, IFNULL, USER</code></p>
1348     */

1349    public String JavaDoc getSystemFunctions() {
1350    return "DATABASE,IFULL,USER";
1351    }
1352    
1353    /**
1354     * QED doesn't support column privs, but we return an empty ResultSet
1355     * of the right signature as a courtesy.
1356     */

1357    public java.sql.ResultSet JavaDoc getTablePrivileges(String JavaDoc catalog, String JavaDoc schema,
1358                         String JavaDoc tableNamePattern)
1359    throws SQLException JavaDoc
1360    {
1361    return new ResultSet(MetaCursor.find(session,
1362                                             "SYSTEM.TABLEPRIVILEGES"));
1363    }
1364    
1365    /**
1366     * This function returns a <code>ResultSet<code> describing the
1367     * tables in the database.
1368     *
1369     * @param catalog ignored, since catalogs not supported by QED.
1370     * @param schemaPattern a SQL "like" pattern. All schema names matching
1371     * this pattern are selected. If this parameter is the empty
1372     * string, all schemas are selected.
1373     * @param tableNamePattern a SQL "like" pattern. All table names
1374     * matching this pattern are selected.
1375     * @param types an array of strings specifying the table types to
1376     * be returned, from the set: <code>"TABLE", "VIEW",
1377     * "LOCAL TEMPORARY", "GLOBAL TEMPORARY"</code>
1378     * @return a <code>ResultSet</code> object, with each row being a
1379     * description of a table.<p>
1380     * @exception SQLException may be thrown.
1381     *
1382     * The columns in the <code>ResultSet</code> object have the following
1383     * definition:
1384     * <p>
1385     * <variablelist>
1386     * <varlistentry><term>1: TABLE_CAT</term>
1387     * <listitem>
1388     * <code>null</code> (Catalogs not supported by QED)</listitem>
1389     * </varlistentry>
1390     * <varlistentry><term>2: TABLE_SCHEM</term>
1391     * <listitem>
1392     * <code>String</code> giving the table's schema</listitem>
1393     * </varlistentry>
1394     * <varlistentry><term>3: TABLE_NAME</term>
1395     * <listitem>
1396     * <code>String</code> giving the table's name</listitem>
1397     * </varlistentry>
1398     * <varlistentry><term>4: TABLE_TYPE</term>
1399     * <listitem>
1400     * <code>String</code> The table type. One of: <ul>
1401     * <li><code>TABLE</code></li>
1402     * <li><code>VIEW</code></li>
1403     * <li><code>GLOBAL TEMPORARY</code></li>
1404     * <li><code>LOCAL TEMPORARY</code></li>
1405     * </ul></listitem>
1406     * </varlistentry>
1407     * <varlistentry><term>5: REMARKS</term>
1408     * <listitem>
1409     * <code>null</code></listitem>
1410     * </varlistentry>
1411     * </variablelist>
1412     */

1413    public java.sql.ResultSet JavaDoc getTables(String JavaDoc catalog, String JavaDoc schemaPattern,
1414                    String JavaDoc tableNamePattern,
1415                    String JavaDoc[] types)
1416    throws SQLException JavaDoc
1417    {
1418    StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
1419        doPattern(sb, "TABLE_SCHEM", schemaPattern);
1420        doPattern(sb, "TABLE_NAME", tableNamePattern);
1421    if (types != null) {
1422            if (sb.length() > 0) sb.append(" AND ");
1423        sb.append("TABLE_TYPE in (");
1424        for (int i = 0; i < types.length; i++) {
1425        if (i > 0) sb.append(',');
1426        sb.append('\'');
1427        sb.append(types[i].toUpperCase());
1428        sb.append('\'');
1429        }
1430        sb.append(")");
1431    }
1432        Expression ex = parseExpression(sb.toString());
1433    MetaTables mt = new MetaTables(session, ex);
1434    return new ResultSet(mt);
1435    }
1436
1437    /**
1438     * This function returns a <code>ResultSet</code> which describes
1439     * the table types supported by QED.
1440     *
1441     * @exception SQLException may be thrown.
1442     *
1443     * The column in the <code>ResultSet</code> object has the following
1444     * definition:
1445     * <p>
1446     * <variablelist>
1447     * <varlistentry><term>1: TABLE_TYPE</term>
1448     * <listitem>
1449     * <code>String</code> listing the table type.
1450     * One of: <ul>
1451     * <li><code>TABLE</code></li>
1452     * <li><code>VIEW</code></li>
1453     * <li><code>GLOBAL TEMPORARY</code></li>
1454     * <li><code>LOCAL TEMPORARY</code></li>
1455     * </ul></listitem>
1456     * </varlistentry>
1457     * </variablelist>
1458     */

1459    public java.sql.ResultSet JavaDoc getTableTypes()
1460    throws SQLException JavaDoc
1461    {
1462    MetaTableTypes mt = new MetaTableTypes(session);
1463    return new ResultSet(mt);
1464    }
1465    
1466    Expression parseExpression(String JavaDoc s) throws SQLException JavaDoc {
1467        if (s.length() == 0) return null;
1468    try {
1469            session.makeTransaction();
1470        SQLParser p = new SQLParser(session, s, false);
1471        return p.expression();
1472    } catch (antlr.TokenStreamException e) {
1473        throw new SQLException JavaDoc(e.toString(), "Q000Y");
1474    } catch (antlr.RecognitionException e) {
1475        throw new SQLException JavaDoc(e.toString(), "42000");
1476    }
1477    }
1478    
1479    /**
1480     * Return a comma-separated string containing the names of the
1481     * date-time functions supported by QED.
1482     * This string contains the Open Group
1483     * CLI names for the following functions:
1484     *
1485     * <p><code>
1486     * CURDATE,CURTIME,DAYNAME,DAYOFMONTH,DAYOFWEEK,DAYOFYEAR
1487     * HOUR,MINUTE,MONTH,MONTHNAME,NOW,QUARTER,SECOND,TIMESTAMPADD
1488     * TIMESTAMPDIFF,WEEK,YEAR
1489     * </code></p>
1490     */

1491    public String JavaDoc getTimeDateFunctions()
1492    throws SQLException JavaDoc
1493    {
1494    return
1495        "CURDATE,CURTIME,DAYNAME,DAYOFMONTH,DAYOFWEEK,DAYOFYEAR," +
1496        "HOUR,MINUTE,MONTH,MONTHNAME,NOW,QUARTER,SECOND,TIMESTAMPADD," +
1497        "TIMESTAMPDIFF,WEEK,YEAR";
1498    }
1499    
1500    /**
1501     * This function returns a <code>ResultSet</code> listing the data
1502     * types supported by QED.
1503     *
1504     * @exception SQLException may be thrown.
1505     *
1506     * The column in the <code>ResultSet</code> object has the following
1507     * definition:
1508     * <p>
1509     * <variablelist>
1510     * <varlistentry><term>1: TYPE_NAME</term>
1511     * <listitem>
1512     * <code>String</code> Containing the SQL-92 name of the type</listitem>
1513     * </varlistentry>
1514     * <varlistentry><term>2: DATA_TYPE</term>
1515     * <listitem>
1516     * <code>short</code> Giving the JDBC type, from
1517     * <code>java.sql.Types</code></listitem>
1518     * </varlistentry>
1519     * <varlistentry><term>3: PRECISION</term>
1520     * <listitem>
1521     * <code>int</code> indicating the maximum precision for
1522     * numeric types, and <code>-1</code> for non-numeric types</listitem>
1523     * </varlistentry>
1524     * <varlistentry><term>4: LITERAL_PREFIX</term>
1525     * <listitem>
1526     * <code>String</code> for character types, the <code>'</code>
1527     * character; for other types, <code>null</code></listitem>
1528     * </varlistentry>
1529     * <varlistentry><term>5: LITERAL_SUFFIX</term>
1530     * <listitem>
1531     * <code>String</code> for character types, the <code>'</code>
1532     * character; for other types, <code>null</code></listitem>
1533     * </varlistentry>
1534     * <varlistentry><term>6: CREATE_PARAMS</term>
1535     * <listitem>
1536     * <code>String</code> Giving the parameters used when
1537     * creating the type. Typically, for character types,
1538     * <code>"length"</code>, and for numeric
1539     * types, <code>"precision"</code> </listitem>
1540     * </varlistentry>
1541     * <varlistentry><term>7: NULLABLE</term>
1542     * <listitem>
1543     * <code>int</code> indicating whether a type is nullable.
1544     * All types are nullable in QED, so this always
1545     * contains <code>DatabaseMetaData.typeNullable</code>.</listitem>
1546     * </varlistentry>
1547     * <varlistentry><term>8: CASE_SENSITIVE</term>
1548     * <listitem>
1549     * <code>boolean</code> if the type is case-sensitive.
1550     * Always <code>true</code> in QED.</listitem>
1551     * </varlistentry>
1552     * <varlistentry><term>9: SEARCHABLE</term>
1553     * <listitem>
1554     * <code>short</code> indicating if this type can be used
1555     * in a <code>WHERE</code> clause. QED always returns
1556     * <code>DatabaseMetaData.typeSearchable</code></listitem>
1557     * </varlistentry>
1558     * <varlistentry><term>10: UNSIGNED_ATTRIBUTE</term>
1559     * <listitem>
1560     * <code>boolean</code> <code>true</code> if
1561     * this type is unsigned, <code>false</code> otherwise</listitem>
1562     * </varlistentry>
1563     * <varlistentry><term>11: FIXED_PREC_SCALE</term>
1564     * <listitem>
1565     * <code>boolean</code> <code>true</code> if
1566     * this type can be a currency value</listitem>
1567     * </varlistentry>
1568     * <varlistentry><term>12: AUTO_INCREMENT</term>
1569     * <listitem>
1570     * <code>false</code> in QED, no auto-increment types
1571     * are supported.</listitem>
1572     * </varlistentry>
1573     * <varlistentry><term>13: LOCAL_TYPE_NAME</term>
1574     * <listitem>
1575     * <code>null</code></listitem>
1576     * </varlistentry>
1577     * <varlistentry><term>14: MINIMUM_SCALE</term>
1578     * <listitem>
1579     * <code>short</code> indicating the minimum scale
1580     * supported for tthis type</listitem>
1581     * </varlistentry>
1582     * <varlistentry><term>15: MAXIMUM_SCALE</term>
1583     * <listitem>
1584     * <code>short</code> indicating the maximum scale
1585     * supported for tthis type</listitem>
1586     * </varlistentry>
1587     * <varlistentry><term>16: SQL_DATA_TYPE</term>
1588     * <listitem>
1589     * <code>int</code> <code>null</code></listitem>
1590     * </varlistentry>
1591     * <varlistentry><term>17: SQL_DATETIME_SUB</term>
1592     * <listitem>
1593     * <code>int</code> <code>null</code></listitem>
1594     * </varlistentry>
1595     * <varlistentry><term>18: NUM_PREC_RADIX</term>
1596     * <listitem>
1597     * <code>int</code> <code>10</code></listitem>
1598     * </varlistentry>
1599     * </variablelist>
1600     */

1601    public java.sql.ResultSet JavaDoc getTypeInfo()
1602    throws SQLException JavaDoc
1603    {
1604    return new ResultSet(new MetaTypes(session));
1605    }
1606    
1607    /**
1608     * Not implemented in this QED release.
1609     * Just returns an empty resultset
1610     */

1611    public java.sql.ResultSet JavaDoc getUDTs(String JavaDoc catalog, String JavaDoc schemaPattern,
1612                 String JavaDoc typeNamePattern, int[] types)
1613    throws SQLException JavaDoc
1614    {
1615    return new ResultSet(MetaCursor.find(session, "SYSTEM.UDTS"));
1616    }
1617
1618    /**
1619     * Return the URL used to connect to this database.
1620     *
1621     * @return the database URL.
1622     */

1623    public String JavaDoc getURL() {
1624    return database.getURL();
1625    }
1626    
1627    /**
1628     * Return the user name used to connect to this database.
1629     *
1630     * @return the user name
1631     */

1632    public String JavaDoc getUserName() {
1633    return qConn.getAuth();
1634    }
1635    
1636
1637    /**
1638     * QED doesn't support this feature, but we return an empty ResultSet
1639     * of the right signature as a courtesy.
1640     */

1641    public java.sql.ResultSet JavaDoc getVersionColumns(String JavaDoc catalog, String JavaDoc schema,
1642                        String JavaDoc table)
1643    throws SQLException JavaDoc
1644    {
1645    return new ResultSet(MetaCursor.find(session,
1646                                             "SYSTEM.VERSIONCOLUMNS"));
1647    }
1648    
1649    /**
1650     * JDBC specifies two criteria for determining whether inserts are
1651     * detected.
1652     *
1653     * <ol>
1654     * <li>A row that has been inserted appears in the <code>ResultSet</code>
1655     * object without having to close and reopen it</li>
1656     * and
1657     * <li>The method <code>ResultSet.rowInserted</code> will return
1658     * <code>true</code> if the current row was one inserted after
1659     * the <code>ResultSet</code> was opened</li>
1660     * </ol>
1661     * <p>
1662     * This release of QED always returns <code>false</code>
1663     * to <code>ResultSet.rowInserted</code>.
1664     *
1665     * @param type the type of <code>ResultSet</code>
1666     * @return false
1667     */

1668    public boolean insertsAreDetected(int type) {
1669    return false;
1670    }
1671
1672    /**
1673     * Catalogs aren't supported in QED, but we'll play along at thig point.
1674     * Return true, yep, catalog is at start
1675     */

1676    public boolean isCatalogAtStart()
1677    throws SQLException JavaDoc
1678    {
1679    return true;
1680    }
1681    
1682    /**
1683     * This release of QED doesn't support read-only connections or
1684     * databases, completely....
1685     *
1686     * @return false
1687     */

1688    public boolean isReadOnly() {
1689    return false;
1690    }
1691    
1692    /**
1693     * Most boolean operators (e.g, arithmetic, logical, string operators)
1694     * produce a <code>NULL</code> result when one of the operands is
1695     * <code>NULL</code>. One notable exception is logical operators
1696     * such as <code>AND</code> and <code>OR</code>, where, e.g.,
1697     * <code>(NULL AND FALSE) = FALSE</code>
1698     *
1699     * @return true
1700     */

1701    public boolean nullPlusNonNullIsNull() {
1702    return true;
1703    }
1704    
1705    /**
1706     * In QED, <code>NULL</code>s are sorted low.
1707     *
1708     * @return false
1709     */

1710    public boolean nullsAreSortedAtEnd() {
1711    return false;
1712    }
1713    
1714    /**
1715     * In QED, <code>NULL</code>s are sorted low.
1716     *
1717     * @return false
1718     */

1719    public boolean nullsAreSortedAtStart() {
1720    return false;
1721    }
1722    
1723    /**
1724     * In QED, <code>NULL</code>s are sorted low.
1725     *
1726     * @return false
1727     */

1728    public boolean nullsAreSortedHigh() {
1729    return false;
1730    }
1731    
1732    /**
1733     * In QED, <code>NULL</code>s are sorted low.
1734     *
1735     * @return true
1736     */

1737    public boolean nullsAreSortedLow() {
1738    return true;
1739    }
1740    
1741    /**
1742     * Due to QED's table-level locking strategy, combined with
1743     * strictly serializable transaction execution, it's not possible
1744     * to see other transaction's deletes
1745     *
1746     * @param type the <code>ResultSet</code> type, ignored
1747     * @return false
1748     */

1749    public boolean othersDeletesAreVisible(int type) {
1750    return false;
1751    }
1752    
1753    /**
1754     * Due to QED's table-level locking strategy, combined with
1755     * strictly serializable transaction execution, it's not possible
1756     * to see other transaction's inserts
1757     *
1758     * @param type the <code>ResultSet</code> type, ignored
1759     * @return false
1760     */

1761    public boolean othersInsertsAreVisible(int type) {
1762    return false;
1763    }
1764    
1765    /**
1766     * Due to QED's table-level locking strategy, combined with
1767     * strictly serializable transaction execution, it's not possible
1768     * to see other transaction's updates
1769     *
1770     * @param type the <code>ResultSet</code> type, ignored
1771     * @return false
1772     */

1773    public boolean othersUpdatesAreVisible(int type) {
1774    return false;
1775    }
1776    
1777    /**
1778     * This release of QED doesn't fully support visible change detection.
1779     *
1780     * @param type the <code>ResultSet</code> type, ignored
1781     * @return false
1782     */

1783    public boolean ownDeletesAreVisible(int type) {
1784    return false;
1785    }
1786    
1787    /**
1788     * This release of QED doesn't fully support visible change detection.
1789     *
1790     * @param type the <code>ResultSet</code> type, ignored
1791     * @return false
1792     */

1793    public boolean ownInsertsAreVisible(int type) {
1794    return false;
1795    }
1796    
1797    /**
1798     * This release of QED doesn't fully support visible change detection.
1799     *
1800     * @param type the <code>ResultSet</code> type, ignored
1801     * @return true
1802     */

1803    public boolean ownUpdatesAreVisible(int type) {
1804    return true;
1805    }
1806    
1807    /**
1808     * QED treats mixed case identifiers in SQL statements as case-insensitve
1809     * and stores them internally in upper case.
1810     *
1811     * @return false
1812     */

1813    public boolean storesLowerCaseIdentifiers() {
1814    return false;
1815    }
1816    
1817    /**
1818     * QED treats mixed case quoted identifiers in SQL statements as
1819     * case-insensitve
1820     * and stores them internally in upper case.
1821     *
1822     * @return false
1823     */

1824    public boolean storesLowerCaseQuotedIdentifiers() {
1825    return false;
1826    }
1827    
1828    /**
1829     * QED treats mixed case identifiers in SQL statements as case-insensitve
1830     * and stores them internally in upper case.
1831     *
1832     * @return false
1833     */

1834    public boolean storesMixedCaseIdentifiers() {
1835    return false;
1836    }
1837    
1838    /**
1839     * QED treats mixed case quoted identifiers in SQL statements as
1840     * case-insensitve
1841     * and stores them internally in upper case.
1842     *
1843     * @return false
1844     */

1845    public boolean storesMixedCaseQuotedIdentifiers() {
1846    return false;
1847    }
1848    
1849    /**
1850     * QED treats mixed case identifiers in SQL statements as case-insensitve
1851     * and stores them internally in upper case.
1852     *
1853     * @return true
1854     */

1855    public boolean storesUpperCaseIdentifiers() {
1856    return true;
1857    }
1858    
1859    /**
1860     * QED treats mixed case quoted identifiers in SQL statements as
1861     * case-insensitve
1862     * and stores them internally in upper case.
1863     *
1864     * @return true
1865     */

1866    public boolean storesUpperCaseQuotedIdentifiers() {
1867    return true;
1868    }
1869    
1870    /**
1871     * QED supports Entry Level SQL 92
1872     *
1873     * @return true
1874     */

1875    public boolean supportsANSI92EntryLevelSQL() {
1876    return true;
1877    }
1878
1879    /**
1880     * QED supports many Intermediate Level features from SQL 92:
1881     *
1882     * <ul>
1883     * <li>Long identifiers, lowercase identifiers, named constraints</li>
1884     * <li>Datetimes, intervals</li>
1885     * <li>CHARACTER_LENGTH(), OCTET_LENGTH(), SUBSTRING(), TRIM(), CAST()</li>
1886     * <li>JOIN, EXCEPT, INTERSECT, UNION CORRESPONDING</li>
1887     * <li>SELECT AS, SELECT column-commalist, SELECT X.*</li>
1888     * <li>UNIQUE</li>
1889     * <li>ALTER TABLE, DROP TABLE, DROP VIEW</li>
1890     * <li>Many other entry level restrictions are relaxed.</li>
1891     * </ul>
1892     *
1893     * Not supported are the following:
1894     *
1895     * <ul>
1896     * <li>CURRENT_USER(), SYSTEM_USER()</li>
1897     * <li>DROP SCHEMA</li>
1898     * <li>ON DELETE in foreign key definitions</li>
1899     * <li>Dynamic SQL, explicit SQL CURSOR support (e.g., FOR UPDATE),
1900     * anything that basically overlaps with JDBC functionality.</li>
1901     * <ul>
1902     *
1903     * @return false
1904     */

1905    public boolean supportsANSI92IntermediateSQL() {
1906    return false;
1907    }
1908    
1909    /**
1910     * QED supports many, but not all, of the features of Full
1911     * SQL 92.
1912     *
1913     * <ul>
1914     * <li>Bit Strings, Timestamps with explicit precision</li>
1915     * <li>UPPER(), LOWER()</li>
1916     * <li>CROSS JOIN, UNION JOIN</li>
1917     * <li>IS [NOT] {TRUE|FALSE|UNKNOWN}</li>
1918     * <li>MATCH conditions in foreign key constraints</li>
1919     * <li>TABLE table</li>
1920     * </ul>
1921     *
1922     * Not supported are the following:
1923     *
1924     * <ul>
1925     * <li>CONNECT, SET CONNECTION, DISCONNECT</li>
1926     * <li>SET CATALOG (or catalogs at all), SET SCHEMA, SET NAMES</li>
1927     * <li>POSITION()</li>
1928     * <li>CREATE ASSERTION, DROP ASSERTION</li>
1929     * <li>ON UPDATE in foreign key constraints</li>
1930     * <li>TEMPORARY tables</li>
1931     * </ul>
1932     *
1933     * @return false
1934     */

1935    public boolean supportsANSI92FullSQL() {
1936    return false;
1937    }
1938    
1939    /**
1940     * QED supports <code>ALTER TABLE ADD COLUMN</code>
1941     *
1942     * @return true
1943     */

1944    public boolean supportsAlterTableWithAddColumn() {
1945    return true;
1946    }
1947    
1948    /**
1949     * This release of QED doesn't support
1950     * <code>ALTER TABLE DROP COLUMN</code>
1951     *
1952     * @return false
1953     */

1954    public boolean supportsAlterTableWithDropColumn() {
1955    return false;
1956    }
1957    
1958    /**
1959     * This release of QED doesn't support batch updates
1960     *
1961     * @return false
1962     */

1963    public boolean supportsBatchUpdates() {
1964    return false;
1965    }
1966    
1967    /**
1968     * QED doesn't support catalogs
1969     *
1970     * @return false
1971     */

1972    public boolean supportsCatalogsInDataManipulation() {
1973    return false;
1974    }
1975    
1976    /**
1977     * QED doesn't support catalogs
1978     *
1979     * @return false
1980     */

1981    public boolean supportsCatalogsInIndexDefinitions()
1982    throws SQLException JavaDoc
1983    {
1984    return false;
1985    }
1986    
1987    /**
1988     * QED doesn't support catalogs
1989     *
1990     * @return false
1991     */

1992    public boolean supportsCatalogsInPrivilegeDefinitions() {
1993    return false;
1994    }
1995    
1996    /**
1997     * QED doesn't support catalogs
1998     *
1999     * @return false
2000     */

2001    public boolean supportsCatalogsInProcedureCalls() {
2002    return false;
2003    }
2004    
2005    /**
2006     * QED doesn't support catalogs
2007     *
2008     * @return false
2009     */

2010    public boolean supportsCatalogsInTableDefinitions() {
2011    return false;
2012    }
2013    
2014    /**
2015     * QED supports column aliasing via the <code>AS</code> clause
2016     * of the <code>SELECT</code> statement.
2017     *
2018     * @return true
2019     */

2020    public boolean supportsColumnAliasing() {
2021    return true;
2022    }
2023    
2024    /**
2025     * This QED release doesn't implement the <code>CONVERT</code>
2026     * function. Use the SQL
2027     * <code>CAST <i>expression</i> AS <i>type</i></code> construct
2028     * instead.
2029     *
2030     * @return false
2031     */

2032    public boolean supportsConvert() {
2033    return true;
2034    }
2035    
2036    /**
2037     * This QED release doesn't implement the <code>CONVERT</code>
2038     * function. Use the SQL
2039     * <code>CAST <i>expression</i> AS <i>type</i></code> construct
2040     * instead.
2041     *
2042     * @param fromType the type to convert from
2043     * @param toType the type to conver to
2044     * @return false
2045     */

2046    public boolean supportsConvert(int fromType, int toType) {
2047    return true;
2048    }
2049
2050    /**
2051     * QED supports everything in the ODBC Core SQL grammar except
2052     * <code>GRANT</code> and <code>REVOKE</code>.
2053     *
2054     * @return false
2055     */

2056    public boolean supportsCoreSQLGrammar() {
2057    return false;
2058    }
2059    
2060    /**
2061     * QED supports correlated sub-queries
2062     *
2063     * @return true
2064     */

2065    public boolean supportsCorrelatedSubqueries() {
2066    return true;
2067    }
2068    
2069    /**
2070     * Both data definition statements and data manipulation statements
2071     * can be arbitrarily mixed within a transaction.
2072     *
2073     * @return true
2074     */

2075    public boolean supportsDataDefinitionAndDataManipulationTransactions() {
2076    return true;
2077    }
2078    
2079    /**
2080     * The JDBC spec says that this function should return true if
2081     * <blockquote>
2082     * this database supports only data manipulation statements within
2083     * a transaction
2084     * </blockquote>.
2085     *
2086     * It's not clear what this is supposed to mean. (If data definition
2087     * statements can be included in a transaction, should this function
2088     * return <code>false</code>?).
2089     *
2090     * In any case QED allows transactions that contain only data
2091     * manipulation statements, so this function returns <code>true</code>.
2092     *
2093     * @return true
2094     */

2095    public boolean supportsDataManipulationTransactionsOnly() {
2096    return true;
2097    }
2098    
2099    /**
2100     * Table correlation names are supported in QED, but they are not
2101     * required to be different from the names of the source tables,
2102     * so this function returns <code>false</code>.
2103     *
2104     * @return false
2105     */

2106    public boolean supportsDifferentTableCorrelationNames() {
2107    return false;
2108    }
2109    
2110    /**
2111     * In QED, <code>ORDER BY</code> clauses must specify column names
2112     *
2113     * @return false
2114     */

2115    public boolean supportsExpressionsInOrderBy() {
2116    return false;
2117    }
2118    
2119    /**
2120     * QED doesn't fully support the ODBC Extended SQL grammar
2121     *
2122     * @return false
2123     */

2124    public boolean supportsExtendedSQLGrammar() {
2125    return false;
2126    }
2127    
2128    /**
2129     * QED supports full nested outer joins
2130     *
2131     * @return true
2132     */

2133    public boolean supportsFullOuterJoins() {
2134    return true;
2135    }
2136    
2137    /**
2138     * QED supports <code>GROUP BY</code>
2139     *
2140     * @return true
2141     */

2142    public boolean supportsGroupBy() {
2143    return true;
2144    }
2145    
2146    /**
2147     * In QED, the <code>GROUP BY</code> clause can only specify columns
2148     * that are in the <code>SELECT</code> clause.
2149     *
2150     * @return false
2151     */

2152    public boolean supportsGroupByBeyondSelect() {
2153    return false;
2154    }
2155    
2156    /**
2157     * In QED, the <code>GROUP BY</code> clause can only specify columns
2158     * that are in the <code>SELECT</code> clause.
2159     *
2160     * @return false
2161     */

2162    public boolean supportsGroupByUnrelated() {
2163    return false;
2164    }
2165    
2166    /**
2167     * QED supports the SQL "integrity enhancement facility"
2168     *
2169     * @return true
2170     */

2171    public boolean supportsIntegrityEnhancementFacility() {
2172    return false;
2173    }
2174    
2175    /**
2176     * QED supports the <code>LIKE</code> escape clause using the standard
2177     * SQL-92 escape syntax.
2178     *
2179     * @return true
2180     */

2181    public boolean supportsLikeEscapeClause() {
2182    return true;
2183    }
2184    
2185    /**
2186     * Since <code>supportsFullOuterJoins()</code> returns <code>true</code>,
2187     * this method should return <code>true</code> as well. And so it
2188     * does.
2189     *
2190     * @return true
2191     */

2192    public boolean supportsLimitedOuterJoins() {
2193    return true;
2194    }
2195    
2196    /**
2197     * QED supports the ODBC Minimum SQL grammar
2198     *
2199     * @return true
2200     */

2201    public boolean supportsMinimumSQLGrammar() {
2202    return true;
2203    }
2204    
2205    /**
2206     * QED converts mixed case identifiers to upper case for storage
2207     * in the metadata structures.
2208     *
2209     * @return false
2210     */

2211    public boolean supportsMixedCaseIdentifiers() {
2212    return false;
2213    }
2214    
2215    /**
2216     * QED converts mixed case quoted identifiers to upper case for storage
2217     * in the metadata structures.
2218     *
2219     * @return false
2220     */

2221    public boolean supportsMixedCaseQuotedIdentifiers() {
2222    return true;
2223    }
2224    
2225    /**
2226     * This QED release supports only a single active result set per
2227     * <code>Statement</code>.
2228     *
2229     * @return false
2230     */

2231    public boolean supportsMultipleResultSets() {
2232    return true;
2233    }
2234    
2235    /**
2236     * QED supports multiple simultaneous transactions (on different
2237     * connections)
2238     *
2239     * @return true
2240     */

2241    public boolean supportsMultipleTransactions() {
2242    return true;
2243    }
2244    
2245    /**
2246     * QED supports definining columns as non-nullable, via the
2247     * standard SQL-92 <code>NOT NULL</code> constraint.
2248     *
2249     * @return true
2250     */

2251    public boolean supportsNonNullableColumns() {
2252    return true;
2253    }
2254    
2255    /**
2256     * A commit causes any open cursors in this connection to be closed
2257     *
2258     * @return false
2259     */

2260    public boolean supportsOpenCursorsAcrossCommit() {
2261    return false;
2262    }
2263    
2264    /**
2265     * A rollback causes any open cursors in this connection to be closed
2266     *
2267     * @return false
2268     */

2269    public boolean supportsOpenCursorsAcrossRollback() {
2270    return false;
2271    }
2272
2273    /**
2274     * Statements per se are not closed by QED on commit, but the
2275     * <code>ResultSet</code> associated with a statement is.
2276     *
2277     * @return true
2278     */

2279    public boolean supportsOpenStatementsAcrossCommit() {
2280    return true;
2281    }
2282    
2283    /**
2284     * Statements per se are not closed by QED on rollback, but the
2285     * <code>ResultSet</code> associated with a statement is.
2286     *
2287     * @return true
2288     */

2289    public boolean supportsOpenStatementsAcrossRollback() {
2290    return true;
2291    }
2292
2293    /**
2294     * In QED, the <code>ORDER BY</code> clause can only specify columns
2295     * that are in the <code>SELECT</code> clause.
2296     *
2297     * @return false
2298     */

2299    public boolean supportsOrderByUnrelated() {
2300    return false;
2301    }
2302    
2303    /**
2304     * QED supports the full set of SQL-92 outer join operations.
2305     *
2306     * @return true
2307     */

2308    public boolean supportsOuterJoins() {
2309    return true;
2310    }
2311    
2312    /**
2313     * QED supports positioned <code>DELETE</code> statements.
2314     *
2315     * @return true
2316     */

2317    public boolean supportsPositionedDelete() {
2318    return true;
2319    }
2320    
2321    /**
2322     * QED supports positioned <code>UPDATE</code> statements.
2323     *
2324     * @return true
2325     */

2326    public boolean supportsPositionedUpdate() {
2327    return true;
2328    }
2329    
2330    /**
2331     * QED supports using schema names in data manipulation statements.
2332     *
2333     * @return true
2334     */

2335    public boolean supportsSchemasInDataManipulation() {
2336    return true;
2337    }
2338    
2339    /**
2340     * QED supports using schema names in index definition statements.
2341     *
2342     * @return true
2343     */

2344    public boolean supportsSchemasInIndexDefinitions() {
2345    return true;
2346    }
2347
2348    /**
2349     * QED doesn't support privilege definitions.
2350     *
2351     * @return false
2352     */

2353    public boolean supportsSchemasInPrivilegeDefinitions() {
2354    return false;
2355    }
2356    
2357    /**
2358     * QED doesn't support stored procedures
2359     *
2360     * @return false
2361     */

2362    public boolean supportsSchemasInProcedureCalls() {
2363    return false;
2364    }
2365    
2366    /**
2367     * QED supports using schema names in table definition statements.
2368     *
2369     * @return true
2370     */

2371    public boolean supportsSchemasInTableDefinitions() {
2372    return true;
2373    }
2374    
2375    /**
2376     * QED supports the <code>SELECT ... FOR UPDATE</code> statement.
2377     *
2378     * @return true
2379     */

2380    public boolean supportsSelectForUpdate() {
2381    return true;
2382    }
2383    
2384    /**
2385     * QED doesn't support stored procedures
2386     *
2387     * @return false
2388     */

2389    public boolean supportsStoredProcedures() {
2390    return false;
2391    }
2392    
2393    /**
2394     * QED supports sub-queries in comparisons
2395     *
2396     * @return true
2397     */

2398    public boolean supportsSubqueriesInComparisons() {
2399    return true;
2400    }
2401    
2402    /**
2403     * QED supports sub-queries in <code>EXISTS</code> expressions
2404     *
2405     * @return true
2406     */

2407    public boolean supportsSubqueriesInExists() {
2408    return true;
2409    }
2410    
2411    /**
2412     * QED supports sub-queries in <code>IN</code> expressions
2413     *
2414     * @return true
2415     */

2416    public boolean supportsSubqueriesInIns() {
2417    return true;
2418    }
2419    
2420    /**
2421     * QED supports sub-queries in quantified expressions
2422     *
2423     * @return true
2424     */

2425    public boolean supportsSubqueriesInQuantifieds() {
2426    return true;
2427    }
2428    
2429    /**
2430     * QED supports table correlation names
2431     *
2432     * @return true
2433     */

2434    public boolean supportsTableCorrelationNames() {
2435    return true;
2436    }
2437
2438    /**
2439     * This release of QED only supports the transaction level
2440     * <code>Connection.TRANSACTION_SERIALIZABLE</code>
2441     *
2442     * @return true if
2443     * <code>level == Connection.TRANSACTION_SERIALIZABLE</code>
2444     */

2445    public boolean supportsTransactionIsolationLevel(int level) {
2446    return level == Connection.TRANSACTION_SERIALIZABLE;
2447    }
2448    
2449    /**
2450     * QED supports transactions
2451     *
2452     * @return true
2453     */

2454    public boolean supportsTransactions() {
2455    return true;
2456    }
2457    
2458    /**
2459     * QED supports <code>UNION</code>
2460     *
2461     * @return true
2462     */

2463    public boolean supportsUnion() {
2464    return true;
2465    }
2466    
2467    /**
2468     * QED supports <code>UNION ALL</code>
2469     *
2470     * @return true
2471     */

2472    public boolean supportsUnionAll() {
2473    return true;
2474    }
2475
2476    /**
2477     * This release of QED doesn't fully support detection of updates
2478     *
2479     * @param type the <code>ResultSet</code> type
2480     *
2481     * @return false
2482     */

2483    public boolean updatesAreDetected(int type) {
2484    return false;
2485    }
2486    
2487    /**
2488     * QED doesn't use a separate file per table
2489     *
2490     * @return false
2491     */

2492    public boolean usesLocalFilePerTable() {
2493    return false;
2494    }
2495    
2496    /**
2497     * QED uses local files to store the database, the lock file,
2498     * and the transaction logs.
2499     *
2500     * @return true
2501     */

2502    public boolean usesLocalFiles() {
2503    return true;
2504    }
2505
2506    //#ifndef JDK11
2507
/**
2508     * This release of QED supports <code>TYPE_FORWARD_ONLY</code>
2509     * <code>ResultSet</code>s, with either
2510     * <code>ResultSet.CONCUR_READ_ONLY</code> or
2511     * <code>ResultSet.CONCUR_UPDATABLE</code> concurrency
2512     *
2513     * @param type the <code>ResultSet</code> type
2514     * @param concurrency the concurrency level
2515     *
2516     * @return true if the type == <code>ResultSet.TYPE_FORWARD_ONLY</code>.
2517     */

2518    public boolean supportsResultSetConcurrency(int type, int concurrency) {
2519    return supportsResultSetType(type);
2520    }
2521    
2522    /**
2523     * This release of QED supports <code>TYPE_FORWARD_ONLY</code>
2524     * <code>ResultSet</code>s.
2525     *
2526     * @param type the <code>ResultSet</code> type
2527     *
2528     * @return true if the type == <code>ResultSet.TYPE_FORWARD_ONLY</code>.
2529     */

2530    public boolean supportsResultSetType(int type) {
2531    return type == ResultSet.TYPE_FORWARD_ONLY;
2532    }
2533    //#endif
2534

2535
2536    // ------------------- JDBC 3.0 -------------------------
2537

2538    //#ifdef JDK14
2539
/**
2540     * Retrieves whether this database supports savepoints.
2541     *
2542     * @return <code>true</code> if savepoints are supported;
2543     * <code>false</code> otherwise
2544     * @exception SQLException if a database access error occurs
2545     * @since 1.4
2546     */

2547    public boolean supportsSavepoints()
2548        throws SQLException JavaDoc
2549    {
2550        return false;
2551    }
2552
2553    /**
2554     * Retrieves whether this database supports named parameters to callable
2555     * statements.
2556     *
2557     * @return <code>true</code> if named parameters are supported;
2558     * <code>false</code> otherwise
2559     * @exception SQLException if a database access error occurs
2560     * @since 1.4
2561     */

2562    public boolean supportsNamedParameters()
2563        throws SQLException JavaDoc
2564    {
2565        return false;
2566    }
2567
2568    /**
2569     * Retrieves whether it is possible to have multiple
2570     * <code>ResultSet</code> objects
2571     * returned from a <code>CallableStatement</code> object
2572     * simultaneously.
2573     *
2574     * @return <code>true</code> if a <code>CallableStatement</code> object
2575     * can return multiple <code>ResultSet</code> objects
2576     * simultaneously; <code>false</code> otherwise
2577     * @exception SQLException if a datanase access error occurs
2578     * @since 1.4
2579     */

2580    public boolean supportsMultipleOpenResults()
2581        throws SQLException JavaDoc
2582    {
2583        return false;
2584    }
2585
2586    /**
2587     * Retrieves whether auto-generated keys can be retrieved after
2588     * a statement has been executed.
2589     *
2590     * @return <code>true</code> if auto-generated keys can be retrieved
2591     * after a statement has executed; <code>false</code> otherwise
2592     * @exception SQLException if a database access error occurs
2593     * @since 1.4
2594     */

2595    public boolean supportsGetGeneratedKeys()
2596        throws SQLException JavaDoc
2597    {
2598        return false;
2599    }
2600
2601    /**
2602     * Retrieves a description of the user-defined type (UDT) hierarchies
2603     * defined in a
2604     * particular schema in this database. Only the immediate super type/
2605     * sub type relationship is modeled.
2606     * <P>
2607     * Only supertype information for UDTs matching the catalog,
2608     * schema, and type name is returned. The type name parameter
2609     * may be a fully-qualified name. When the UDT name supplied is a
2610     * fully-qualified name, the catalog and schemaPattern parameters are
2611     * ignored.
2612     * <P>
2613     * If a UDT does not have a direct super type, it is not listed here.
2614     * A row of the <code>ResultSet</code> object returned by this method
2615     * describes the designated UDT and a direct supertype. A row has the
2616     * following
2617     * columns:
2618     * <OL>
2619     * <LI><B>TYPE_CAT</B> String => the UDT's catalog (may be
2620     * <code>null</code>)
2621     * <LI><B>TYPE_SCHEM</B> String => UDT's schema (may be
2622     * <code>null</code>)
2623     * <LI><B>TYPE_NAME</B> String => type name of the UDT
2624     * <LI><B>SUPERTYPE_CAT</B> String => the direct super type's catalog
2625     * (may be <code>null</code>)
2626     * <LI><B>SUPERTYPE_SCHEM</B> String => the direct super type's schema
2627     * (may be <code>null</code>)
2628     * <LI><B>SUPERTYPE_NAME</B> String => the direct super type's name
2629     * </OL>
2630     *
2631     * <P><B>Note:</B> If the driver does not support type hierarchies, an
2632     * empty result set is returned.
2633     *
2634     * @param catalog a catalog name; "" retrieves those without a catalog;
2635     * <code>null</code> means drop catalog name from the selection
2636     * criteria
2637     * @param schemaPattern a schema name pattern; "" retrieves those
2638     * without a schema
2639     * @param typeNamePattern a UDT name pattern; may be a fully-qualified
2640     * name
2641     * @return a <code>ResultSet</code> object in which a row gives information
2642     * about the designated UDT
2643     * @throws SQLException if a database access error occurs
2644     * @since 1.4
2645     */

2646    public java.sql.ResultSet JavaDoc getSuperTypes(String JavaDoc catalog,
2647                                            String JavaDoc schemaPattern,
2648                                            String JavaDoc typeNamePattern)
2649        throws SQLException JavaDoc
2650    {
2651        throw new SQLException JavaDoc("Not implemented");
2652    }
2653    
2654    /**
2655     * Retrieves a description of the table hierarchies defined in a
2656     * particular
2657     * schema in this database.
2658     *
2659     * <P>Only supertable information for tables matching the catalog, schema
2660     * and table name are returned. The table name parameter may be a fully-
2661     * qualified name, in which case, the catalog and schemaPattern parameters
2662     * are ignored. If a table does not have a super table, it is not
2663     * listed here.
2664     * Supertables have to be defined in the same catalog and schema as the
2665     * sub tables. Therefore, the type description does not need to include
2666     * this information for the supertable.
2667     *
2668     * <P>Each type description has the following columns:
2669     * <OL>
2670     * <LI><B>TABLE_CAT</B> String => the type's catalog (may be
2671     * <code>null</code>)
2672     * <LI><B>TABLE_SCHEM</B> String => type's schema (may be
2673     * <code>null</code>)
2674     * <LI><B>TABLE_NAME</B> String => type name
2675     * <LI><B>SUPERTABLE_NAME</B> String => the direct super type's name
2676     * </OL>
2677     *
2678     * <P><B>Note:</B> If the driver does not support type hierarchies, an
2679     * empty result set is returned.
2680     *
2681     * @param catalog a catalog name; "" retrieves those without a catalog;
2682     * <code>null</code> means drop catalog name from the selection
2683     * criteria
2684     * @param schemaPattern a schema name pattern; "" retrieves those
2685     * without a schema
2686     * @param tableNamePattern a table name pattern; may be a fully-qualified
2687     * name
2688     * @return a <code>ResultSet</code> object in which each row is a type
2689     * description
2690     * @throws SQLException if a database access error occurs
2691     * @since 1.4
2692     */

2693    public java.sql.ResultSet JavaDoc getSuperTables(String JavaDoc catalog,
2694                                             String JavaDoc schemaPattern,
2695                                             String JavaDoc tableNamePattern)
2696        throws SQLException JavaDoc
2697    {
2698        throw new SQLException JavaDoc("Not implemented");
2699    }
2700
2701    /**
2702     * Indicates that <code>NULL</code> values might not be allowed.
2703     * <P>
2704     * A possible value for the column
2705     * <code>NULLABLE</code> in the <code>ResultSet</code> object
2706     * returned by the method <code>getAttributes</code>.
2707     */

2708    //short attributeNoNulls = 0;
2709

2710    /**
2711     * Indicates that <code>NULL</code> values are definitely allowed.
2712     * <P>
2713     * A possible value for the column <code>NULLABLE</code>
2714     * in the <code>ResultSet</code> object
2715     * returned by the method <code>getAttributes</code>.
2716     */

2717    //short attributeNullable = 1;
2718

2719    /**
2720     * Indicates that whether <code>NULL</code> values are allowed is not
2721     * known.
2722     * <P>
2723     * A possible value for the column <code>NULLABLE</code>
2724     * in the <code>ResultSet</code> object
2725     * returned by the method <code>getAttributes</code>.
2726     */

2727    //short attributeNullableUnknown = 2;
2728

2729    /**
2730     * Retrieves a description of the given attribute of the given type
2731     * for a user-defined type (UDT) that is available in the given schema
2732     * and catalog.
2733     * <P>
2734     * Descriptions are returned only for attributes of UDTs matching the
2735     * catalog, schema, type, and attribute name criteria. They are ordered by
2736     * TYPE_SCHEM, TYPE_NAME and ORDINAL_POSITION. This description
2737     * does not contain inherited attributes.
2738     * <P>
2739     * The <code>ResultSet</code> object that is returned has the following
2740     * columns:
2741     * <OL>
2742     * <LI><B>TYPE_CAT</B> String => type catalog (may be <code>null</code>)
2743     * <LI><B>TYPE_SCHEM</B> String => type schema (may be <code>null</code>)
2744     * <LI><B>TYPE_NAME</B> String => type name
2745     * <LI><B>ATTR_NAME</B> String => attribute name
2746     * <LI><B>DATA_TYPE</B> short => attribute type SQL type from
2747     * java.sql.Types
2748     * <LI><B>ATTR_TYPE_NAME</B> String => Data source dependent type name.
2749     * For a UDT, the type name is fully qualified. For a REF, the type
2750     * name is
2751     * fully qualified and represents the target type of the reference type.
2752     * <LI><B>ATTR_SIZE</B> int => column size. For char or date
2753     * types this is the maximum number of characters; for numeric or
2754     * decimal types this is precision.
2755     * <LI><B>DECIMAL_DIGITS</B> int => the number of fractional digits
2756     * <LI><B>NUM_PREC_RADIX</B> int => Radix (typically either 10 or 2)
2757     * <LI><B>NULLABLE</B> int => whether NULL is allowed
2758     * <UL>
2759     * <LI> attributeNoNulls - might not allow NULL values
2760     * <LI> attributeNullable - definitely allows NULL values
2761     * <LI> attributeNullableUnknown - nullability unknown
2762     * </UL>
2763     * <LI><B>REMARKS</B> String => comment describing column (may be
2764     * <code>null</code>)
2765     * <LI><B>ATTR_DEF</B> String => default value (may be <code>null</code>)
2766     * <LI><B>SQL_DATA_TYPE</B> int => unused
2767     * <LI><B>SQL_DATETIME_SUB</B> int => unused
2768     * <LI><B>CHAR_OCTET_LENGTH</B> int => for char types the
2769     * maximum number of bytes in the column
2770     * <LI><B>ORDINAL_POSITION</B> int => index of column in table
2771     * (starting at 1)
2772     * <LI><B>IS_NULLABLE</B> String => "NO" means column definitely
2773     * does not allow NULL values; "YES" means the column might
2774     * allow NULL values. An empty string means unknown.
2775     * <LI><B>SCOPE_CATALOG</B> String => catalog of table that is the
2776     * scope of a reference attribute (<code>null</code> if DATA_TYPE
2777     * isn't REF)
2778     * <LI><B>SCOPE_SCHEMA</B> String => schema of table that is the
2779     * scope of a reference attribute (<code>null</code> if DATA_TYPE
2780     * isn't REF)
2781     * <LI><B>SCOPE_TABLE</B> String => table name that is the scope of a
2782     * reference attribute (<code>null</code> if the DATA_TYPE isn't REF)
2783     * <LI><B>SOURCE_DATA_TYPE</B> short => source type of a distinct type or
2784     * user-generated
2785     * Ref type,SQL type from java.sql.Types (<code>null</code> if
2786     * DATA_TYPE
2787     * isn't DISTINCT or user-generated REF)
2788     * </OL>
2789     * @param catalog a catalog name; must match the catalog name as it
2790     * is stored in the database; "" retrieves those without a catalog;
2791     * <code>null</code> means that the catalog name should not be
2792     * used to narrow
2793     * the search
2794     * @param schemaPattern a schema name pattern; must match the schema name
2795     * as it is stored in the database; "" retrieves those without a
2796     * schema;
2797     * <code>null</code> means that the schema name should not be
2798     * used to narrow
2799     * the search
2800     * @param typeNamePattern a type name pattern; must match the
2801     * type name as it is stored in the database
2802     * @param attributeNamePattern an attribute name pattern; must match
2803     * the attribute
2804     * name as it is declared in the database
2805     * @return a <code>ResultSet</code> object in which each row is an
2806     * attribute description
2807     * @exception SQLException if a database access error occurs
2808     * @since 1.4
2809     */

2810    public java.sql.ResultSet JavaDoc getAttributes(String JavaDoc catalog,
2811                                            String JavaDoc schemaPattern,
2812                                            String JavaDoc typeNamePattern,
2813                                            String JavaDoc attributeNamePattern)
2814    throws SQLException JavaDoc
2815    {
2816        throw new SQLException JavaDoc("Not implemented");
2817    }
2818
2819    /**
2820     * Retrieves whether this database supports the given result set
2821     * holdability.
2822     *
2823     * @param holdability one of the following constants:
2824     * <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
2825     * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT<code>
2826     * @return <code>true</code> if so; <code>false</code> otherwise
2827     * @exception SQLException if a database access error occurs
2828     * @see Connection
2829     * @since 1.4
2830     */

2831    public boolean supportsResultSetHoldability(int holdability)
2832        throws SQLException JavaDoc
2833    {
2834        return (holdability == ResultSet.CLOSE_CURSORS_AT_COMMIT);
2835    }
2836
2837    /**
2838     * Retrieves the default holdability of this <code>ResultSet</code>
2839     * object.
2840     *
2841     * @return the default holdability; either
2842     * <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or
2843     * <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
2844     * @exception SQLException if a database access error occurs
2845     * @since 1.4
2846     */

2847    public int getResultSetHoldability()
2848        throws SQLException JavaDoc
2849    {
2850        return ResultSet.CLOSE_CURSORS_AT_COMMIT;
2851    }
2852
2853    /**
2854     * Retrieves the major version number of the underlying database.
2855     *
2856     * @return the underlying database's major version
2857     * @exception SQLException if a database access error occurs
2858     * @since 1.4
2859     */

2860    public int getDatabaseMajorVersion()
2861        throws SQLException JavaDoc
2862    {
2863        return Version.majorVersion;
2864    }
2865
2866    /**
2867     * Retrieves the minor version number of the underlying database.
2868     *
2869     * @return underlying database's minor version
2870     * @exception SQLException if a database access error occurs
2871     * @since 1.4
2872     */

2873    public int getDatabaseMinorVersion() throws SQLException JavaDoc {
2874        return Version.minorVersion;
2875    }
2876
2877    /**
2878     * Retrieves the major JDBC version number for this
2879     * driver.
2880     *
2881     * @return JDBC version major number
2882     * @exception SQLException if a database access error occurs
2883     * @since 1.4
2884     */

2885    public int getJDBCMajorVersion()
2886        throws SQLException JavaDoc
2887    {
2888        return 3;
2889    }
2890
2891    /**
2892     * Retrieves the minor JDBC version number for this
2893     * driver.
2894     *
2895     * @return JDBC version minor number
2896     * @exception SQLException if a database access error occurs
2897     * @since 1.4
2898     */

2899    public int getJDBCMinorVersion()
2900        throws SQLException JavaDoc
2901    {
2902        return 0;
2903    }
2904
2905    /**
2906     * Indicates that the value is an
2907     * X/Open (now know as Open Group) SQL CLI SQLSTATE value.
2908     * <P>
2909     * A possible return value for the method
2910     * <code>SQLException.getSQLState</code>.
2911     * @since 1.4
2912     */

2913    //int sqlStateXOpen = 1;
2914

2915    /**
2916     * Indicates that the value is an SQL99 SQLSTATE value.
2917     * <P>
2918     * A possible return value for the method
2919     * <code>SQLException.getSQLState</code>.
2920     * @since 1.4
2921     */

2922    //int sqlStateSQL99 = 2;
2923

2924    /**
2925     * Indicates whether the SQLSTATEs returned by
2926     * <code>SQLException.getSQLState</code>
2927     * is X/Open (now known as Open Group) SQL CLI or SQL99.
2928     * @return the type of SQLSTATEs, one of:
2929     * sqlStateXOpen or
2930     * sqlStateSQL99
2931     * @throws SQLException if a database access error occurs
2932     * @since 1.4
2933     */

2934    public int getSQLStateType()
2935        throws SQLException JavaDoc
2936    {
2937        return sqlStateXOpen;
2938    }
2939
2940    /**
2941     * Indicates whether updates made to a LOB are made on a copy or directly
2942     * to the LOB.
2943     * @return <code>true</code> if updates are made to a copy of the LOB;
2944     * <code>false</code> if updates are made directly to the LOB
2945     * @throws SQLException if a database access error occurs
2946     * @since 1.4
2947     */

2948    public boolean locatorsUpdateCopy()
2949        throws SQLException JavaDoc
2950    {
2951        return true;
2952    }
2953
2954    /**
2955     * Retrieves weather this database supports statement pooling.
2956     *
2957     * @return <code>true</code> is so;
2958           <code>false</code> otherwise
2959     * @throws SQLExcpetion if a database access error occurs
2960     * @since 1.4
2961     */

2962    public boolean supportsStatementPooling()
2963        throws SQLException JavaDoc
2964    {
2965        return false;
2966    }
2967    //#endif
2968
}
2969
Popular Tags