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