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 */
017package org.apache.commons.dbcp2;
018
019import java.sql.Connection;
020import java.sql.DatabaseMetaData;
021import java.sql.ResultSet;
022import java.sql.RowIdLifetime;
023import java.sql.SQLException;
024
025/**
026 * <p>
027 * A base delegating implementation of {@link DatabaseMetaData}.
028 * </p>
029 * <p>
030 * Methods that create {@link ResultSet} objects are wrapped to create {@link DelegatingResultSet} objects and the
031 * remaining methods simply call the corresponding method on the "delegate" provided in the constructor.
032 * </p>
033 *
034 * @since 2.0
035 */
036public class DelegatingDatabaseMetaData implements DatabaseMetaData {
037
038    /** My delegate {@link DatabaseMetaData} */
039    private final DatabaseMetaData databaseMetaData;
040
041    /** The connection that created me. **/
042    private final DelegatingConnection<?> connection;
043
044    /**
045     * Constructs a new instance for the given delegating connection and database meta data.
046     *
047     * @param connection
048     *            the delegating connection
049     * @param databaseMetaData
050     *            the database meta data
051     */
052    public DelegatingDatabaseMetaData(final DelegatingConnection<?> connection,
053            final DatabaseMetaData databaseMetaData) {
054        this.connection = connection;
055        this.databaseMetaData = databaseMetaData;
056    }
057
058    @Override
059    public boolean allProceduresAreCallable() throws SQLException {
060        try {
061            return databaseMetaData.allProceduresAreCallable();
062        } catch (final SQLException e) {
063            handleException(e);
064            return false;
065        }
066    }
067
068    @Override
069    public boolean allTablesAreSelectable() throws SQLException {
070        try {
071            return databaseMetaData.allTablesAreSelectable();
072        } catch (final SQLException e) {
073            handleException(e);
074            return false;
075        }
076    }
077
078    @Override
079    public boolean autoCommitFailureClosesAllResultSets() throws SQLException {
080        try {
081            return databaseMetaData.autoCommitFailureClosesAllResultSets();
082        } catch (final SQLException e) {
083            handleException(e);
084            return false;
085        }
086    }
087
088    @Override
089    public boolean dataDefinitionCausesTransactionCommit() throws SQLException {
090        try {
091            return databaseMetaData.dataDefinitionCausesTransactionCommit();
092        } catch (final SQLException e) {
093            handleException(e);
094            return false;
095        }
096    }
097
098    @Override
099    public boolean dataDefinitionIgnoredInTransactions() throws SQLException {
100        try {
101            return databaseMetaData.dataDefinitionIgnoredInTransactions();
102        } catch (final SQLException e) {
103            handleException(e);
104            return false;
105        }
106    }
107
108    @Override
109    public boolean deletesAreDetected(final int type) throws SQLException {
110        try {
111            return databaseMetaData.deletesAreDetected(type);
112        } catch (final SQLException e) {
113            handleException(e);
114            return false;
115        }
116    }
117
118    @Override
119    public boolean doesMaxRowSizeIncludeBlobs() throws SQLException {
120        try {
121            return databaseMetaData.doesMaxRowSizeIncludeBlobs();
122        } catch (final SQLException e) {
123            handleException(e);
124            return false;
125        }
126    }
127
128    @Override
129    public boolean generatedKeyAlwaysReturned() throws SQLException {
130        connection.checkOpen();
131        try {
132            return Jdbc41Bridge.generatedKeyAlwaysReturned(databaseMetaData);
133        } catch (final SQLException e) {
134            handleException(e);
135            return false;
136        }
137    }
138
139    @Override
140    public ResultSet getAttributes(final String catalog, final String schemaPattern, final String typeNamePattern,
141            final String attributeNamePattern) throws SQLException {
142        connection.checkOpen();
143        try {
144            return DelegatingResultSet.wrapResultSet(connection,
145                    databaseMetaData.getAttributes(catalog, schemaPattern, typeNamePattern, attributeNamePattern));
146        } catch (final SQLException e) {
147            handleException(e);
148            throw new AssertionError();
149        }
150    }
151
152    @Override
153    public ResultSet getBestRowIdentifier(final String catalog, final String schema, final String table,
154            final int scope, final boolean nullable) throws SQLException {
155        connection.checkOpen();
156        try {
157            return DelegatingResultSet.wrapResultSet(connection,
158                    databaseMetaData.getBestRowIdentifier(catalog, schema, table, scope, nullable));
159        } catch (final SQLException e) {
160            handleException(e);
161            throw new AssertionError();
162        }
163    }
164
165    @Override
166    public ResultSet getCatalogs() throws SQLException {
167        connection.checkOpen();
168        try {
169            return DelegatingResultSet.wrapResultSet(connection, databaseMetaData.getCatalogs());
170        } catch (final SQLException e) {
171            handleException(e);
172            throw new AssertionError();
173        }
174    }
175
176    @Override
177    public String getCatalogSeparator() throws SQLException {
178        try {
179            return databaseMetaData.getCatalogSeparator();
180        } catch (final SQLException e) {
181            handleException(e);
182            throw new AssertionError();
183        }
184    }
185
186    @Override
187    public String getCatalogTerm() throws SQLException {
188        try {
189            return databaseMetaData.getCatalogTerm();
190        } catch (final SQLException e) {
191            handleException(e);
192            throw new AssertionError();
193        }
194    }
195
196    @Override
197    public ResultSet getClientInfoProperties() throws SQLException {
198        connection.checkOpen();
199        try {
200            return DelegatingResultSet.wrapResultSet(connection, databaseMetaData.getClientInfoProperties());
201        } catch (final SQLException e) {
202            handleException(e);
203            throw new AssertionError();
204        }
205    }
206
207    @Override
208    public ResultSet getColumnPrivileges(final String catalog, final String schema, final String table,
209            final String columnNamePattern) throws SQLException {
210        connection.checkOpen();
211        try {
212            return DelegatingResultSet.wrapResultSet(connection,
213                    databaseMetaData.getColumnPrivileges(catalog, schema, table, columnNamePattern));
214        } catch (final SQLException e) {
215            handleException(e);
216            throw new AssertionError();
217        }
218    }
219
220    @Override
221    public ResultSet getColumns(final String catalog, final String schemaPattern, final String tableNamePattern,
222            final String columnNamePattern) throws SQLException {
223        connection.checkOpen();
224        try {
225            return DelegatingResultSet.wrapResultSet(connection,
226                    databaseMetaData.getColumns(catalog, schemaPattern, tableNamePattern, columnNamePattern));
227        } catch (final SQLException e) {
228            handleException(e);
229            throw new AssertionError();
230        }
231    }
232
233    @Override
234    public Connection getConnection() throws SQLException {
235        return connection;
236    }
237
238    @Override
239    public ResultSet getCrossReference(final String parentCatalog, final String parentSchema, final String parentTable,
240            final String foreignCatalog, final String foreignSchema, final String foreignTable) throws SQLException {
241        connection.checkOpen();
242        try {
243            return DelegatingResultSet.wrapResultSet(connection, databaseMetaData.getCrossReference(parentCatalog,
244                    parentSchema, parentTable, foreignCatalog, foreignSchema, foreignTable));
245        } catch (final SQLException e) {
246            handleException(e);
247            throw new AssertionError();
248        }
249    }
250
251    @Override
252    public int getDatabaseMajorVersion() throws SQLException {
253        try {
254            return databaseMetaData.getDatabaseMajorVersion();
255        } catch (final SQLException e) {
256            handleException(e);
257            return 0;
258        }
259    }
260
261    @Override
262    public int getDatabaseMinorVersion() throws SQLException {
263        try {
264            return databaseMetaData.getDatabaseMinorVersion();
265        } catch (final SQLException e) {
266            handleException(e);
267            return 0;
268        }
269    }
270
271    @Override
272    public String getDatabaseProductName() throws SQLException {
273        try {
274            return databaseMetaData.getDatabaseProductName();
275        } catch (final SQLException e) {
276            handleException(e);
277            throw new AssertionError();
278        }
279    }
280
281    @Override
282    public String getDatabaseProductVersion() throws SQLException {
283        try {
284            return databaseMetaData.getDatabaseProductVersion();
285        } catch (final SQLException e) {
286            handleException(e);
287            throw new AssertionError();
288        }
289    }
290
291    @Override
292    public int getDefaultTransactionIsolation() throws SQLException {
293        try {
294            return databaseMetaData.getDefaultTransactionIsolation();
295        } catch (final SQLException e) {
296            handleException(e);
297            return 0;
298        }
299    }
300
301    /**
302     * Gets the underlying database meta data.
303     *
304     * @return The underlying database meta data.
305     */
306    public DatabaseMetaData getDelegate() {
307        return databaseMetaData;
308    }
309
310    @Override
311    public int getDriverMajorVersion() {
312        return databaseMetaData.getDriverMajorVersion();
313    }
314
315    @Override
316    public int getDriverMinorVersion() {
317        return databaseMetaData.getDriverMinorVersion();
318    }
319
320    @Override
321    public String getDriverName() throws SQLException {
322        try {
323            return databaseMetaData.getDriverName();
324        } catch (final SQLException e) {
325            handleException(e);
326            throw new AssertionError();
327        }
328    }
329
330    @Override
331    public String getDriverVersion() throws SQLException {
332        try {
333            return databaseMetaData.getDriverVersion();
334        } catch (final SQLException e) {
335            handleException(e);
336            throw new AssertionError();
337        }
338    }
339
340    @Override
341    public ResultSet getExportedKeys(final String catalog, final String schema, final String table)
342            throws SQLException {
343        connection.checkOpen();
344        try {
345            return DelegatingResultSet.wrapResultSet(connection,
346                    databaseMetaData.getExportedKeys(catalog, schema, table));
347        } catch (final SQLException e) {
348            handleException(e);
349            throw new AssertionError();
350        }
351    }
352
353    @Override
354    public String getExtraNameCharacters() throws SQLException {
355        try {
356            return databaseMetaData.getExtraNameCharacters();
357        } catch (final SQLException e) {
358            handleException(e);
359            throw new AssertionError();
360        }
361    }
362
363    @Override
364    public ResultSet getFunctionColumns(final String catalog, final String schemaPattern,
365            final String functionNamePattern, final String columnNamePattern) throws SQLException {
366        connection.checkOpen();
367        try {
368            return DelegatingResultSet.wrapResultSet(connection, databaseMetaData.getFunctionColumns(catalog,
369                    schemaPattern, functionNamePattern, columnNamePattern));
370        } catch (final SQLException e) {
371            handleException(e);
372            throw new AssertionError();
373        }
374    }
375
376    @Override
377    public ResultSet getFunctions(final String catalog, final String schemaPattern, final String functionNamePattern)
378            throws SQLException {
379        connection.checkOpen();
380        try {
381            return DelegatingResultSet.wrapResultSet(connection,
382                    databaseMetaData.getFunctions(catalog, schemaPattern, functionNamePattern));
383        } catch (final SQLException e) {
384            handleException(e);
385            throw new AssertionError();
386        }
387    }
388
389    @Override
390    public String getIdentifierQuoteString() throws SQLException {
391        try {
392            return databaseMetaData.getIdentifierQuoteString();
393        } catch (final SQLException e) {
394            handleException(e);
395            throw new AssertionError();
396        }
397    }
398
399    @Override
400    public ResultSet getImportedKeys(final String catalog, final String schema, final String table)
401            throws SQLException {
402        connection.checkOpen();
403        try {
404            return DelegatingResultSet.wrapResultSet(connection,
405                    databaseMetaData.getImportedKeys(catalog, schema, table));
406        } catch (final SQLException e) {
407            handleException(e);
408            throw new AssertionError();
409        }
410    }
411
412    @Override
413    public ResultSet getIndexInfo(final String catalog, final String schema, final String table, final boolean unique,
414            final boolean approximate) throws SQLException {
415        connection.checkOpen();
416        try {
417            return DelegatingResultSet.wrapResultSet(connection,
418                    databaseMetaData.getIndexInfo(catalog, schema, table, unique, approximate));
419        } catch (final SQLException e) {
420            handleException(e);
421            throw new AssertionError();
422        }
423    }
424
425    /**
426     * If my underlying {@link ResultSet} is not a {@code DelegatingResultSet}, returns it, otherwise recursively
427     * invokes this method on my delegate.
428     * <p>
429     * Hence this method will return the first delegate that is not a {@code DelegatingResultSet}, or {@code null} when
430     * no non-{@code DelegatingResultSet} delegate can be found by traversing this chain.
431     * </p>
432     * <p>
433     * This method is useful when you may have nested {@code DelegatingResultSet}s, and you want to make sure to obtain
434     * a "genuine" {@link ResultSet}.
435     * </p>
436     *
437     * @return the innermost database meta data.
438     */
439    public DatabaseMetaData getInnermostDelegate() {
440        DatabaseMetaData m = databaseMetaData;
441        while (m instanceof DelegatingDatabaseMetaData) {
442            m = ((DelegatingDatabaseMetaData) m).getDelegate();
443            if (this == m) {
444                return null;
445            }
446        }
447        return m;
448    }
449
450    @Override
451    public int getJDBCMajorVersion() throws SQLException {
452        try {
453            return databaseMetaData.getJDBCMajorVersion();
454        } catch (final SQLException e) {
455            handleException(e);
456            return 0;
457        }
458    }
459
460    @Override
461    public int getJDBCMinorVersion() throws SQLException {
462        try {
463            return databaseMetaData.getJDBCMinorVersion();
464        } catch (final SQLException e) {
465            handleException(e);
466            return 0;
467        }
468    }
469
470    @Override
471    public int getMaxBinaryLiteralLength() throws SQLException {
472        try {
473            return databaseMetaData.getMaxBinaryLiteralLength();
474        } catch (final SQLException e) {
475            handleException(e);
476            return 0;
477        }
478    }
479
480    @Override
481    public int getMaxCatalogNameLength() throws SQLException {
482        try {
483            return databaseMetaData.getMaxCatalogNameLength();
484        } catch (final SQLException e) {
485            handleException(e);
486            return 0;
487        }
488    }
489
490    @Override
491    public int getMaxCharLiteralLength() throws SQLException {
492        try {
493            return databaseMetaData.getMaxCharLiteralLength();
494        } catch (final SQLException e) {
495            handleException(e);
496            return 0;
497        }
498    }
499
500    @Override
501    public int getMaxColumnNameLength() throws SQLException {
502        try {
503            return databaseMetaData.getMaxColumnNameLength();
504        } catch (final SQLException e) {
505            handleException(e);
506            return 0;
507        }
508    }
509
510    @Override
511    public int getMaxColumnsInGroupBy() throws SQLException {
512        try {
513            return databaseMetaData.getMaxColumnsInGroupBy();
514        } catch (final SQLException e) {
515            handleException(e);
516            return 0;
517        }
518    }
519
520    @Override
521    public int getMaxColumnsInIndex() throws SQLException {
522        try {
523            return databaseMetaData.getMaxColumnsInIndex();
524        } catch (final SQLException e) {
525            handleException(e);
526            return 0;
527        }
528    }
529
530    @Override
531    public int getMaxColumnsInOrderBy() throws SQLException {
532        try {
533            return databaseMetaData.getMaxColumnsInOrderBy();
534        } catch (final SQLException e) {
535            handleException(e);
536            return 0;
537        }
538    }
539
540    @Override
541    public int getMaxColumnsInSelect() throws SQLException {
542        try {
543            return databaseMetaData.getMaxColumnsInSelect();
544        } catch (final SQLException e) {
545            handleException(e);
546            return 0;
547        }
548    }
549
550    @Override
551    public int getMaxColumnsInTable() throws SQLException {
552        try {
553            return databaseMetaData.getMaxColumnsInTable();
554        } catch (final SQLException e) {
555            handleException(e);
556            return 0;
557        }
558    }
559
560    @Override
561    public int getMaxConnections() throws SQLException {
562        try {
563            return databaseMetaData.getMaxConnections();
564        } catch (final SQLException e) {
565            handleException(e);
566            return 0;
567        }
568    }
569
570    @Override
571    public int getMaxCursorNameLength() throws SQLException {
572        try {
573            return databaseMetaData.getMaxCursorNameLength();
574        } catch (final SQLException e) {
575            handleException(e);
576            return 0;
577        }
578    }
579
580    @Override
581    public int getMaxIndexLength() throws SQLException {
582        try {
583            return databaseMetaData.getMaxIndexLength();
584        } catch (final SQLException e) {
585            handleException(e);
586            return 0;
587        }
588    }
589
590    /**
591     * @since 2.5.0
592     */
593    @Override
594    public long getMaxLogicalLobSize() throws SQLException {
595        try {
596            return databaseMetaData.getMaxLogicalLobSize();
597        } catch (final SQLException e) {
598            handleException(e);
599            return 0;
600        }
601    }
602
603    @Override
604    public int getMaxProcedureNameLength() throws SQLException {
605        try {
606            return databaseMetaData.getMaxProcedureNameLength();
607        } catch (final SQLException e) {
608            handleException(e);
609            return 0;
610        }
611    }
612
613    @Override
614    public int getMaxRowSize() throws SQLException {
615        try {
616            return databaseMetaData.getMaxRowSize();
617        } catch (final SQLException e) {
618            handleException(e);
619            return 0;
620        }
621    }
622
623    @Override
624    public int getMaxSchemaNameLength() throws SQLException {
625        try {
626            return databaseMetaData.getMaxSchemaNameLength();
627        } catch (final SQLException e) {
628            handleException(e);
629            return 0;
630        }
631    }
632
633    @Override
634    public int getMaxStatementLength() throws SQLException {
635        try {
636            return databaseMetaData.getMaxStatementLength();
637        } catch (final SQLException e) {
638            handleException(e);
639            return 0;
640        }
641    }
642
643    @Override
644    public int getMaxStatements() throws SQLException {
645        try {
646            return databaseMetaData.getMaxStatements();
647        } catch (final SQLException e) {
648            handleException(e);
649            return 0;
650        }
651    }
652
653    @Override
654    public int getMaxTableNameLength() throws SQLException {
655        try {
656            return databaseMetaData.getMaxTableNameLength();
657        } catch (final SQLException e) {
658            handleException(e);
659            return 0;
660        }
661    }
662
663    @Override
664    public int getMaxTablesInSelect() throws SQLException {
665        try {
666            return databaseMetaData.getMaxTablesInSelect();
667        } catch (final SQLException e) {
668            handleException(e);
669            return 0;
670        }
671    }
672
673    @Override
674    public int getMaxUserNameLength() throws SQLException {
675        try {
676            return databaseMetaData.getMaxUserNameLength();
677        } catch (final SQLException e) {
678            handleException(e);
679            return 0;
680        }
681    }
682
683    @Override
684    public String getNumericFunctions() throws SQLException {
685        try {
686            return databaseMetaData.getNumericFunctions();
687        } catch (final SQLException e) {
688            handleException(e);
689            throw new AssertionError();
690        }
691    }
692
693    @Override
694    public ResultSet getPrimaryKeys(final String catalog, final String schema, final String table) throws SQLException {
695        connection.checkOpen();
696        try {
697            return DelegatingResultSet.wrapResultSet(connection,
698                    databaseMetaData.getPrimaryKeys(catalog, schema, table));
699        } catch (final SQLException e) {
700            handleException(e);
701            throw new AssertionError();
702        }
703    }
704
705    @Override
706    public ResultSet getProcedureColumns(final String catalog, final String schemaPattern,
707            final String procedureNamePattern, final String columnNamePattern) throws SQLException {
708        connection.checkOpen();
709        try {
710            return DelegatingResultSet.wrapResultSet(connection, databaseMetaData.getProcedureColumns(catalog,
711                    schemaPattern, procedureNamePattern, columnNamePattern));
712        } catch (final SQLException e) {
713            handleException(e);
714            throw new AssertionError();
715        }
716    }
717
718    @Override
719    public ResultSet getProcedures(final String catalog, final String schemaPattern, final String procedureNamePattern)
720            throws SQLException {
721        connection.checkOpen();
722        try {
723            return DelegatingResultSet.wrapResultSet(connection,
724                    databaseMetaData.getProcedures(catalog, schemaPattern, procedureNamePattern));
725        } catch (final SQLException e) {
726            handleException(e);
727            throw new AssertionError();
728        }
729    }
730
731    @Override
732    public String getProcedureTerm() throws SQLException {
733        try {
734            return databaseMetaData.getProcedureTerm();
735        } catch (final SQLException e) {
736            handleException(e);
737            throw new AssertionError();
738        }
739    }
740
741    @Override
742    public ResultSet getPseudoColumns(final String catalog, final String schemaPattern, final String tableNamePattern,
743            final String columnNamePattern) throws SQLException {
744        connection.checkOpen();
745        try {
746            return DelegatingResultSet.wrapResultSet(connection, Jdbc41Bridge.getPseudoColumns(databaseMetaData,
747                    catalog, schemaPattern, tableNamePattern, columnNamePattern));
748        } catch (final SQLException e) {
749            handleException(e);
750            throw new AssertionError();
751        }
752    }
753
754    @Override
755    public int getResultSetHoldability() throws SQLException {
756        try {
757            return databaseMetaData.getResultSetHoldability();
758        } catch (final SQLException e) {
759            handleException(e);
760            return 0;
761        }
762    }
763
764    @Override
765    public RowIdLifetime getRowIdLifetime() throws SQLException {
766        try {
767            return databaseMetaData.getRowIdLifetime();
768        } catch (final SQLException e) {
769            handleException(e);
770            throw new AssertionError();
771        }
772    }
773
774    @Override
775    public ResultSet getSchemas() throws SQLException {
776        connection.checkOpen();
777        try {
778            return DelegatingResultSet.wrapResultSet(connection, databaseMetaData.getSchemas());
779        } catch (final SQLException e) {
780            handleException(e);
781            throw new AssertionError();
782        }
783    }
784
785    @Override
786    public ResultSet getSchemas(final String catalog, final String schemaPattern) throws SQLException {
787        connection.checkOpen();
788        try {
789            return DelegatingResultSet.wrapResultSet(connection, databaseMetaData.getSchemas(catalog, schemaPattern));
790        } catch (final SQLException e) {
791            handleException(e);
792            throw new AssertionError();
793        }
794    }
795
796    @Override
797    public String getSchemaTerm() throws SQLException {
798        try {
799            return databaseMetaData.getSchemaTerm();
800        } catch (final SQLException e) {
801            handleException(e);
802            throw new AssertionError();
803        }
804    }
805
806    @Override
807    public String getSearchStringEscape() throws SQLException {
808        try {
809            return databaseMetaData.getSearchStringEscape();
810        } catch (final SQLException e) {
811            handleException(e);
812            throw new AssertionError();
813        }
814    }
815
816    @Override
817    public String getSQLKeywords() throws SQLException {
818        try {
819            return databaseMetaData.getSQLKeywords();
820        } catch (final SQLException e) {
821            handleException(e);
822            throw new AssertionError();
823        }
824    }
825
826    @Override
827    public int getSQLStateType() throws SQLException {
828        try {
829            return databaseMetaData.getSQLStateType();
830        } catch (final SQLException e) {
831            handleException(e);
832            return 0;
833        }
834    }
835
836    @Override
837    public String getStringFunctions() throws SQLException {
838        try {
839            return databaseMetaData.getStringFunctions();
840        } catch (final SQLException e) {
841            handleException(e);
842            throw new AssertionError();
843        }
844    }
845
846    @Override
847    public ResultSet getSuperTables(final String catalog, final String schemaPattern, final String tableNamePattern)
848            throws SQLException {
849        connection.checkOpen();
850        try {
851            return DelegatingResultSet.wrapResultSet(connection,
852                    databaseMetaData.getSuperTables(catalog, schemaPattern, tableNamePattern));
853        } catch (final SQLException e) {
854            handleException(e);
855            throw new AssertionError();
856        }
857    }
858
859    @Override
860    public ResultSet getSuperTypes(final String catalog, final String schemaPattern, final String typeNamePattern)
861            throws SQLException {
862        connection.checkOpen();
863        try {
864            return DelegatingResultSet.wrapResultSet(connection,
865                    databaseMetaData.getSuperTypes(catalog, schemaPattern, typeNamePattern));
866        } catch (final SQLException e) {
867            handleException(e);
868            throw new AssertionError();
869        }
870    }
871
872    @Override
873    public String getSystemFunctions() throws SQLException {
874        try {
875            return databaseMetaData.getSystemFunctions();
876        } catch (final SQLException e) {
877            handleException(e);
878            throw new AssertionError();
879        }
880    }
881
882    @Override
883    public ResultSet getTablePrivileges(final String catalog, final String schemaPattern, final String tableNamePattern)
884            throws SQLException {
885        connection.checkOpen();
886        try {
887            return DelegatingResultSet.wrapResultSet(connection,
888                    databaseMetaData.getTablePrivileges(catalog, schemaPattern, tableNamePattern));
889        } catch (final SQLException e) {
890            handleException(e);
891            throw new AssertionError();
892        }
893    }
894
895    @Override
896    public ResultSet getTables(final String catalog, final String schemaPattern, final String tableNamePattern,
897            final String[] types) throws SQLException {
898        connection.checkOpen();
899        try {
900            return DelegatingResultSet.wrapResultSet(connection,
901                    databaseMetaData.getTables(catalog, schemaPattern, tableNamePattern, types));
902        } catch (final SQLException e) {
903            handleException(e);
904            throw new AssertionError();
905        }
906    }
907
908    @Override
909    public ResultSet getTableTypes() throws SQLException {
910        connection.checkOpen();
911        try {
912            return DelegatingResultSet.wrapResultSet(connection, databaseMetaData.getTableTypes());
913        } catch (final SQLException e) {
914            handleException(e);
915            throw new AssertionError();
916        }
917    }
918
919    @Override
920    public String getTimeDateFunctions() throws SQLException {
921        try {
922            return databaseMetaData.getTimeDateFunctions();
923        } catch (final SQLException e) {
924            handleException(e);
925            throw new AssertionError();
926        }
927    }
928
929    @Override
930    public ResultSet getTypeInfo() throws SQLException {
931        connection.checkOpen();
932        try {
933            return DelegatingResultSet.wrapResultSet(connection, databaseMetaData.getTypeInfo());
934        } catch (final SQLException e) {
935            handleException(e);
936            throw new AssertionError();
937        }
938    }
939
940    @Override
941    public ResultSet getUDTs(final String catalog, final String schemaPattern, final String typeNamePattern,
942            final int[] types) throws SQLException {
943        connection.checkOpen();
944        try {
945            return DelegatingResultSet.wrapResultSet(connection,
946                    databaseMetaData.getUDTs(catalog, schemaPattern, typeNamePattern, types));
947        } catch (final SQLException e) {
948            handleException(e);
949            throw new AssertionError();
950        }
951    }
952
953    @Override
954    public String getURL() throws SQLException {
955        try {
956            return databaseMetaData.getURL();
957        } catch (final SQLException e) {
958            handleException(e);
959            throw new AssertionError();
960        }
961    }
962
963    @Override
964    public String getUserName() throws SQLException {
965        try {
966            return databaseMetaData.getUserName();
967        } catch (final SQLException e) {
968            handleException(e);
969            throw new AssertionError();
970        }
971    }
972
973    @Override
974    public ResultSet getVersionColumns(final String catalog, final String schema, final String table)
975            throws SQLException {
976        connection.checkOpen();
977        try {
978            return DelegatingResultSet.wrapResultSet(connection,
979                    databaseMetaData.getVersionColumns(catalog, schema, table));
980        } catch (final SQLException e) {
981            handleException(e);
982            throw new AssertionError();
983        }
984    }
985
986    protected void handleException(final SQLException e) throws SQLException {
987        if (connection == null) {
988            throw e;
989        }
990        connection.handleException(e);
991    }
992
993    @Override
994    public boolean insertsAreDetected(final int type) throws SQLException {
995        try {
996            return databaseMetaData.insertsAreDetected(type);
997        } catch (final SQLException e) {
998            handleException(e);
999            return false;
1000        }
1001    }
1002
1003    @Override
1004    public boolean isCatalogAtStart() throws SQLException {
1005        try {
1006            return databaseMetaData.isCatalogAtStart();
1007        } catch (final SQLException e) {
1008            handleException(e);
1009            return false;
1010        }
1011    }
1012
1013    @Override
1014    public boolean isReadOnly() throws SQLException {
1015        try {
1016            return databaseMetaData.isReadOnly();
1017        } catch (final SQLException e) {
1018            handleException(e);
1019            return false;
1020        }
1021    }
1022
1023    @Override
1024    public boolean isWrapperFor(final Class<?> iface) throws SQLException {
1025        if (iface.isAssignableFrom(getClass())) {
1026            return true;
1027        }
1028        if (iface.isAssignableFrom(databaseMetaData.getClass())) {
1029            return true;
1030        }
1031        return databaseMetaData.isWrapperFor(iface);
1032    }
1033
1034    @Override
1035    public boolean locatorsUpdateCopy() throws SQLException {
1036        try {
1037            return databaseMetaData.locatorsUpdateCopy();
1038        } catch (final SQLException e) {
1039            handleException(e);
1040            return false;
1041        }
1042    }
1043
1044    @Override
1045    public boolean nullPlusNonNullIsNull() throws SQLException {
1046        try {
1047            return databaseMetaData.nullPlusNonNullIsNull();
1048        } catch (final SQLException e) {
1049            handleException(e);
1050            return false;
1051        }
1052    }
1053
1054    @Override
1055    public boolean nullsAreSortedAtEnd() throws SQLException {
1056        try {
1057            return databaseMetaData.nullsAreSortedAtEnd();
1058        } catch (final SQLException e) {
1059            handleException(e);
1060            return false;
1061        }
1062    }
1063
1064    @Override
1065    public boolean nullsAreSortedAtStart() throws SQLException {
1066        try {
1067            return databaseMetaData.nullsAreSortedAtStart();
1068        } catch (final SQLException e) {
1069            handleException(e);
1070            return false;
1071        }
1072    }
1073
1074    @Override
1075    public boolean nullsAreSortedHigh() throws SQLException {
1076        try {
1077            return databaseMetaData.nullsAreSortedHigh();
1078        } catch (final SQLException e) {
1079            handleException(e);
1080            return false;
1081        }
1082    }
1083
1084    @Override
1085    public boolean nullsAreSortedLow() throws SQLException {
1086        try {
1087            return databaseMetaData.nullsAreSortedLow();
1088        } catch (final SQLException e) {
1089            handleException(e);
1090            return false;
1091        }
1092    }
1093
1094    @Override
1095    public boolean othersDeletesAreVisible(final int type) throws SQLException {
1096        try {
1097            return databaseMetaData.othersDeletesAreVisible(type);
1098        } catch (final SQLException e) {
1099            handleException(e);
1100            return false;
1101        }
1102    }
1103
1104    @Override
1105    public boolean othersInsertsAreVisible(final int type) throws SQLException {
1106        try {
1107            return databaseMetaData.othersInsertsAreVisible(type);
1108        } catch (final SQLException e) {
1109            handleException(e);
1110            return false;
1111        }
1112    }
1113
1114    @Override
1115    public boolean othersUpdatesAreVisible(final int type) throws SQLException {
1116        try {
1117            return databaseMetaData.othersUpdatesAreVisible(type);
1118        } catch (final SQLException e) {
1119            handleException(e);
1120            return false;
1121        }
1122    }
1123
1124    @Override
1125    public boolean ownDeletesAreVisible(final int type) throws SQLException {
1126        try {
1127            return databaseMetaData.ownDeletesAreVisible(type);
1128        } catch (final SQLException e) {
1129            handleException(e);
1130            return false;
1131        }
1132    }
1133
1134    @Override
1135    public boolean ownInsertsAreVisible(final int type) throws SQLException {
1136        try {
1137            return databaseMetaData.ownInsertsAreVisible(type);
1138        } catch (final SQLException e) {
1139            handleException(e);
1140            return false;
1141        }
1142    }
1143
1144    @Override
1145    public boolean ownUpdatesAreVisible(final int type) throws SQLException {
1146        try {
1147            return databaseMetaData.ownUpdatesAreVisible(type);
1148        } catch (final SQLException e) {
1149            handleException(e);
1150            return false;
1151        }
1152    }
1153
1154    @Override
1155    public boolean storesLowerCaseIdentifiers() throws SQLException {
1156        try {
1157            return databaseMetaData.storesLowerCaseIdentifiers();
1158        } catch (final SQLException e) {
1159            handleException(e);
1160            return false;
1161        }
1162    }
1163
1164    @Override
1165    public boolean storesLowerCaseQuotedIdentifiers() throws SQLException {
1166        try {
1167            return databaseMetaData.storesLowerCaseQuotedIdentifiers();
1168        } catch (final SQLException e) {
1169            handleException(e);
1170            return false;
1171        }
1172    }
1173
1174    @Override
1175    public boolean storesMixedCaseIdentifiers() throws SQLException {
1176        try {
1177            return databaseMetaData.storesMixedCaseIdentifiers();
1178        } catch (final SQLException e) {
1179            handleException(e);
1180            return false;
1181        }
1182    }
1183
1184    @Override
1185    public boolean storesMixedCaseQuotedIdentifiers() throws SQLException {
1186        try {
1187            return databaseMetaData.storesMixedCaseQuotedIdentifiers();
1188        } catch (final SQLException e) {
1189            handleException(e);
1190            return false;
1191        }
1192    }
1193
1194    @Override
1195    public boolean storesUpperCaseIdentifiers() throws SQLException {
1196        try {
1197            return databaseMetaData.storesUpperCaseIdentifiers();
1198        } catch (final SQLException e) {
1199            handleException(e);
1200            return false;
1201        }
1202    }
1203
1204    @Override
1205    public boolean storesUpperCaseQuotedIdentifiers() throws SQLException {
1206        try {
1207            return databaseMetaData.storesUpperCaseQuotedIdentifiers();
1208        } catch (final SQLException e) {
1209            handleException(e);
1210            return false;
1211        }
1212    }
1213
1214    @Override
1215    public boolean supportsAlterTableWithAddColumn() throws SQLException {
1216        try {
1217            return databaseMetaData.supportsAlterTableWithAddColumn();
1218        } catch (final SQLException e) {
1219            handleException(e);
1220            return false;
1221        }
1222    }
1223
1224    @Override
1225    public boolean supportsAlterTableWithDropColumn() throws SQLException {
1226        try {
1227            return databaseMetaData.supportsAlterTableWithDropColumn();
1228        } catch (final SQLException e) {
1229            handleException(e);
1230            return false;
1231        }
1232    }
1233
1234    @Override
1235    public boolean supportsANSI92EntryLevelSQL() throws SQLException {
1236        try {
1237            return databaseMetaData.supportsANSI92EntryLevelSQL();
1238        } catch (final SQLException e) {
1239            handleException(e);
1240            return false;
1241        }
1242    }
1243
1244    @Override
1245    public boolean supportsANSI92FullSQL() throws SQLException {
1246        try {
1247            return databaseMetaData.supportsANSI92FullSQL();
1248        } catch (final SQLException e) {
1249            handleException(e);
1250            return false;
1251        }
1252    }
1253
1254    @Override
1255    public boolean supportsANSI92IntermediateSQL() throws SQLException {
1256        try {
1257            return databaseMetaData.supportsANSI92IntermediateSQL();
1258        } catch (final SQLException e) {
1259            handleException(e);
1260            return false;
1261        }
1262    }
1263
1264    @Override
1265    public boolean supportsBatchUpdates() throws SQLException {
1266        try {
1267            return databaseMetaData.supportsBatchUpdates();
1268        } catch (final SQLException e) {
1269            handleException(e);
1270            return false;
1271        }
1272    }
1273
1274    @Override
1275    public boolean supportsCatalogsInDataManipulation() throws SQLException {
1276        try {
1277            return databaseMetaData.supportsCatalogsInDataManipulation();
1278        } catch (final SQLException e) {
1279            handleException(e);
1280            return false;
1281        }
1282    }
1283
1284    @Override
1285    public boolean supportsCatalogsInIndexDefinitions() throws SQLException {
1286        try {
1287            return databaseMetaData.supportsCatalogsInIndexDefinitions();
1288        } catch (final SQLException e) {
1289            handleException(e);
1290            return false;
1291        }
1292    }
1293
1294    @Override
1295    public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException {
1296        try {
1297            return databaseMetaData.supportsCatalogsInPrivilegeDefinitions();
1298        } catch (final SQLException e) {
1299            handleException(e);
1300            return false;
1301        }
1302    }
1303
1304    @Override
1305    public boolean supportsCatalogsInProcedureCalls() throws SQLException {
1306        try {
1307            return databaseMetaData.supportsCatalogsInProcedureCalls();
1308        } catch (final SQLException e) {
1309            handleException(e);
1310            return false;
1311        }
1312    }
1313
1314    @Override
1315    public boolean supportsCatalogsInTableDefinitions() throws SQLException {
1316        try {
1317            return databaseMetaData.supportsCatalogsInTableDefinitions();
1318        } catch (final SQLException e) {
1319            handleException(e);
1320            return false;
1321        }
1322    }
1323
1324    @Override
1325    public boolean supportsColumnAliasing() throws SQLException {
1326        try {
1327            return databaseMetaData.supportsColumnAliasing();
1328        } catch (final SQLException e) {
1329            handleException(e);
1330            return false;
1331        }
1332    }
1333
1334    @Override
1335    public boolean supportsConvert() throws SQLException {
1336        try {
1337            return databaseMetaData.supportsConvert();
1338        } catch (final SQLException e) {
1339            handleException(e);
1340            return false;
1341        }
1342    }
1343
1344    @Override
1345    public boolean supportsConvert(final int fromType, final int toType) throws SQLException {
1346        try {
1347            return databaseMetaData.supportsConvert(fromType, toType);
1348        } catch (final SQLException e) {
1349            handleException(e);
1350            return false;
1351        }
1352    }
1353
1354    @Override
1355    public boolean supportsCoreSQLGrammar() throws SQLException {
1356        try {
1357            return databaseMetaData.supportsCoreSQLGrammar();
1358        } catch (final SQLException e) {
1359            handleException(e);
1360            return false;
1361        }
1362    }
1363
1364    @Override
1365    public boolean supportsCorrelatedSubqueries() throws SQLException {
1366        try {
1367            return databaseMetaData.supportsCorrelatedSubqueries();
1368        } catch (final SQLException e) {
1369            handleException(e);
1370            return false;
1371        }
1372    }
1373
1374    @Override
1375    public boolean supportsDataDefinitionAndDataManipulationTransactions() throws SQLException {
1376        try {
1377            return databaseMetaData.supportsDataDefinitionAndDataManipulationTransactions();
1378        } catch (final SQLException e) {
1379            handleException(e);
1380            return false;
1381        }
1382    }
1383
1384    @Override
1385    public boolean supportsDataManipulationTransactionsOnly() throws SQLException {
1386        try {
1387            return databaseMetaData.supportsDataManipulationTransactionsOnly();
1388        } catch (final SQLException e) {
1389            handleException(e);
1390            return false;
1391        }
1392    }
1393
1394    @Override
1395    public boolean supportsDifferentTableCorrelationNames() throws SQLException {
1396        try {
1397            return databaseMetaData.supportsDifferentTableCorrelationNames();
1398        } catch (final SQLException e) {
1399            handleException(e);
1400            return false;
1401        }
1402    }
1403
1404    @Override
1405    public boolean supportsExpressionsInOrderBy() throws SQLException {
1406        try {
1407            return databaseMetaData.supportsExpressionsInOrderBy();
1408        } catch (final SQLException e) {
1409            handleException(e);
1410            return false;
1411        }
1412    }
1413
1414    @Override
1415    public boolean supportsExtendedSQLGrammar() throws SQLException {
1416        try {
1417            return databaseMetaData.supportsExtendedSQLGrammar();
1418        } catch (final SQLException e) {
1419            handleException(e);
1420            return false;
1421        }
1422    }
1423
1424    @Override
1425    public boolean supportsFullOuterJoins() throws SQLException {
1426        try {
1427            return databaseMetaData.supportsFullOuterJoins();
1428        } catch (final SQLException e) {
1429            handleException(e);
1430            return false;
1431        }
1432    }
1433
1434    @Override
1435    public boolean supportsGetGeneratedKeys() throws SQLException {
1436        try {
1437            return databaseMetaData.supportsGetGeneratedKeys();
1438        } catch (final SQLException e) {
1439            handleException(e);
1440            return false;
1441        }
1442    }
1443
1444    @Override
1445    public boolean supportsGroupBy() throws SQLException {
1446        try {
1447            return databaseMetaData.supportsGroupBy();
1448        } catch (final SQLException e) {
1449            handleException(e);
1450            return false;
1451        }
1452    }
1453
1454    @Override
1455    public boolean supportsGroupByBeyondSelect() throws SQLException {
1456        try {
1457            return databaseMetaData.supportsGroupByBeyondSelect();
1458        } catch (final SQLException e) {
1459            handleException(e);
1460            return false;
1461        }
1462    }
1463
1464    @Override
1465    public boolean supportsGroupByUnrelated() throws SQLException {
1466        try {
1467            return databaseMetaData.supportsGroupByUnrelated();
1468        } catch (final SQLException e) {
1469            handleException(e);
1470            return false;
1471        }
1472    }
1473
1474    @Override
1475    public boolean supportsIntegrityEnhancementFacility() throws SQLException {
1476        try {
1477            return databaseMetaData.supportsIntegrityEnhancementFacility();
1478        } catch (final SQLException e) {
1479            handleException(e);
1480            return false;
1481        }
1482    }
1483
1484    @Override
1485    public boolean supportsLikeEscapeClause() throws SQLException {
1486        try {
1487            return databaseMetaData.supportsLikeEscapeClause();
1488        } catch (final SQLException e) {
1489            handleException(e);
1490            return false;
1491        }
1492    }
1493
1494    @Override
1495    public boolean supportsLimitedOuterJoins() throws SQLException {
1496        try {
1497            return databaseMetaData.supportsLimitedOuterJoins();
1498        } catch (final SQLException e) {
1499            handleException(e);
1500            return false;
1501        }
1502    }
1503
1504    @Override
1505    public boolean supportsMinimumSQLGrammar() throws SQLException {
1506        try {
1507            return databaseMetaData.supportsMinimumSQLGrammar();
1508        } catch (final SQLException e) {
1509            handleException(e);
1510            return false;
1511        }
1512    }
1513
1514    @Override
1515    public boolean supportsMixedCaseIdentifiers() throws SQLException {
1516        try {
1517            return databaseMetaData.supportsMixedCaseIdentifiers();
1518        } catch (final SQLException e) {
1519            handleException(e);
1520            return false;
1521        }
1522    }
1523
1524    @Override
1525    public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException {
1526        try {
1527            return databaseMetaData.supportsMixedCaseQuotedIdentifiers();
1528        } catch (final SQLException e) {
1529            handleException(e);
1530            return false;
1531        }
1532    }
1533
1534    @Override
1535    public boolean supportsMultipleOpenResults() throws SQLException {
1536        try {
1537            return databaseMetaData.supportsMultipleOpenResults();
1538        } catch (final SQLException e) {
1539            handleException(e);
1540            return false;
1541        }
1542    }
1543
1544    @Override
1545    public boolean supportsMultipleResultSets() throws SQLException {
1546        try {
1547            return databaseMetaData.supportsMultipleResultSets();
1548        } catch (final SQLException e) {
1549            handleException(e);
1550            return false;
1551        }
1552    }
1553
1554    @Override
1555    public boolean supportsMultipleTransactions() throws SQLException {
1556        try {
1557            return databaseMetaData.supportsMultipleTransactions();
1558        } catch (final SQLException e) {
1559            handleException(e);
1560            return false;
1561        }
1562    }
1563
1564    @Override
1565    public boolean supportsNamedParameters() throws SQLException {
1566        try {
1567            return databaseMetaData.supportsNamedParameters();
1568        } catch (final SQLException e) {
1569            handleException(e);
1570            return false;
1571        }
1572    }
1573
1574    @Override
1575    public boolean supportsNonNullableColumns() throws SQLException {
1576        try {
1577            return databaseMetaData.supportsNonNullableColumns();
1578        } catch (final SQLException e) {
1579            handleException(e);
1580            return false;
1581        }
1582    }
1583
1584    @Override
1585    public boolean supportsOpenCursorsAcrossCommit() throws SQLException {
1586        try {
1587            return databaseMetaData.supportsOpenCursorsAcrossCommit();
1588        } catch (final SQLException e) {
1589            handleException(e);
1590            return false;
1591        }
1592    }
1593
1594    @Override
1595    public boolean supportsOpenCursorsAcrossRollback() throws SQLException {
1596        try {
1597            return databaseMetaData.supportsOpenCursorsAcrossRollback();
1598        } catch (final SQLException e) {
1599            handleException(e);
1600            return false;
1601        }
1602    }
1603
1604    @Override
1605    public boolean supportsOpenStatementsAcrossCommit() throws SQLException {
1606        try {
1607            return databaseMetaData.supportsOpenStatementsAcrossCommit();
1608        } catch (final SQLException e) {
1609            handleException(e);
1610            return false;
1611        }
1612    }
1613
1614    @Override
1615    public boolean supportsOpenStatementsAcrossRollback() throws SQLException {
1616        try {
1617            return databaseMetaData.supportsOpenStatementsAcrossRollback();
1618        } catch (final SQLException e) {
1619            handleException(e);
1620            return false;
1621        }
1622    }
1623
1624    @Override
1625    public boolean supportsOrderByUnrelated() throws SQLException {
1626        try {
1627            return databaseMetaData.supportsOrderByUnrelated();
1628        } catch (final SQLException e) {
1629            handleException(e);
1630            return false;
1631        }
1632    }
1633
1634    @Override
1635    public boolean supportsOuterJoins() throws SQLException {
1636        try {
1637            return databaseMetaData.supportsOuterJoins();
1638        } catch (final SQLException e) {
1639            handleException(e);
1640            return false;
1641        }
1642    }
1643
1644    @Override
1645    public boolean supportsPositionedDelete() throws SQLException {
1646        try {
1647            return databaseMetaData.supportsPositionedDelete();
1648        } catch (final SQLException e) {
1649            handleException(e);
1650            return false;
1651        }
1652    }
1653
1654    @Override
1655    public boolean supportsPositionedUpdate() throws SQLException {
1656        try {
1657            return databaseMetaData.supportsPositionedUpdate();
1658        } catch (final SQLException e) {
1659            handleException(e);
1660            return false;
1661        }
1662    }
1663
1664    /**
1665     * @since 2.5.0
1666     */
1667    @Override
1668    public boolean supportsRefCursors() throws SQLException {
1669        try {
1670            return databaseMetaData.supportsRefCursors();
1671        } catch (final SQLException e) {
1672            handleException(e);
1673            return false;
1674        }
1675    }
1676
1677    @Override
1678    public boolean supportsResultSetConcurrency(final int type, final int concurrency) throws SQLException {
1679        try {
1680            return databaseMetaData.supportsResultSetConcurrency(type, concurrency);
1681        } catch (final SQLException e) {
1682            handleException(e);
1683            return false;
1684        }
1685    }
1686
1687    @Override
1688    public boolean supportsResultSetHoldability(final int holdability) throws SQLException {
1689        try {
1690            return databaseMetaData.supportsResultSetHoldability(holdability);
1691        } catch (final SQLException e) {
1692            handleException(e);
1693            return false;
1694        }
1695    }
1696
1697    @Override
1698    public boolean supportsResultSetType(final int type) throws SQLException {
1699        try {
1700            return databaseMetaData.supportsResultSetType(type);
1701        } catch (final SQLException e) {
1702            handleException(e);
1703            return false;
1704        }
1705    }
1706
1707    @Override
1708    public boolean supportsSavepoints() throws SQLException {
1709        try {
1710            return databaseMetaData.supportsSavepoints();
1711        } catch (final SQLException e) {
1712            handleException(e);
1713            return false;
1714        }
1715    }
1716
1717    @Override
1718    public boolean supportsSchemasInDataManipulation() throws SQLException {
1719        try {
1720            return databaseMetaData.supportsSchemasInDataManipulation();
1721        } catch (final SQLException e) {
1722            handleException(e);
1723            return false;
1724        }
1725    }
1726
1727    @Override
1728    public boolean supportsSchemasInIndexDefinitions() throws SQLException {
1729        try {
1730            return databaseMetaData.supportsSchemasInIndexDefinitions();
1731        } catch (final SQLException e) {
1732            handleException(e);
1733            return false;
1734        }
1735    }
1736
1737    @Override
1738    public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException {
1739        try {
1740            return databaseMetaData.supportsSchemasInPrivilegeDefinitions();
1741        } catch (final SQLException e) {
1742            handleException(e);
1743            return false;
1744        }
1745    }
1746
1747    @Override
1748    public boolean supportsSchemasInProcedureCalls() throws SQLException {
1749        try {
1750            return databaseMetaData.supportsSchemasInProcedureCalls();
1751        } catch (final SQLException e) {
1752            handleException(e);
1753            return false;
1754        }
1755    }
1756
1757    @Override
1758    public boolean supportsSchemasInTableDefinitions() throws SQLException {
1759        try {
1760            return databaseMetaData.supportsSchemasInTableDefinitions();
1761        } catch (final SQLException e) {
1762            handleException(e);
1763            return false;
1764        }
1765    }
1766
1767    @Override
1768    public boolean supportsSelectForUpdate() throws SQLException {
1769        try {
1770            return databaseMetaData.supportsSelectForUpdate();
1771        } catch (final SQLException e) {
1772            handleException(e);
1773            return false;
1774        }
1775    }
1776
1777    @Override
1778    public boolean supportsStatementPooling() throws SQLException {
1779        try {
1780            return databaseMetaData.supportsStatementPooling();
1781        } catch (final SQLException e) {
1782            handleException(e);
1783            return false;
1784        }
1785    }
1786
1787    @Override
1788    public boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException {
1789        try {
1790            return databaseMetaData.supportsStoredFunctionsUsingCallSyntax();
1791        } catch (final SQLException e) {
1792            handleException(e);
1793            return false;
1794        }
1795    }
1796
1797    @Override
1798    public boolean supportsStoredProcedures() throws SQLException {
1799        try {
1800            return databaseMetaData.supportsStoredProcedures();
1801        } catch (final SQLException e) {
1802            handleException(e);
1803            return false;
1804        }
1805    }
1806
1807    @Override
1808    public boolean supportsSubqueriesInComparisons() throws SQLException {
1809        try {
1810            return databaseMetaData.supportsSubqueriesInComparisons();
1811        } catch (final SQLException e) {
1812            handleException(e);
1813            return false;
1814        }
1815    }
1816
1817    @Override
1818    public boolean supportsSubqueriesInExists() throws SQLException {
1819        try {
1820            return databaseMetaData.supportsSubqueriesInExists();
1821        } catch (final SQLException e) {
1822            handleException(e);
1823            return false;
1824        }
1825    }
1826
1827    @Override
1828    public boolean supportsSubqueriesInIns() throws SQLException {
1829        try {
1830            return databaseMetaData.supportsSubqueriesInIns();
1831        } catch (final SQLException e) {
1832            handleException(e);
1833            return false;
1834        }
1835    }
1836
1837    @Override
1838    public boolean supportsSubqueriesInQuantifieds() throws SQLException {
1839        try {
1840            return databaseMetaData.supportsSubqueriesInQuantifieds();
1841        } catch (final SQLException e) {
1842            handleException(e);
1843            return false;
1844        }
1845    }
1846
1847    @Override
1848    public boolean supportsTableCorrelationNames() throws SQLException {
1849        try {
1850            return databaseMetaData.supportsTableCorrelationNames();
1851        } catch (final SQLException e) {
1852            handleException(e);
1853            return false;
1854        }
1855    }
1856
1857    @Override
1858    public boolean supportsTransactionIsolationLevel(final int level) throws SQLException {
1859        try {
1860            return databaseMetaData.supportsTransactionIsolationLevel(level);
1861        } catch (final SQLException e) {
1862            handleException(e);
1863            return false;
1864        }
1865    }
1866
1867    @Override
1868    public boolean supportsTransactions() throws SQLException {
1869        try {
1870            return databaseMetaData.supportsTransactions();
1871        } catch (final SQLException e) {
1872            handleException(e);
1873            return false;
1874        }
1875    }
1876
1877    @Override
1878    public boolean supportsUnion() throws SQLException {
1879        try {
1880            return databaseMetaData.supportsUnion();
1881        } catch (final SQLException e) {
1882            handleException(e);
1883            return false;
1884        }
1885    }
1886
1887    @Override
1888    public boolean supportsUnionAll() throws SQLException {
1889        try {
1890            return databaseMetaData.supportsUnionAll();
1891        } catch (final SQLException e) {
1892            handleException(e);
1893            return false;
1894        }
1895    }
1896
1897    /* JDBC_4_ANT_KEY_END */
1898
1899    @Override
1900    public <T> T unwrap(final Class<T> iface) throws SQLException {
1901        if (iface.isAssignableFrom(getClass())) {
1902            return iface.cast(this);
1903        }
1904        if (iface.isAssignableFrom(databaseMetaData.getClass())) {
1905            return iface.cast(databaseMetaData);
1906        }
1907        return databaseMetaData.unwrap(iface);
1908    }
1909
1910    @Override
1911    public boolean updatesAreDetected(final int type) throws SQLException {
1912        try {
1913            return databaseMetaData.updatesAreDetected(type);
1914        } catch (final SQLException e) {
1915            handleException(e);
1916            return false;
1917        }
1918    }
1919
1920    @Override
1921    public boolean usesLocalFilePerTable() throws SQLException {
1922        try {
1923            return databaseMetaData.usesLocalFilePerTable();
1924        } catch (final SQLException e) {
1925            handleException(e);
1926            return false;
1927        }
1928    }
1929
1930    @Override
1931    public boolean usesLocalFiles() throws SQLException {
1932        try {
1933            return databaseMetaData.usesLocalFiles();
1934        } catch (final SQLException e) {
1935            handleException(e);
1936            return false;
1937        }
1938    }
1939}