001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     * 
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     * 
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    
018    package org.apache.commons.dbcp;
019    
020    import java.sql.Connection;
021    import java.sql.DatabaseMetaData;
022    import java.sql.ResultSet;
023    /* JDBC_4_ANT_KEY_BEGIN */
024    import java.sql.RowIdLifetime;
025    /* JDBC_4_ANT_KEY_END */
026    import java.sql.SQLException;
027    
028    /**
029     * A base delegating implementation of {@link DatabaseMetaData}.
030     * <p>
031     * Those methods that create {@link ResultSet} objects, are wrapped to
032     * create {@link DelegatingResultSet} objects and the remaining methods
033     * simply call the corresponding method on the "delegate"
034     * provided in my constructor.
035     * <p>
036     * Extends AbandonedTrace to implement DatabaseMetaData tracking and
037     * logging of code which created the DatabaseMetaData. Tracking
038     * the DatabaseMetaData ensures that the Connection which created it can
039     * close any associated ResultSets on Connection close.
040     */
041    public class DelegatingDatabaseMetaData extends AbandonedTrace
042            implements DatabaseMetaData {
043    
044        /** My delegate {@link DatabaseMetaData} */
045        protected DatabaseMetaData _meta;
046        
047        /** The connection that created me. **/
048        protected DelegatingConnection _conn = null;
049    
050        public DelegatingDatabaseMetaData(DelegatingConnection c,
051                DatabaseMetaData m) {
052            super(c);
053            _conn = c;
054            _meta = m;
055        }
056    
057        public DatabaseMetaData getDelegate() {
058            return _meta;
059        }
060    
061        public boolean equals(Object obj) {
062            DatabaseMetaData delegate = getInnermostDelegate();
063            if (delegate == null) {
064                return false;
065            }
066            if (obj instanceof DelegatingDatabaseMetaData) {
067                DelegatingDatabaseMetaData s = (DelegatingDatabaseMetaData) obj;
068                return delegate.equals(s.getInnermostDelegate());
069            }
070            else {
071                return delegate.equals(obj);
072            }
073        }
074    
075        public int hashCode() {
076            Object obj = getInnermostDelegate();
077            if (obj == null) {
078                return 0;
079            }
080            return obj.hashCode();
081        }
082    
083        /**
084         * If my underlying {@link ResultSet} is not a
085         * <tt>DelegatingResultSet</tt>, returns it,
086         * otherwise recursively invokes this method on
087         * my delegate.
088         * <p>
089         * Hence this method will return the first
090         * delegate that is not a <tt>DelegatingResultSet</tt>,
091         * or <tt>null</tt> when no non-<tt>DelegatingResultSet</tt>
092         * delegate can be found by transversing this chain.
093         * <p>
094         * This method is useful when you may have nested
095         * <tt>DelegatingResultSet</tt>s, and you want to make
096         * sure to obtain a "genuine" {@link ResultSet}.
097         */
098        public DatabaseMetaData getInnermostDelegate() {
099            DatabaseMetaData m = _meta;
100            while(m != null && m instanceof DelegatingDatabaseMetaData) {
101                m = ((DelegatingDatabaseMetaData)m).getDelegate();
102                if(this == m) {
103                    return null;
104                }
105            }
106            return m;
107        }
108        
109        protected void handleException(SQLException e) throws SQLException {
110            if (_conn != null) {
111                _conn.handleException(e);
112            }
113            else {
114                throw e;
115            }
116        }
117    
118        public boolean allProceduresAreCallable() throws SQLException {
119            { try { return _meta.allProceduresAreCallable(); }
120              catch (SQLException e) { handleException(e); return false; } }
121        }
122    
123        public boolean allTablesAreSelectable() throws SQLException {
124            { try { return _meta.allTablesAreSelectable(); }
125            catch (SQLException e) { handleException(e); return false; } }
126        }
127    
128        public boolean dataDefinitionCausesTransactionCommit() throws SQLException {
129            { try { return _meta.dataDefinitionCausesTransactionCommit(); }
130            catch (SQLException e) { handleException(e); return false; } }
131        }
132    
133        public boolean dataDefinitionIgnoredInTransactions() throws SQLException {
134            { try { return _meta.dataDefinitionIgnoredInTransactions(); }
135            catch (SQLException e) { handleException(e); return false; } }
136        }
137    
138        public boolean deletesAreDetected(int type) throws SQLException {
139            { try { return _meta.deletesAreDetected(type); }
140            catch (SQLException e) { handleException(e); return false; } }
141        }
142    
143        public boolean doesMaxRowSizeIncludeBlobs() throws SQLException {
144            { try { return _meta.doesMaxRowSizeIncludeBlobs(); }
145            catch (SQLException e) { handleException(e); return false; } }
146        }
147    
148        public ResultSet getAttributes(String catalog, String schemaPattern,
149                String typeNamePattern, String attributeNamePattern)
150                throws SQLException {
151            _conn.checkOpen();
152            try {
153                return DelegatingResultSet.wrapResultSet(_conn,_meta.getAttributes(
154                        catalog, schemaPattern, typeNamePattern,
155                        attributeNamePattern));
156            }
157            catch (SQLException e) {
158                handleException(e);
159                throw new AssertionError();
160            }
161        }
162    
163        public ResultSet getBestRowIdentifier(String catalog, String schema,
164                String table, int scope, boolean nullable) throws SQLException {
165            _conn.checkOpen();
166            try {
167                return DelegatingResultSet.wrapResultSet(_conn,
168                        _meta.getBestRowIdentifier(catalog, schema, table, scope,
169                                nullable));
170            }
171            catch (SQLException e) {
172                handleException(e);
173                throw new AssertionError();
174            }
175        }
176    
177        public String getCatalogSeparator() throws SQLException {
178            { try { return _meta.getCatalogSeparator(); }
179            catch (SQLException e) { handleException(e); throw new AssertionError(); } }
180        }
181    
182        public String getCatalogTerm() throws SQLException {
183            { try { return _meta.getCatalogTerm(); }
184            catch (SQLException e) { handleException(e); throw new AssertionError(); } }
185        }
186    
187        public ResultSet getCatalogs() throws SQLException {
188            _conn.checkOpen();
189            try {
190                return DelegatingResultSet.wrapResultSet(_conn,
191                        _meta.getCatalogs());
192            }
193            catch (SQLException e) {
194                handleException(e);
195                throw new AssertionError();
196            }
197        }
198    
199        public ResultSet getColumnPrivileges(String catalog, String schema,
200                String table, String columnNamePattern) throws SQLException {
201            _conn.checkOpen();
202            try {
203                return DelegatingResultSet.wrapResultSet(_conn,
204                        _meta.getColumnPrivileges(catalog, schema, table,
205                                columnNamePattern));
206            }
207            catch (SQLException e) {
208                handleException(e);
209                throw new AssertionError();
210            }
211        }
212    
213        public ResultSet getColumns(String catalog, String schemaPattern,
214                String tableNamePattern, String columnNamePattern)
215                throws SQLException {
216            _conn.checkOpen();
217            try {
218                return DelegatingResultSet.wrapResultSet(_conn,
219                        _meta.getColumns(catalog, schemaPattern, tableNamePattern,
220                                columnNamePattern));
221            }
222            catch (SQLException e) {
223                handleException(e);
224                throw new AssertionError();
225            }
226        }
227    
228        public Connection getConnection() throws SQLException {
229            return _conn;
230        }
231    
232        public ResultSet getCrossReference(String parentCatalog,
233                String parentSchema, String parentTable, String foreignCatalog,
234                String foreignSchema, String foreignTable) throws SQLException {
235            _conn.checkOpen();
236            try {
237                return DelegatingResultSet.wrapResultSet(_conn,
238                        _meta.getCrossReference(parentCatalog, parentSchema,
239                                parentTable, foreignCatalog, foreignSchema,
240                                foreignTable));
241            }
242            catch (SQLException e) {
243                handleException(e);
244                throw new AssertionError();
245            }
246        }
247    
248        public int getDatabaseMajorVersion() throws SQLException {
249            { try { return _meta.getDatabaseMajorVersion(); }
250            catch (SQLException e) { handleException(e); return 0; } }
251        }
252    
253        public int getDatabaseMinorVersion() throws SQLException {
254            { try { return _meta.getDatabaseMinorVersion(); }
255            catch (SQLException e) { handleException(e); return 0; } }
256        }
257    
258        public String getDatabaseProductName() throws SQLException {
259            { try { return _meta.getDatabaseProductName(); }
260            catch (SQLException e) { handleException(e); throw new AssertionError(); } }
261        }
262    
263        public String getDatabaseProductVersion() throws SQLException {
264            { try { return _meta.getDatabaseProductVersion(); }
265            catch (SQLException e) { handleException(e); throw new AssertionError(); } }
266        }
267    
268        public int getDefaultTransactionIsolation() throws SQLException {
269            { try { return _meta.getDefaultTransactionIsolation(); }
270            catch (SQLException e) { handleException(e); return 0; } }
271        }
272    
273        public int getDriverMajorVersion() {return _meta.getDriverMajorVersion();}
274    
275        public int getDriverMinorVersion() {return _meta.getDriverMinorVersion();}
276    
277        public String getDriverName() throws SQLException {
278            { try { return _meta.getDriverName(); }
279            catch (SQLException e) { handleException(e); throw new AssertionError(); } }
280        }
281    
282        public String getDriverVersion() throws SQLException {
283            { try { return _meta.getDriverVersion(); }
284            catch (SQLException e) { handleException(e); throw new AssertionError(); } }
285        }
286    
287        public ResultSet getExportedKeys(String catalog, String schema, String table)
288                throws SQLException {
289            _conn.checkOpen();
290            try {
291                return DelegatingResultSet.wrapResultSet(_conn,
292                        _meta.getExportedKeys(catalog, schema, table));
293            }
294            catch (SQLException e) {
295                handleException(e);
296                throw new AssertionError();
297            }
298        }
299    
300        public String getExtraNameCharacters() throws SQLException {
301            { try { return _meta.getExtraNameCharacters(); }
302            catch (SQLException e) { handleException(e); throw new AssertionError(); } }
303        }
304    
305        public String getIdentifierQuoteString() throws SQLException {
306            { try { return _meta.getIdentifierQuoteString(); }
307            catch (SQLException e) { handleException(e); throw new AssertionError(); } }
308        }
309    
310        public ResultSet getImportedKeys(String catalog, String schema, String table)
311                throws SQLException {
312            _conn.checkOpen();
313            try {
314                return DelegatingResultSet.wrapResultSet(_conn,
315                        _meta.getImportedKeys(catalog, schema, table));
316            }
317            catch (SQLException e) {
318                handleException(e);
319                throw new AssertionError();
320            }
321        }
322    
323        public ResultSet getIndexInfo(String catalog, String schema, String table,
324                boolean unique, boolean approximate) throws SQLException {
325            _conn.checkOpen();
326            try {
327                return DelegatingResultSet.wrapResultSet(_conn,
328                        _meta.getIndexInfo(catalog, schema, table, unique,
329                                approximate));
330            }
331            catch (SQLException e) {
332                handleException(e);
333                throw new AssertionError();
334            }
335        }
336    
337        public int getJDBCMajorVersion() throws SQLException {
338            { try { return _meta.getJDBCMajorVersion(); }
339            catch (SQLException e) { handleException(e); return 0; } }
340        }
341    
342        public int getJDBCMinorVersion() throws SQLException {
343            { try { return _meta.getJDBCMinorVersion(); }
344            catch (SQLException e) { handleException(e); return 0; } }
345        }
346    
347        public int getMaxBinaryLiteralLength() throws SQLException {
348            { try { return _meta.getMaxBinaryLiteralLength(); }
349            catch (SQLException e) { handleException(e); return 0; } }
350        }
351    
352        public int getMaxCatalogNameLength() throws SQLException {
353            { try { return _meta.getMaxCatalogNameLength(); }
354            catch (SQLException e) { handleException(e); return 0; } }
355        }
356    
357        public int getMaxCharLiteralLength() throws SQLException {
358            { try { return _meta.getMaxCharLiteralLength(); }
359            catch (SQLException e) { handleException(e); return 0; } }
360        }
361    
362        public int getMaxColumnNameLength() throws SQLException {
363            { try { return _meta.getMaxColumnNameLength(); }
364            catch (SQLException e) { handleException(e); return 0; } }
365        }
366    
367        public int getMaxColumnsInGroupBy() throws SQLException {
368            { try { return _meta.getMaxColumnsInGroupBy(); }
369            catch (SQLException e) { handleException(e); return 0; } }
370        }
371    
372        public int getMaxColumnsInIndex() throws SQLException {
373            { try { return _meta.getMaxColumnsInIndex(); }
374            catch (SQLException e) { handleException(e); return 0; } }
375        }
376    
377        public int getMaxColumnsInOrderBy() throws SQLException {
378            { try { return _meta.getMaxColumnsInOrderBy(); }
379            catch (SQLException e) { handleException(e); return 0; } }
380        }
381    
382        public int getMaxColumnsInSelect() throws SQLException {
383            { try { return _meta.getMaxColumnsInSelect(); }
384            catch (SQLException e) { handleException(e); return 0; } }
385        }
386    
387        public int getMaxColumnsInTable() throws SQLException {
388            { try { return _meta.getMaxColumnsInTable(); }
389            catch (SQLException e) { handleException(e); return 0; } }
390        }
391    
392        public int getMaxConnections() throws SQLException {
393            { try { return _meta.getMaxConnections(); }
394            catch (SQLException e) { handleException(e); return 0; } }
395        }
396    
397        public int getMaxCursorNameLength() throws SQLException {
398            { try { return _meta.getMaxCursorNameLength(); }
399            catch (SQLException e) { handleException(e); return 0; } }
400        }
401    
402        public int getMaxIndexLength() throws SQLException {
403            { try { return _meta.getMaxIndexLength(); }
404            catch (SQLException e) { handleException(e); return 0; } }
405        }
406    
407        public int getMaxProcedureNameLength() throws SQLException {
408            { try { return _meta.getMaxProcedureNameLength(); }
409            catch (SQLException e) { handleException(e); return 0; } }
410        }
411    
412        public int getMaxRowSize() throws SQLException {
413            { try { return _meta.getMaxRowSize(); }
414            catch (SQLException e) { handleException(e); return 0; } }
415        }
416    
417        public int getMaxSchemaNameLength() throws SQLException {
418            { try { return _meta.getMaxSchemaNameLength(); }
419            catch (SQLException e) { handleException(e); return 0; } }
420        }
421    
422        public int getMaxStatementLength() throws SQLException {
423            { try { return _meta.getMaxStatementLength(); }
424            catch (SQLException e) { handleException(e); return 0; } }
425        }
426    
427        public int getMaxStatements() throws SQLException {
428            { try { return _meta.getMaxStatements(); }
429            catch (SQLException e) { handleException(e); return 0; } }
430        }
431    
432        public int getMaxTableNameLength() throws SQLException {
433            { try { return _meta.getMaxTableNameLength(); }
434            catch (SQLException e) { handleException(e); return 0; } }
435        }
436    
437        public int getMaxTablesInSelect() throws SQLException {
438            { try { return _meta.getMaxTablesInSelect(); }
439            catch (SQLException e) { handleException(e); return 0; } }
440        }
441    
442        public int getMaxUserNameLength() throws SQLException {
443            { try { return _meta.getMaxUserNameLength(); }
444            catch (SQLException e) { handleException(e); return 0; } }
445        }
446    
447        public String getNumericFunctions() throws SQLException {
448            { try { return _meta.getNumericFunctions(); }
449            catch (SQLException e) { handleException(e); throw new AssertionError(); } }
450        }
451    
452        public ResultSet getPrimaryKeys(String catalog, String schema, String table)
453                throws SQLException {
454            _conn.checkOpen();
455            try {
456                return DelegatingResultSet.wrapResultSet(_conn,
457                        _meta.getPrimaryKeys(catalog, schema, table));
458            }
459            catch (SQLException e) {
460                handleException(e);
461                throw new AssertionError();
462            }
463        }
464    
465        public ResultSet getProcedureColumns(String catalog, String schemaPattern,
466                String procedureNamePattern, String columnNamePattern)
467                throws SQLException {
468            _conn.checkOpen();
469            try {
470                return DelegatingResultSet.wrapResultSet(_conn,
471                        _meta.getProcedureColumns(catalog, schemaPattern,
472                                procedureNamePattern, columnNamePattern));
473            }
474            catch (SQLException e) {
475                handleException(e);
476                throw new AssertionError();
477            }
478        }
479    
480        public String getProcedureTerm() throws SQLException {
481            { try { return _meta.getProcedureTerm(); }
482            catch (SQLException e) { handleException(e); throw new AssertionError(); } }
483        }
484    
485        public ResultSet getProcedures(String catalog, String schemaPattern,
486                String procedureNamePattern) throws SQLException {
487            _conn.checkOpen();
488            try {
489                return DelegatingResultSet.wrapResultSet(_conn,
490                        _meta.getProcedures(catalog, schemaPattern,
491                                procedureNamePattern));
492            }
493            catch (SQLException e) {
494                handleException(e);
495                throw new AssertionError();
496            }
497        }
498    
499        public int getResultSetHoldability() throws SQLException {
500            { try { return _meta.getResultSetHoldability(); }
501            catch (SQLException e) { handleException(e); return 0; } }
502        }
503    
504        public String getSQLKeywords() throws SQLException {
505            { try { return _meta.getSQLKeywords(); }
506            catch (SQLException e) { handleException(e); throw new AssertionError(); } }
507        }
508    
509        public int getSQLStateType() throws SQLException {
510            { try { return _meta.getSQLStateType(); }
511            catch (SQLException e) { handleException(e); return 0; } }
512        }
513    
514        public String getSchemaTerm() throws SQLException {
515            { try { return _meta.getSchemaTerm(); }
516            catch (SQLException e) { handleException(e); throw new AssertionError(); } }
517        }
518    
519        public ResultSet getSchemas() throws SQLException {
520            _conn.checkOpen();
521            try {
522                return DelegatingResultSet.wrapResultSet(_conn,
523                        _meta.getSchemas());
524            }
525            catch (SQLException e) {
526                handleException(e);
527                throw new AssertionError();
528            }
529        }
530    
531        public String getSearchStringEscape() throws SQLException {
532            { try { return _meta.getSearchStringEscape(); }
533            catch (SQLException e) { handleException(e); throw new AssertionError(); } }
534        }
535    
536        public String getStringFunctions() throws SQLException {
537            { try { return _meta.getStringFunctions(); }
538            catch (SQLException e) { handleException(e); throw new AssertionError(); } }
539        }
540    
541        public ResultSet getSuperTables(String catalog, String schemaPattern,
542                String tableNamePattern) throws SQLException {
543            _conn.checkOpen();
544            try {
545                return DelegatingResultSet.wrapResultSet(_conn,
546                        _meta.getSuperTables(catalog, schemaPattern,
547                                tableNamePattern));
548            }
549            catch (SQLException e) {
550                handleException(e);
551                throw new AssertionError();
552            }
553        }
554    
555        public ResultSet getSuperTypes(String catalog, String schemaPattern,
556                String typeNamePattern) throws SQLException {
557            _conn.checkOpen();
558            try {
559                return DelegatingResultSet.wrapResultSet(_conn,
560                        _meta.getSuperTypes(catalog, schemaPattern,
561                                typeNamePattern));
562            }
563            catch (SQLException e) {
564                handleException(e);
565                throw new AssertionError();
566            }
567        }
568    
569        public String getSystemFunctions() throws SQLException {
570            { try { return _meta.getSystemFunctions(); }
571            catch (SQLException e) { handleException(e); throw new AssertionError(); } }
572        }
573    
574        public ResultSet getTablePrivileges(String catalog, String schemaPattern,
575                String tableNamePattern) throws SQLException {
576            _conn.checkOpen();
577            try {
578                return DelegatingResultSet.wrapResultSet(_conn,
579                        _meta.getTablePrivileges(catalog, schemaPattern,
580                                tableNamePattern));
581            }
582            catch (SQLException e) {
583                handleException(e);
584                throw new AssertionError();
585            }
586        }
587    
588        public ResultSet getTableTypes() throws SQLException {
589            _conn.checkOpen();
590            try {
591                return DelegatingResultSet.wrapResultSet(_conn,
592                        _meta.getTableTypes());
593            }
594            catch (SQLException e) {
595                handleException(e);
596                throw new AssertionError();
597            }
598        }
599    
600        public ResultSet getTables(String catalog, String schemaPattern,
601                String tableNamePattern, String[] types) throws SQLException {
602            _conn.checkOpen();
603            try {
604                return DelegatingResultSet.wrapResultSet(_conn,
605                        _meta.getTables(catalog, schemaPattern, tableNamePattern,
606                                types));
607            }
608            catch (SQLException e) {
609                handleException(e);
610                throw new AssertionError();
611            }
612        }
613    
614        public String getTimeDateFunctions() throws SQLException {
615            { try { return _meta.getTimeDateFunctions(); }
616            catch (SQLException e) { handleException(e); throw new AssertionError(); } }
617        }
618    
619        public ResultSet getTypeInfo() throws SQLException {
620            _conn.checkOpen();
621            try {
622                return DelegatingResultSet.wrapResultSet(_conn,
623                        _meta.getTypeInfo());
624            }
625            catch (SQLException e) {
626                handleException(e);
627                throw new AssertionError();
628            }
629        }
630    
631        public ResultSet getUDTs(String catalog, String schemaPattern,
632                String typeNamePattern, int[] types) throws SQLException {
633            _conn.checkOpen();
634            try {
635                return DelegatingResultSet.wrapResultSet(_conn,
636                        _meta.getUDTs(catalog, schemaPattern, typeNamePattern,
637                                types));
638            }
639            catch (SQLException e) {
640                handleException(e);
641                throw new AssertionError();
642            }
643        }
644    
645        public String getURL() throws SQLException {
646            { try { return _meta.getURL(); }
647            catch (SQLException e) { handleException(e); throw new AssertionError(); } }
648        }
649    
650        public String getUserName() throws SQLException {
651            { try { return _meta.getUserName(); }
652            catch (SQLException e) { handleException(e); throw new AssertionError(); } }
653        }
654    
655        public ResultSet getVersionColumns(String catalog, String schema,
656                String table) throws SQLException {
657            _conn.checkOpen();
658            try {
659                return DelegatingResultSet.wrapResultSet(_conn,
660                        _meta.getVersionColumns(catalog, schema, table));
661            }
662            catch (SQLException e) {
663                handleException(e);
664                throw new AssertionError();
665            }
666        }
667    
668        public boolean insertsAreDetected(int type) throws SQLException {
669            { try { return _meta.insertsAreDetected(type); }
670            catch (SQLException e) { handleException(e); return false; } }
671        }
672    
673        public boolean isCatalogAtStart() throws SQLException {
674            { try { return _meta.isCatalogAtStart(); }
675            catch (SQLException e) { handleException(e); return false; } }
676        }
677    
678        public boolean isReadOnly() throws SQLException {
679            { try { return _meta.isReadOnly(); }
680            catch (SQLException e) { handleException(e); return false; } }
681        }
682    
683        public boolean locatorsUpdateCopy() throws SQLException {
684            { try { return _meta.locatorsUpdateCopy(); }
685            catch (SQLException e) { handleException(e); return false; } }
686        }
687    
688        public boolean nullPlusNonNullIsNull() throws SQLException {
689            { try { return _meta.nullPlusNonNullIsNull(); }
690            catch (SQLException e) { handleException(e); return false; } }
691        }
692    
693        public boolean nullsAreSortedAtEnd() throws SQLException {
694            { try { return _meta.nullsAreSortedAtEnd(); }
695            catch (SQLException e) { handleException(e); return false; } }
696        }
697    
698        public boolean nullsAreSortedAtStart() throws SQLException {
699            { try { return _meta.nullsAreSortedAtStart(); }
700            catch (SQLException e) { handleException(e); return false; } }
701        }
702    
703        public boolean nullsAreSortedHigh() throws SQLException {
704            { try { return _meta.nullsAreSortedHigh(); }
705            catch (SQLException e) { handleException(e); return false; } }
706        }
707    
708        public boolean nullsAreSortedLow() throws SQLException {
709            { try { return _meta.nullsAreSortedLow(); }
710            catch (SQLException e) { handleException(e); return false; } }
711        }
712    
713        public boolean othersDeletesAreVisible(int type) throws SQLException {
714            { try { return _meta.othersDeletesAreVisible(type); }
715            catch (SQLException e) { handleException(e); return false; } }
716        }
717    
718        public boolean othersInsertsAreVisible(int type) throws SQLException {
719            { try { return _meta.othersInsertsAreVisible(type); }
720            catch (SQLException e) { handleException(e); return false; } }
721        }
722    
723        public boolean othersUpdatesAreVisible(int type) throws SQLException {
724            { try { return _meta.othersUpdatesAreVisible(type); }
725            catch (SQLException e) { handleException(e); return false; } }
726        }
727    
728        public boolean ownDeletesAreVisible(int type) throws SQLException {
729            { try { return _meta.ownDeletesAreVisible(type); }
730            catch (SQLException e) { handleException(e); return false; } }
731        }
732    
733        public boolean ownInsertsAreVisible(int type) throws SQLException {
734            { try { return _meta.ownInsertsAreVisible(type); }
735            catch (SQLException e) { handleException(e); return false; } }
736        }
737    
738        public boolean ownUpdatesAreVisible(int type) throws SQLException {
739            { try { return _meta.ownUpdatesAreVisible(type); }
740            catch (SQLException e) { handleException(e); return false; } }
741        }
742    
743        public boolean storesLowerCaseIdentifiers() throws SQLException {
744            { try { return _meta.storesLowerCaseIdentifiers(); }
745            catch (SQLException e) { handleException(e); return false; } }
746        }
747    
748        public boolean storesLowerCaseQuotedIdentifiers() throws SQLException {
749            { try { return _meta.storesLowerCaseQuotedIdentifiers(); }
750            catch (SQLException e) { handleException(e); return false; } }
751        }
752    
753        public boolean storesMixedCaseIdentifiers() throws SQLException {
754            { try { return _meta.storesMixedCaseIdentifiers(); }
755            catch (SQLException e) { handleException(e); return false; } }
756        }
757    
758        public boolean storesMixedCaseQuotedIdentifiers() throws SQLException {
759            { try { return _meta.storesMixedCaseQuotedIdentifiers(); }
760            catch (SQLException e) { handleException(e); return false; } }
761        }
762    
763        public boolean storesUpperCaseIdentifiers() throws SQLException {
764            { try { return _meta.storesUpperCaseIdentifiers(); }
765            catch (SQLException e) { handleException(e); return false; } }
766        }
767    
768        public boolean storesUpperCaseQuotedIdentifiers() throws SQLException {
769            { try { return _meta.storesUpperCaseQuotedIdentifiers(); }
770            catch (SQLException e) { handleException(e); return false; } }
771        }
772    
773        public boolean supportsANSI92EntryLevelSQL() throws SQLException {
774            { try { return _meta.supportsANSI92EntryLevelSQL(); }
775            catch (SQLException e) { handleException(e); return false; } }
776        }
777    
778        public boolean supportsANSI92FullSQL() throws SQLException {
779            { try { return _meta.supportsANSI92FullSQL(); }
780            catch (SQLException e) { handleException(e); return false; } }
781        }
782    
783        public boolean supportsANSI92IntermediateSQL() throws SQLException {
784            { try { return _meta.supportsANSI92IntermediateSQL(); }
785            catch (SQLException e) { handleException(e); return false; } }
786        }
787    
788        public boolean supportsAlterTableWithAddColumn() throws SQLException {
789            { try { return _meta.supportsAlterTableWithAddColumn(); }
790            catch (SQLException e) { handleException(e); return false; } }
791        }
792    
793        public boolean supportsAlterTableWithDropColumn() throws SQLException {
794            { try { return _meta.supportsAlterTableWithDropColumn(); }
795            catch (SQLException e) { handleException(e); return false; } }
796        }
797    
798        public boolean supportsBatchUpdates() throws SQLException {
799            { try { return _meta.supportsBatchUpdates(); }
800            catch (SQLException e) { handleException(e); return false; } }
801        }
802    
803        public boolean supportsCatalogsInDataManipulation() throws SQLException {
804            { try { return _meta.supportsCatalogsInDataManipulation(); }
805            catch (SQLException e) { handleException(e); return false; } }
806        }
807    
808        public boolean supportsCatalogsInIndexDefinitions() throws SQLException {
809            { try { return _meta.supportsCatalogsInIndexDefinitions(); }
810            catch (SQLException e) { handleException(e); return false; } }
811        }
812    
813        public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException {
814            { try { return _meta.supportsCatalogsInPrivilegeDefinitions(); }
815            catch (SQLException e) { handleException(e); return false; } }
816        }
817    
818        public boolean supportsCatalogsInProcedureCalls() throws SQLException {
819            { try { return _meta.supportsCatalogsInProcedureCalls(); }
820            catch (SQLException e) { handleException(e); return false; } }
821        }
822    
823        public boolean supportsCatalogsInTableDefinitions() throws SQLException {
824            { try { return _meta.supportsCatalogsInTableDefinitions(); }
825            catch (SQLException e) { handleException(e); return false; } }
826        }
827    
828        public boolean supportsColumnAliasing() throws SQLException {
829            { try { return _meta.supportsColumnAliasing(); }
830            catch (SQLException e) { handleException(e); return false; } }
831        }
832    
833        public boolean supportsConvert() throws SQLException {
834            { try { return _meta.supportsConvert(); }
835            catch (SQLException e) { handleException(e); return false; } }
836        }
837    
838        public boolean supportsConvert(int fromType, int toType)
839                throws SQLException {
840            { try { return _meta.supportsConvert(fromType, toType); }
841            catch (SQLException e) { handleException(e); return false; } }
842        }
843    
844        public boolean supportsCoreSQLGrammar() throws SQLException {
845            { try { return _meta.supportsCoreSQLGrammar(); }
846            catch (SQLException e) { handleException(e); return false; } }
847        }
848    
849        public boolean supportsCorrelatedSubqueries() throws SQLException {
850            { try { return _meta.supportsCorrelatedSubqueries(); }
851            catch (SQLException e) { handleException(e); return false; } }
852        }
853    
854        public boolean supportsDataDefinitionAndDataManipulationTransactions()
855                throws SQLException {
856            { try { return _meta.supportsDataDefinitionAndDataManipulationTransactions(); }
857            catch (SQLException e) { handleException(e); return false; } }
858        }
859    
860        public boolean supportsDataManipulationTransactionsOnly()
861                throws SQLException {
862            { try { return _meta.supportsDataManipulationTransactionsOnly(); }
863            catch (SQLException e) { handleException(e); return false; } }
864        }
865    
866        public boolean supportsDifferentTableCorrelationNames() throws SQLException {
867            { try { return _meta.supportsDifferentTableCorrelationNames(); }
868            catch (SQLException e) { handleException(e); return false; } }
869        }
870    
871        public boolean supportsExpressionsInOrderBy() throws SQLException {
872            { try { return _meta.supportsExpressionsInOrderBy(); }
873            catch (SQLException e) { handleException(e); return false; } }
874        }
875    
876        public boolean supportsExtendedSQLGrammar() throws SQLException {
877            { try { return _meta.supportsExtendedSQLGrammar(); }
878            catch (SQLException e) { handleException(e); return false; } }
879        }
880    
881        public boolean supportsFullOuterJoins() throws SQLException {
882            { try { return _meta.supportsFullOuterJoins(); }
883            catch (SQLException e) { handleException(e); return false; } }
884        }
885    
886        public boolean supportsGetGeneratedKeys() throws SQLException {
887            { try { return _meta.supportsGetGeneratedKeys(); }
888            catch (SQLException e) { handleException(e); return false; } }
889        }
890    
891        public boolean supportsGroupBy() throws SQLException {
892            { try { return _meta.supportsGroupBy(); }
893            catch (SQLException e) { handleException(e); return false; } }
894        }
895    
896        public boolean supportsGroupByBeyondSelect() throws SQLException {
897            { try { return _meta.supportsGroupByBeyondSelect(); }
898            catch (SQLException e) { handleException(e); return false; } }
899        }
900    
901        public boolean supportsGroupByUnrelated() throws SQLException {
902            { try { return _meta.supportsGroupByUnrelated(); }
903            catch (SQLException e) { handleException(e); return false; } }
904        }
905    
906        public boolean supportsIntegrityEnhancementFacility() throws SQLException {
907            { try { return _meta.supportsIntegrityEnhancementFacility(); }
908            catch (SQLException e) { handleException(e); return false; } }
909        }
910    
911        public boolean supportsLikeEscapeClause() throws SQLException {
912            { try { return _meta.supportsLikeEscapeClause(); }
913            catch (SQLException e) { handleException(e); return false; } }
914        }
915    
916        public boolean supportsLimitedOuterJoins() throws SQLException {
917            { try { return _meta.supportsLimitedOuterJoins(); }
918            catch (SQLException e) { handleException(e); return false; } }
919        }
920    
921        public boolean supportsMinimumSQLGrammar() throws SQLException {
922            { try { return _meta.supportsMinimumSQLGrammar(); }
923            catch (SQLException e) { handleException(e); return false; } }
924        }
925    
926        public boolean supportsMixedCaseIdentifiers() throws SQLException {
927            { try { return _meta.supportsMixedCaseIdentifiers(); }
928            catch (SQLException e) { handleException(e); return false; } }
929        }
930    
931        public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException {
932            { try { return _meta.supportsMixedCaseQuotedIdentifiers(); }
933            catch (SQLException e) { handleException(e); return false; } }
934        }
935    
936        public boolean supportsMultipleOpenResults() throws SQLException {
937            { try { return _meta.supportsMultipleOpenResults(); }
938            catch (SQLException e) { handleException(e); return false; } }
939        }
940    
941        public boolean supportsMultipleResultSets() throws SQLException {
942            { try { return _meta.supportsMultipleResultSets(); }
943            catch (SQLException e) { handleException(e); return false; } }
944        }
945    
946        public boolean supportsMultipleTransactions() throws SQLException {
947            { try { return _meta.supportsMultipleTransactions(); }
948            catch (SQLException e) { handleException(e); return false; } }
949        }
950    
951        public boolean supportsNamedParameters() throws SQLException {
952            { try { return _meta.supportsNamedParameters(); }
953            catch (SQLException e) { handleException(e); return false; } }
954        }
955    
956        public boolean supportsNonNullableColumns() throws SQLException {
957            { try { return _meta.supportsNonNullableColumns(); }
958            catch (SQLException e) { handleException(e); return false; } }
959        }
960    
961        public boolean supportsOpenCursorsAcrossCommit() throws SQLException {
962            { try { return _meta.supportsOpenCursorsAcrossCommit(); }
963            catch (SQLException e) { handleException(e); return false; } }
964        }
965    
966        public boolean supportsOpenCursorsAcrossRollback() throws SQLException {
967            { try { return _meta.supportsOpenCursorsAcrossRollback(); }
968            catch (SQLException e) { handleException(e); return false; } }
969        }
970    
971        public boolean supportsOpenStatementsAcrossCommit() throws SQLException {
972            { try { return _meta.supportsOpenStatementsAcrossCommit(); }
973            catch (SQLException e) { handleException(e); return false; } }
974        }
975    
976        public boolean supportsOpenStatementsAcrossRollback() throws SQLException {
977            { try { return _meta.supportsOpenStatementsAcrossRollback(); }
978            catch (SQLException e) { handleException(e); return false; } }
979        }
980    
981        public boolean supportsOrderByUnrelated() throws SQLException {
982            { try { return _meta.supportsOrderByUnrelated(); }
983            catch (SQLException e) { handleException(e); return false; } }
984        }
985    
986        public boolean supportsOuterJoins() throws SQLException {
987            { try { return _meta.supportsOuterJoins(); }
988            catch (SQLException e) { handleException(e); return false; } }
989        }
990    
991        public boolean supportsPositionedDelete() throws SQLException {
992            { try { return _meta.supportsPositionedDelete(); }
993            catch (SQLException e) { handleException(e); return false; } }
994        }
995    
996        public boolean supportsPositionedUpdate() throws SQLException {
997            { try { return _meta.supportsPositionedUpdate(); }
998            catch (SQLException e) { handleException(e); return false; } }
999        }
1000    
1001        public boolean supportsResultSetConcurrency(int type, int concurrency)
1002                throws SQLException {
1003            { try { return _meta.supportsResultSetConcurrency(type, concurrency); }
1004            catch (SQLException e) { handleException(e); return false; } }
1005        }
1006    
1007        public boolean supportsResultSetHoldability(int holdability)
1008                throws SQLException {
1009            { try { return _meta.supportsResultSetHoldability(holdability); }
1010            catch (SQLException e) { handleException(e); return false; } }
1011        }
1012    
1013        public boolean supportsResultSetType(int type) throws SQLException {
1014            { try { return _meta.supportsResultSetType(type); }
1015            catch (SQLException e) { handleException(e); return false; } }
1016        }
1017    
1018        public boolean supportsSavepoints() throws SQLException {
1019            { try { return _meta.supportsSavepoints(); }
1020            catch (SQLException e) { handleException(e); return false; } }
1021        }
1022    
1023        public boolean supportsSchemasInDataManipulation() throws SQLException {
1024            { try { return _meta.supportsSchemasInDataManipulation(); }
1025            catch (SQLException e) { handleException(e); return false; } }
1026        }
1027    
1028        public boolean supportsSchemasInIndexDefinitions() throws SQLException {
1029            { try { return _meta.supportsSchemasInIndexDefinitions(); }
1030            catch (SQLException e) { handleException(e); return false; } }
1031        }
1032    
1033        public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException {
1034            { try { return _meta.supportsSchemasInPrivilegeDefinitions(); }
1035            catch (SQLException e) { handleException(e); return false; } }
1036        }
1037    
1038        public boolean supportsSchemasInProcedureCalls() throws SQLException {
1039            { try { return _meta.supportsSchemasInProcedureCalls(); }
1040            catch (SQLException e) { handleException(e); return false; } }
1041        }
1042    
1043        public boolean supportsSchemasInTableDefinitions() throws SQLException {
1044            { try { return _meta.supportsSchemasInTableDefinitions(); }
1045            catch (SQLException e) { handleException(e); return false; } }
1046        }
1047    
1048        public boolean supportsSelectForUpdate() throws SQLException {
1049            { try { return _meta.supportsSelectForUpdate(); }
1050            catch (SQLException e) { handleException(e); return false; } }
1051        }
1052    
1053        public boolean supportsStatementPooling() throws SQLException {
1054            { try { return _meta.supportsStatementPooling(); }
1055            catch (SQLException e) { handleException(e); return false; } }
1056        }
1057    
1058        public boolean supportsStoredProcedures() throws SQLException {
1059            { try { return _meta.supportsStoredProcedures(); }
1060            catch (SQLException e) { handleException(e); return false; } }
1061        }
1062    
1063        public boolean supportsSubqueriesInComparisons() throws SQLException {
1064            { try { return _meta.supportsSubqueriesInComparisons(); }
1065            catch (SQLException e) { handleException(e); return false; } }
1066        }
1067    
1068        public boolean supportsSubqueriesInExists() throws SQLException {
1069            { try { return _meta.supportsSubqueriesInExists(); }
1070            catch (SQLException e) { handleException(e); return false; } }
1071        }
1072    
1073        public boolean supportsSubqueriesInIns() throws SQLException {
1074            { try { return _meta.supportsSubqueriesInIns(); }
1075            catch (SQLException e) { handleException(e); return false; } }
1076        }
1077    
1078        public boolean supportsSubqueriesInQuantifieds() throws SQLException {
1079            { try { return _meta.supportsSubqueriesInQuantifieds(); }
1080            catch (SQLException e) { handleException(e); return false; } }
1081        }
1082    
1083        public boolean supportsTableCorrelationNames() throws SQLException {
1084            { try { return _meta.supportsTableCorrelationNames(); }
1085            catch (SQLException e) { handleException(e); return false; } }
1086        }
1087    
1088        public boolean supportsTransactionIsolationLevel(int level)
1089                throws SQLException {
1090            { try { return _meta.supportsTransactionIsolationLevel(level); }
1091            catch (SQLException e) { handleException(e); return false; } }
1092        }
1093    
1094        public boolean supportsTransactions() throws SQLException {
1095            { try { return _meta.supportsTransactions(); }
1096            catch (SQLException e) { handleException(e); return false; } }
1097        }
1098    
1099        public boolean supportsUnion() throws SQLException {
1100            { try { return _meta.supportsUnion(); }
1101            catch (SQLException e) { handleException(e); return false; } }
1102        }
1103    
1104        public boolean supportsUnionAll() throws SQLException {
1105            { try { return _meta.supportsUnionAll(); }
1106            catch (SQLException e) { handleException(e); return false; } }
1107        }
1108    
1109        public boolean updatesAreDetected(int type) throws SQLException {
1110            { try { return _meta.updatesAreDetected(type); }
1111            catch (SQLException e) { handleException(e); return false; } }
1112        }
1113    
1114        public boolean usesLocalFilePerTable() throws SQLException {
1115            { try { return _meta.usesLocalFilePerTable(); }
1116            catch (SQLException e) { handleException(e); return false; } }
1117        }
1118    
1119        public boolean usesLocalFiles() throws SQLException {
1120            { try { return _meta.usesLocalFiles(); }
1121            catch (SQLException e) { handleException(e); return false; } }
1122        }
1123    
1124        /* JDBC_4_ANT_KEY_BEGIN */
1125    
1126        public boolean isWrapperFor(Class<?> iface) throws SQLException {
1127            return iface.isAssignableFrom(getClass()) || _meta.isWrapperFor(iface);
1128        }
1129    
1130        public <T> T unwrap(Class<T> iface) throws SQLException {
1131            if (iface.isAssignableFrom(getClass())) {
1132                return iface.cast(this);
1133            } else if (iface.isAssignableFrom(_meta.getClass())) {
1134                return iface.cast(_meta);
1135            } else {
1136                return _meta.unwrap(iface);
1137            }
1138        }
1139        
1140        public RowIdLifetime getRowIdLifetime() throws SQLException {
1141            { try { return _meta.getRowIdLifetime(); }
1142            catch (SQLException e) { handleException(e); throw new AssertionError(); } }
1143        }
1144    
1145        public ResultSet getSchemas(String catalog, String schemaPattern)
1146        throws SQLException {
1147            _conn.checkOpen();
1148            try {
1149                return DelegatingResultSet.wrapResultSet(_conn,
1150                        _meta.getSchemas(catalog, schemaPattern));
1151            }
1152            catch (SQLException e) {
1153                handleException(e);
1154                throw new AssertionError();
1155            }
1156        }
1157    
1158        public boolean autoCommitFailureClosesAllResultSets() throws SQLException {
1159            { try { return _meta.autoCommitFailureClosesAllResultSets(); }
1160            catch (SQLException e) { handleException(e); return false; } }
1161        }
1162    
1163        public boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException {
1164            { try { return _meta.supportsStoredFunctionsUsingCallSyntax(); }
1165            catch (SQLException e) { handleException(e); return false; } }
1166        }
1167    
1168        public ResultSet getClientInfoProperties() throws SQLException {
1169            _conn.checkOpen();
1170            try {
1171                return DelegatingResultSet.wrapResultSet(_conn,
1172                        _meta.getClientInfoProperties());
1173            }
1174            catch (SQLException e) {
1175                handleException(e);
1176                throw new AssertionError();
1177            }
1178        }
1179    
1180        public ResultSet getFunctions(String catalog, String schemaPattern,
1181                String functionNamePattern) throws SQLException {
1182            _conn.checkOpen();
1183            try {
1184                return DelegatingResultSet.wrapResultSet(_conn,
1185                        _meta.getFunctions(catalog, schemaPattern,
1186                                functionNamePattern));
1187            }
1188            catch (SQLException e) {
1189                handleException(e);
1190                throw new AssertionError();
1191            }
1192        }
1193    
1194        public ResultSet getFunctionColumns(String catalog, String schemaPattern,
1195                String functionNamePattern, String columnNamePattern)
1196                throws SQLException {
1197            _conn.checkOpen();
1198            try {
1199                return DelegatingResultSet.wrapResultSet(_conn,
1200                        _meta.getFunctionColumns(catalog, schemaPattern,
1201                                functionNamePattern, columnNamePattern));
1202            }
1203            catch (SQLException e) {
1204                handleException(e);
1205                throw new AssertionError();
1206            }
1207        }
1208    
1209        /* JDBC_4_ANT_KEY_END */
1210    
1211    }