001    package com.mockrunner.mock.jdbc;
002    
003    import java.sql.Connection;
004    import java.sql.DatabaseMetaData;
005    import java.sql.ResultSet;
006    import java.sql.RowIdLifetime;
007    import java.sql.SQLException;
008    import java.util.ArrayList;
009    import java.util.Arrays;
010    import java.util.HashMap;
011    import java.util.Iterator;
012    import java.util.List;
013    import java.util.Map;
014    
015    import com.mockrunner.util.common.StringUtil;
016    
017    /**
018     * Mock implementation of <code>DatabaseMetaData</code>.
019     */
020    public class MockDatabaseMetaData implements DatabaseMetaData
021    {
022        private boolean caseSensitive = false;
023        private int databaseMajorVersion = 1;
024        private int databaseMinorVersion = 0;
025        private int defaultTransactionLevel = Connection.TRANSACTION_READ_COMMITTED;
026        private int driverMajorVersion = 1;
027        private int driverMinorVersion = 0;
028        private int jdbcMajorVersion = 3;
029        private int jdbcMinorVersion = 0;
030        private int maxBinaryLiteralLength = 0;
031        private int maxCatalogNameLength = 0;
032        private int maxCharLiteralLength = 0;
033        private int maxColumnNameLength = 0;
034        private int maxColumnsInGroupBy = 0;
035        private int maxColumnsInIndex = 0;
036        private int maxColumnsInOrderBy = 0;
037        private int maxColumnsInSelect = 0;
038        private int maxColumnsInTable = 0;
039        private int maxConnections = 0;
040        private int maxCursorNameLength = 0;
041        private int maxIndexLength = 0;
042        private int maxProcedureNameLength = 0;
043        private int maxRowSize = 0;
044        private int maxSchemaNameLength = 0;
045        private int maxStatementLength = 0;
046        private int maxStatements = 0;
047        private int maxTableNameLength = 0;
048        private int maxTablesInSelect = 0;
049        private int maxUserNameLength = 0;
050        private int resultSetHoldability = 1; // 1 == ResultSet.HOLD_CURSORS_OVER_COMMIT
051        private int sqlStateType = sqlStateSQL99;
052        private RowIdLifetime rowIdLifetime = RowIdLifetime.ROWID_VALID_TRANSACTION;
053        private boolean autoCommitFailureClosesAllResultSets = false;
054        private boolean allProceduresAreCallable = true;
055        private boolean allTablesAreSelectable = true;
056        private boolean dataDefinitionCausesTransactionCommit = false;
057        private boolean dataDefinitionIgnoredInTransactions = false;        
058        private boolean doesMaxRowSizeIncludeBlobs = false;
059        private boolean isCatalogAtStart = false;
060        private boolean isReadOnly = false;
061        private boolean locatorsUpdateCopy = false;
062        private boolean nullPlusNonNullIsNull = false;
063        private boolean nullsAreSortedAtEnd = false;
064        private boolean nullsAreSortedAtStart = false;
065        private boolean nullsAreSortedHigh = false;
066        private boolean nullsAreSortedLow = false;
067        private boolean storesLowerCaseIdentifiers = true;
068        private boolean storesLowerCaseQuotedIdentifiers = true;
069        private boolean storesMixedCaseIdentifiers = true;
070        private boolean storesMixedCaseQuotedIdentifiers = true;
071        private boolean storesUpperCaseIdentifiers = true;
072        private boolean storesUpperCaseQuotedIdentifiers = true;
073        private boolean supportsANSI92EntryLevelSQL = true;
074        private boolean supportsANSI92FullSQL = true;    
075        private boolean supportsANSI92IntermediateSQL = true;
076        private boolean supportsAlterTableWithAddColumn = true;
077        private boolean supportsAlterTableWithDropColumn = true;
078        private boolean supportsBatchUpdates = true;
079        private boolean supportsCatalogsInDataManipulation = true;
080        private boolean supportsCatalogsInIndexDefinitions = true;
081        private boolean supportsCatalogsInPrivilegeDefinitions = true;
082        private boolean supportsCatalogsInProcedureCalls = true;
083        private boolean supportsCatalogsInTableDefinitions = true;
084        private boolean supportsColumnAliasing = true;
085        private boolean supportsConvert = true;
086        private boolean supportsCoreSQLGrammar = true;
087        private boolean supportsCorrelatedSubqueries = true;
088        private boolean supportsDataDefinitionAndDataManipulationTransactions = true;
089        private boolean supportsDataManipulationTransactionsOnly = false;
090        private boolean supportsDifferentTableCorrelationNames;
091        private boolean supportsExpressionsInOrderBy = true;
092        private boolean supportsExtendedSQLGrammar = true;
093        private boolean supportsFullOuterJoins = true;
094        private boolean supportsGetGeneratedKeys = true;
095        private boolean supportsGroupBy = true;
096        private boolean supportsGroupByBeyondSelect = true;
097        private boolean supportsGroupByUnrelated = true;  
098        private boolean supportsIntegrityEnhancementFacility = true;
099        private boolean supportsLikeEscapeClause = true;
100        private boolean supportsLimitedOuterJoins = true;   
101        private boolean supportsMinimumSQLGrammar = true;;
102        private boolean supportsMixedCaseIdentifiers = true;
103        private boolean supportsMixedCaseQuotedIdentifiers = true;
104        private boolean supportsMultipleOpenResults = true;
105        private boolean supportsMultipleResultSets = true;
106        private boolean supportsMultipleTransactions = true;
107        private boolean supportsNamedParameters = true;
108        private boolean supportsNonNullableColumns = true;
109        private boolean supportsOpenCursorsAcrossCommit = true;
110        private boolean supportsOpenCursorsAcrossRollback = true;
111        private boolean supportsOpenStatementsAcrossCommit = true;
112        private boolean supportsOpenStatementsAcrossRollback = true;
113        private boolean supportsOrderByUnrelated = true;
114        private boolean supportsOuterJoins = true;
115        private boolean supportsPositionedDelete = true;
116        private boolean supportsPositionedUpdate = true;
117        private boolean supportsSavepoints = true;
118        private boolean supportsSchemasInDataManipulation = true;
119        private boolean supportsSchemasInIndexDefinitions = true;
120        private boolean supportsSchemasInPrivilegeDefinitions = true;
121        private boolean supportsSchemasInProcedureCalls = true;
122        private boolean supportsSchemasInTableDefinitions = true;
123        private boolean supportsSelectForUpdate = true;
124        private boolean supportsStatementPooling = true;
125        private boolean supportsStoredProcedures = true;
126        private boolean supportsSubqueriesInComparisons = true;
127        private boolean supportsSubqueriesInExists = true;
128        private boolean supportsSubqueriesInIns = true;
129        private boolean supportsSubqueriesInQuantifieds = true;
130        private boolean supportsTableCorrelationNames = true;
131        private boolean supportsTransactions = true;;
132        private boolean supportsUnion = true;
133        private boolean supportsUnionAll = true;
134        private boolean usesLocalFilePerTable = false;
135        private boolean usesLocalFiles = true;
136        private boolean deletesAreDetected = true;
137        private boolean insertsAreDetected = true;
138        private boolean othersDeletesAreVisible = true;
139        private boolean othersInsertsAreVisible = true;
140        private boolean othersUpdatesAreVisible = true;
141        private boolean ownDeletesAreVisible = true;
142        private boolean ownInsertsAreVisible = true;
143        private boolean ownUpdatesAreVisible = true;
144        private boolean supportsResultSetHoldability = true;
145        private boolean supportsResultSetType = true;
146        private boolean supportsTransactionIsolationLevel = true;
147        private boolean updatesAreDetected = true;
148        private boolean supportsResultSetConcurrency = true;
149        private boolean supportsStoredFunctionsUsingCallSyntax = true;
150        private String catalogSeparator = ".";
151        private String catalogTerm = "database";
152        private String databaseProductName = "MockDatabase";
153        private String databaseProductVersion = "1.0";
154        private String driverName = MockDriver.class.getName();
155        private String driverVersion = "1.0";
156        private String extraNameCharacters = "";
157        private String identifierQuoteString = " ";
158        private String numericFunctions = "";
159        private String procedureTerm = "";
160        private String sqlKeywords = "";
161        private String schemaTerm = "";
162        private String searchStringEscape = "\\";
163        private String stringFunctions = "";
164        private String systemFunctions = "";
165        private String timeDateFunctions = "";
166        private String url;
167        private String userName;
168        private Connection connection;
169        private ResultSet catalogs;
170        private ResultSet tableTypes;
171        private ResultSet typeInfo;
172        private ResultSet clientInfoProperties;
173        private Map schemasMap = new HashMap();
174        private Map exportedKeysMap = new HashMap();
175        private Map importedKeysMap = new HashMap();
176        private Map primaryKeysMap = new HashMap();
177        private Map proceduresMap = new HashMap();
178        private Map functionsMap = new HashMap();
179        private Map superTablesMap = new HashMap();
180        private Map superTypesMap = new HashMap();
181        private Map tablePrivilegesMap = new HashMap();
182        private Map versionColumnsMap = new HashMap();
183        private Map bestRowIdentifierMap = new HashMap();
184        private Map indexInfoMap = new HashMap();
185        private Map udtsMap = new HashMap();
186        private Map attributesMap = new HashMap();
187        private Map columnPrivilegesMap = new HashMap();
188        private Map columnsMap = new HashMap();
189        private Map procedureColumnsMap = new HashMap();
190        private Map functionColumnsMap = new HashMap();
191        private Map tablesMap = new HashMap();
192        private Map crossReferenceMap = new HashMap();
193        
194        /**
195         * Set if matching of catalogs, schemas, tables and columns
196         * is case sensitive. Defaults to <code>false</code>.
197         * @param caseSensitive is matching case sensitive
198         */
199        public void setCaseSensitive(boolean caseSensitive)
200        {
201            this.caseSensitive = caseSensitive;
202        }
203    
204        public int getDatabaseMajorVersion() throws SQLException
205        {
206            return databaseMajorVersion;
207        }
208        
209        public void setDatabaseMajorVersion(int version)
210        {
211            databaseMajorVersion = version;
212        }
213        
214        public int getDatabaseMinorVersion() throws SQLException
215        {
216            return databaseMinorVersion;
217        }
218        
219        public void setDatabaseMinorVersion(int version)
220        {
221            databaseMinorVersion = version;
222        }
223        
224        public int getDefaultTransactionIsolation() throws SQLException
225        {
226            return defaultTransactionLevel;
227        }
228        
229        public void setDefaultTransactionIsolation(int defaultTransactionLevel)
230        {
231            this.defaultTransactionLevel = defaultTransactionLevel;
232        }
233        
234        public int getDriverMajorVersion()
235        {
236            return driverMajorVersion;
237        }
238        
239        public void setDriverMajorVersion(int driverMajorVersion)
240        {
241            this.driverMajorVersion = driverMajorVersion;
242        }
243        
244        public int getDriverMinorVersion()
245        {
246            return driverMinorVersion;
247        }
248        
249        public void setDriverMinorVersion(int driverMinorVersion)
250        {
251            this.driverMinorVersion = driverMinorVersion;
252        }
253        
254        public int getJDBCMajorVersion() throws SQLException
255        {
256            return jdbcMajorVersion;
257        }
258        
259        public void setJDBCMajorVersion(int jdbcMajorVersion)
260        {
261            this.jdbcMajorVersion = jdbcMajorVersion;
262        }
263        
264        public int getJDBCMinorVersion() throws SQLException
265        {
266            return jdbcMinorVersion;
267        }
268        
269        public void setJDBCMinorVersion(int jdbcMinorVersion)
270        {
271            this.jdbcMinorVersion = jdbcMinorVersion;
272        }
273        
274        public int getMaxBinaryLiteralLength() throws SQLException
275        {
276            return maxBinaryLiteralLength;
277        }
278        
279        public void setMaxBinaryLiteralLength(int maxBinaryLiteralLength)
280        {
281            this.maxBinaryLiteralLength = maxBinaryLiteralLength;
282        }
283        
284        public int getMaxCatalogNameLength() throws SQLException
285        {
286            return maxCatalogNameLength;
287        }
288        
289        public void setetMaxCatalogNameLength(int maxCatalogNameLength)
290        {
291            this.maxCatalogNameLength = maxCatalogNameLength;
292        }
293        
294        public int getMaxCharLiteralLength() throws SQLException
295        {
296            return maxCharLiteralLength;
297        }
298        
299        public void setMaxCharLiteralLength(int maxCharLiteralLength)
300        {
301            this.maxCharLiteralLength = maxCharLiteralLength;
302        }
303        
304        public int getMaxColumnNameLength() throws SQLException
305        {
306            return maxColumnNameLength;
307        }
308        
309        public void setMaxColumnNameLength(int maxColumnNameLength)
310        {
311            this.maxColumnNameLength = maxColumnNameLength;
312        }
313        
314        public int getMaxColumnsInGroupBy() throws SQLException
315        {
316            return maxColumnsInGroupBy;
317        }
318        
319        public void setMaxColumnsInGroupBy(int maxColumnsInGroupBy)
320        {
321            this.maxColumnsInGroupBy = maxColumnsInGroupBy;
322        }
323        
324        public int getMaxColumnsInIndex() throws SQLException
325        {
326            return maxColumnsInIndex;
327        }
328        
329        public void setMaxColumnsInIndex(int maxColumnsInIndex)
330        {
331            this.maxColumnsInIndex = maxColumnsInIndex;
332        }
333        
334        public int getMaxColumnsInOrderBy() throws SQLException
335        {
336            return maxColumnsInOrderBy;
337        }
338        
339        public void setMaxColumnsInOrderBy(int maxColumnsInOrderBy)
340        {
341            this.maxColumnsInOrderBy = maxColumnsInOrderBy;
342        }
343        
344        public int getMaxColumnsInSelect() throws SQLException
345        {
346            return maxColumnsInSelect;
347        }
348        
349        public void setMaxColumnsInSelect(int maxColumnsInSelect)
350        {
351            this.maxColumnsInSelect = maxColumnsInSelect;
352        }
353        
354        public int getMaxColumnsInTable() throws SQLException
355        {
356            return maxColumnsInTable;
357        }
358        
359        public void setMaxColumnsInTable(int maxColumnsInTable)
360        {
361            this.maxColumnsInTable = maxColumnsInTable;
362        }
363        
364        public int getMaxConnections() throws SQLException
365        {
366            return maxConnections;
367        }
368        
369        public void setMaxConnections(int maxConnections)
370        {
371            this.maxConnections = maxConnections;
372        }
373        
374        public int getMaxCursorNameLength() throws SQLException
375        {
376            return maxCursorNameLength;
377        }
378        
379        public void setMaxCursorNameLength(int maxCursorNameLength)
380        {
381            this.maxCursorNameLength = maxCursorNameLength;
382        }
383        
384        public int getMaxIndexLength() throws SQLException
385        {
386            return maxIndexLength;
387        }
388        
389        public void setMaxIndexLength(int maxIndexLength)
390        {
391            this.maxIndexLength = maxIndexLength;
392        }
393        
394        public int getMaxProcedureNameLength() throws SQLException
395        {
396            return maxProcedureNameLength;
397        }
398        
399        public void setMaxProcedureNameLength(int maxProcedureNameLength)
400        {
401            this.maxProcedureNameLength = maxProcedureNameLength;
402        }
403        
404        public int getMaxRowSize() throws SQLException
405        {
406            return maxRowSize;
407        }
408        
409        public void setMaxRowSize(int maxRowSize)
410        {
411            this.maxRowSize = maxRowSize;
412        }
413        
414        public int getMaxSchemaNameLength() throws SQLException
415        {
416            return maxSchemaNameLength;
417        }
418        
419        public void setMaxSchemaNameLength(int maxSchemaNameLength)
420        {
421            this.maxSchemaNameLength = maxSchemaNameLength;
422        }
423        
424        public int getMaxStatementLength() throws SQLException
425        {
426            return maxStatementLength;
427        }
428        
429        public void setMaxStatementLength(int maxStatementLength)
430        {
431            this.maxStatementLength = maxStatementLength;
432        }
433        
434        public int getMaxStatements() throws SQLException
435        {
436            return maxStatements;
437        }
438        
439        public void setMaxStatements(int maxStatements)
440        {
441            this.maxStatements = maxStatements;
442        }
443        
444        public int getMaxTableNameLength() throws SQLException
445        {
446            return maxTableNameLength;
447        }
448        
449        public void setMaxTableNameLength(int maxTableNameLength)
450        {
451            this.maxTableNameLength = maxTableNameLength;
452        }
453        
454        public int getMaxTablesInSelect() throws SQLException
455        {
456            return maxTablesInSelect;
457        }
458        
459        public void setMaxTablesInSelect(int maxTablesInSelect)
460        {
461            this.maxTablesInSelect = maxTablesInSelect;
462        }
463        
464        public int getMaxUserNameLength() throws SQLException
465        {
466            return maxUserNameLength;
467        }
468        
469        public void setMaxUserNameLength(int maxUserNameLength)
470        {
471            this.maxUserNameLength = maxUserNameLength;
472        }
473        
474        public int getResultSetHoldability() throws SQLException
475        {
476            return resultSetHoldability;
477        }
478        
479        public void setResultSetHoldability(int resultSetHoldability)
480        {
481            this.resultSetHoldability = resultSetHoldability;
482        }
483        
484        public int getSQLStateType() throws SQLException
485        {
486            return sqlStateType;
487        }
488        
489        public void setSQLStateType(int sqlStateType)
490        {
491            this.sqlStateType = sqlStateType;
492        }
493        
494        public RowIdLifetime getRowIdLifetime() throws SQLException
495        {
496            return rowIdLifetime;
497        }
498        
499        public void setRowIdLifetime(RowIdLifetime rowIdLifetime)
500        {
501            this.rowIdLifetime = rowIdLifetime;
502        }
503    
504        public boolean autoCommitFailureClosesAllResultSets() throws SQLException
505        {
506            return autoCommitFailureClosesAllResultSets;
507        }
508        
509        public void setAutoCommitFailureClosesAllResultSets(boolean closesAllResultSets)
510        {
511            autoCommitFailureClosesAllResultSets = closesAllResultSets;
512        }
513    
514        public boolean allProceduresAreCallable() throws SQLException
515        {
516            return allProceduresAreCallable;
517        }
518        
519        public void setAllProceduresAreCallable(boolean callable)
520        {
521            allProceduresAreCallable = callable;
522        }
523        
524        public boolean allTablesAreSelectable() throws SQLException
525        {
526            return allTablesAreSelectable;
527        }
528        
529        public void setAllTablesAreSelectable(boolean selectable)
530        {
531            allTablesAreSelectable = selectable;
532        }
533        
534        public boolean dataDefinitionCausesTransactionCommit() throws SQLException
535        {
536            return dataDefinitionCausesTransactionCommit;
537        }
538        
539        public void setDataDefinitionCausesTransactionCommit(boolean causesCommit)
540        {
541            dataDefinitionCausesTransactionCommit = causesCommit;
542        }
543        
544        public boolean dataDefinitionIgnoredInTransactions() throws SQLException
545        {
546            return dataDefinitionIgnoredInTransactions;
547        }
548        
549        public void setDataDefinitionIgnoredInTransactions(boolean ignored)
550        {
551            dataDefinitionIgnoredInTransactions = ignored;
552        }
553        
554        public boolean doesMaxRowSizeIncludeBlobs() throws SQLException
555        {
556            return doesMaxRowSizeIncludeBlobs;
557        }
558        
559        public void setDoesMaxRowSizeIncludeBlobs(boolean includeBlobs)
560        {
561            doesMaxRowSizeIncludeBlobs = includeBlobs;
562        }
563        
564        public boolean isCatalogAtStart() throws SQLException
565        {
566            return isCatalogAtStart;
567        }
568        
569        public void setIsCatalogAtStart(boolean isCatalogAtStart)
570        {
571            this.isCatalogAtStart = isCatalogAtStart;
572        }
573        
574        public boolean isReadOnly() throws SQLException
575        {
576            return isReadOnly;
577        }
578        
579        public void setIsReadOnly(boolean isReadOnly)
580        {
581            this.isReadOnly = isReadOnly;
582        }
583        
584        public boolean locatorsUpdateCopy() throws SQLException
585        {
586            return locatorsUpdateCopy;
587        }
588        
589        public void setLocatorsUpdateCopy(boolean locatorsUpdateCopy)
590        {
591            this.locatorsUpdateCopy = locatorsUpdateCopy;
592        }
593        
594        public boolean nullPlusNonNullIsNull() throws SQLException
595        {
596            return nullPlusNonNullIsNull;
597        }
598        
599        public void setNullPlusNonNullIsNull(boolean nullPlusNonNullIsNull)
600        {
601            this.nullPlusNonNullIsNull = nullPlusNonNullIsNull;
602        }
603        
604        public boolean nullsAreSortedAtEnd() throws SQLException
605        {
606            return nullsAreSortedAtEnd;
607        }
608        
609        public void setNullsAreSortedAtEnd(boolean nullsAreSortedAtEnd)
610        {
611            this.nullsAreSortedAtEnd = nullsAreSortedAtEnd;
612        }
613        
614        public boolean nullsAreSortedAtStart() throws SQLException
615        {
616            return nullsAreSortedAtStart;
617        }
618        
619        public void setNullsAreSortedAtStart(boolean nullsAreSortedAtStart)
620        {
621            this.nullsAreSortedAtStart = nullsAreSortedAtStart;
622        }
623        
624        public boolean nullsAreSortedHigh() throws SQLException
625        {
626            return nullsAreSortedHigh;
627        }
628        
629        public void setNullsAreSortedHigh(boolean nullsAreSortedHigh)
630        {
631            this.nullsAreSortedHigh = nullsAreSortedHigh;
632        }
633        
634        public boolean nullsAreSortedLow() throws SQLException
635        {
636            return nullsAreSortedLow;
637        }
638        
639        public void setNullsAreSortedLow(boolean nullsAreSortedLow)
640        {
641            this.nullsAreSortedLow = nullsAreSortedLow;
642        }
643        
644        public boolean storesLowerCaseIdentifiers() throws SQLException
645        {
646            return storesLowerCaseIdentifiers;
647        }
648        
649        public void setStoresLowerCaseIdentifiers(boolean storesLowerCaseIdentifiers)
650        {
651            this.storesLowerCaseIdentifiers = storesLowerCaseIdentifiers;
652        }
653        
654        public boolean storesLowerCaseQuotedIdentifiers() throws SQLException
655        {
656            return storesLowerCaseQuotedIdentifiers;
657        }
658        
659        public void setStoresLowerCaseQuotedIdentifiers(boolean storesLowerCaseQuotedIdentifiers)
660        {
661            this.storesLowerCaseQuotedIdentifiers = storesLowerCaseQuotedIdentifiers;
662        }
663        
664        public boolean storesMixedCaseIdentifiers() throws SQLException
665        {
666            return storesMixedCaseIdentifiers;
667        }
668        
669        public void setStoresMixedCaseIdentifiers(boolean storesMixedCaseIdentifiers)
670        {
671            this.storesMixedCaseIdentifiers = storesMixedCaseIdentifiers;
672        }
673        
674        public boolean storesMixedCaseQuotedIdentifiers() throws SQLException
675        {
676            return storesMixedCaseQuotedIdentifiers;
677        }
678        
679        public void setStoresMixedCaseQuotedIdentifiers(boolean storesMixedCaseQuotedIdentifiers)
680        {
681            this.storesMixedCaseQuotedIdentifiers = storesMixedCaseQuotedIdentifiers;
682        }
683        
684        public boolean storesUpperCaseIdentifiers() throws SQLException
685        {
686            return storesUpperCaseIdentifiers;
687        }
688        
689        public void setStoresUpperCaseIdentifiers(boolean storesUpperCaseIdentifiers)
690        {
691            this.storesUpperCaseIdentifiers = storesUpperCaseIdentifiers;
692        }
693        
694        public boolean storesUpperCaseQuotedIdentifiers() throws SQLException
695        {
696            return storesUpperCaseQuotedIdentifiers;
697        }
698        
699        public void setStoresUpperCaseQuotedIdentifiers(boolean storesUpperCaseQuotedIdentifiers)
700        {
701            this.storesUpperCaseQuotedIdentifiers = storesUpperCaseQuotedIdentifiers;
702        }
703        
704        public boolean supportsANSI92EntryLevelSQL() throws SQLException
705        {
706            return supportsANSI92EntryLevelSQL;
707        }
708        
709        public void setSupportsANSI92EntryLevelSQL(boolean supportsANSI92EntryLevelSQL)
710        {
711            this.supportsANSI92EntryLevelSQL = supportsANSI92EntryLevelSQL;
712        }
713        
714        public boolean supportsANSI92FullSQL() throws SQLException
715        {
716            return supportsANSI92FullSQL;
717        }
718        
719        public void setSupportsANSI92FullSQL(boolean supportsANSI92FullSQL)
720        {
721            this.supportsANSI92FullSQL = supportsANSI92FullSQL;
722        }
723        
724        public boolean supportsANSI92IntermediateSQL() throws SQLException
725        {
726            return supportsANSI92IntermediateSQL;
727        }
728        
729        public void setSupportsANSI92IntermediateSQL(boolean supportsANSI92IntermediateSQL)
730        {
731            this.supportsANSI92IntermediateSQL = supportsANSI92IntermediateSQL;
732        }
733        
734        public boolean supportsAlterTableWithAddColumn() throws SQLException
735        {
736            return supportsAlterTableWithAddColumn;
737        }
738        
739        public void setSupportsAlterTableWithAddColumn(boolean supportsAlterTableWithAddColumn)
740        {
741            this.supportsAlterTableWithAddColumn = supportsAlterTableWithAddColumn;
742        }
743        
744        public boolean supportsAlterTableWithDropColumn() throws SQLException
745        {
746            return supportsAlterTableWithDropColumn;
747        }
748        
749        public void setSupportsAlterTableWithDropColumn(boolean supportsAlterTableWithDropColumn)
750        {
751            this.supportsAlterTableWithDropColumn = supportsAlterTableWithDropColumn;
752        }
753        
754        public boolean supportsBatchUpdates() throws SQLException
755        {
756            return supportsBatchUpdates;
757        }
758        
759        public void setSupportsBatchUpdates(boolean supportsBatchUpdates)
760        {
761            this.supportsBatchUpdates = supportsBatchUpdates;
762        }
763        
764        public boolean supportsCatalogsInDataManipulation() throws SQLException
765        {
766            return supportsCatalogsInDataManipulation;
767        }
768        
769        public void setSupportsCatalogsInDataManipulation(boolean supportsCatalogsInDataManipulation)
770        {
771            this.supportsCatalogsInDataManipulation = supportsCatalogsInDataManipulation;
772        }
773        
774        public boolean supportsCatalogsInIndexDefinitions() throws SQLException
775        {
776            return supportsCatalogsInIndexDefinitions;
777        }
778        
779        public void setSupportsCatalogsInIndexDefinitions(boolean supportsCatalogsInIndexDefinitions)
780        {
781            this.supportsCatalogsInIndexDefinitions = supportsCatalogsInIndexDefinitions;
782        }
783        
784        public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException
785        {
786            return supportsCatalogsInPrivilegeDefinitions;
787        }
788        
789        public void setSupportsCatalogsInPrivilegeDefinitions(boolean supportsCatalogsInPrivilegeDefinitions)
790        {
791            this.supportsCatalogsInPrivilegeDefinitions = supportsCatalogsInPrivilegeDefinitions;
792        }
793        
794        public boolean supportsCatalogsInProcedureCalls() throws SQLException
795        {
796            return supportsCatalogsInProcedureCalls;
797        }
798        
799        public void setSupportsCatalogsInProcedureCalls(boolean supportsCatalogsInProcedureCalls)
800        {
801            this.supportsCatalogsInProcedureCalls = supportsCatalogsInProcedureCalls;
802        }
803        
804        public boolean supportsCatalogsInTableDefinitions() throws SQLException
805        {
806            return supportsCatalogsInTableDefinitions;
807        }
808        
809        public void setSupportsCatalogsInTableDefinitions(boolean supportsCatalogsInTableDefinitions)
810        {
811            this.supportsCatalogsInTableDefinitions = supportsCatalogsInTableDefinitions;
812        }
813        
814        public boolean supportsColumnAliasing() throws SQLException
815        {
816            return supportsColumnAliasing;
817        }
818        
819        public void setSupportsColumnAliasing(boolean supportsColumnAliasing)
820        {
821            this.supportsColumnAliasing = supportsColumnAliasing;
822        }
823        
824        public boolean supportsConvert() throws SQLException
825        {
826            return supportsConvert;
827        }
828        
829        public void setSupportsConvert(boolean supportsConvert)
830        {
831            this.supportsConvert = supportsConvert;
832        }
833        
834        public boolean supportsCoreSQLGrammar() throws SQLException
835        {
836            return supportsCoreSQLGrammar;
837        }
838        
839        public void setSupportsCoreSQLGrammar(boolean supportsCoreSQLGrammar)
840        {
841            this.supportsCoreSQLGrammar = supportsCoreSQLGrammar;
842        }
843        
844        public boolean supportsCorrelatedSubqueries() throws SQLException
845        {
846            return supportsCorrelatedSubqueries;
847        }
848        
849        public void setSupportsCorrelatedSubqueries(boolean supportsCorrelatedSubqueries)
850        {
851            this.supportsCorrelatedSubqueries = supportsCorrelatedSubqueries;
852        }
853        
854        public boolean supportsDataDefinitionAndDataManipulationTransactions() throws SQLException
855        {
856            return supportsDataDefinitionAndDataManipulationTransactions;
857        }
858        
859        public void setSupportsDataDefinitionAndDataManipulationTransactions(boolean supportsDataDefinitionAndDataManipulationTransactions)
860        {
861            this.supportsDataDefinitionAndDataManipulationTransactions = supportsDataDefinitionAndDataManipulationTransactions;
862        }
863        
864        public boolean supportsDataManipulationTransactionsOnly() throws SQLException
865        {
866            return supportsDataManipulationTransactionsOnly;
867        }
868        
869        public void setSupportsDataManipulationTransactionsOnly(boolean supportsDataManipulationTransactionsOnly)
870        {
871            this.supportsDataManipulationTransactionsOnly = supportsDataManipulationTransactionsOnly;
872        }
873        
874        public boolean supportsDifferentTableCorrelationNames() throws SQLException
875        {
876            return supportsDifferentTableCorrelationNames;
877        }
878        
879        public void setSupportsDifferentTableCorrelationNames(boolean supportsDifferentTableCorrelationNames)
880        {
881            this.supportsDifferentTableCorrelationNames = supportsDifferentTableCorrelationNames;
882        }
883        
884        public boolean supportsExpressionsInOrderBy() throws SQLException
885        {
886            return supportsExpressionsInOrderBy;
887        }
888        
889        public void setSupportsExpressionsInOrderBy(boolean supportsExpressionsInOrderBy)
890        {
891            this.supportsExpressionsInOrderBy = supportsExpressionsInOrderBy;
892        }
893        
894        public boolean supportsExtendedSQLGrammar() throws SQLException
895        {
896            return supportsExtendedSQLGrammar;
897        }
898        
899        public void setSupportsExtendedSQLGrammar(boolean supportsExtendedSQLGrammar)
900        {
901            this.supportsExtendedSQLGrammar = supportsExtendedSQLGrammar;
902        }
903        
904        public boolean supportsFullOuterJoins() throws SQLException
905        {
906            return supportsFullOuterJoins;
907        }
908        
909        public void setSupportsFullOuterJoins(boolean supportsFullOuterJoins)
910        {
911            this.supportsFullOuterJoins = supportsFullOuterJoins;
912        }
913        
914        public boolean supportsGetGeneratedKeys() throws SQLException
915        {
916            return supportsGetGeneratedKeys;
917        }
918        
919        public void setSupportsGetGeneratedKeys(boolean supportsGetGeneratedKeys)
920        {
921            this.supportsGetGeneratedKeys = supportsGetGeneratedKeys;
922        }
923        
924        public boolean supportsGroupBy() throws SQLException
925        {
926            return supportsGroupBy;
927        }
928        
929        public void setSupportsGroupBy(boolean supportsGroupBy)
930        {
931            this.supportsGroupBy = supportsGroupBy;
932        }
933        
934        public boolean supportsGroupByBeyondSelect() throws SQLException
935        {
936            return supportsGroupByBeyondSelect;
937        }
938        
939        public void setSupportsGroupByBeyondSelect(boolean supportsGroupByBeyondSelect)
940        {
941            this.supportsGroupByBeyondSelect = supportsGroupByBeyondSelect;
942        }
943        
944        public boolean supportsGroupByUnrelated() throws SQLException
945        {
946            return supportsGroupByUnrelated;
947        }
948        
949        public void setSupportsGroupByUnrelated(boolean supportsGroupByUnrelated)
950        {
951            this.supportsGroupByUnrelated = supportsGroupByUnrelated;
952        }
953        
954        public boolean supportsIntegrityEnhancementFacility() throws SQLException
955        {
956            return supportsIntegrityEnhancementFacility;
957        }
958        
959        public void setSupportsIntegrityEnhancementFacility(boolean supportsIntegrityEnhancementFacility)
960        {
961            this.supportsIntegrityEnhancementFacility = supportsIntegrityEnhancementFacility;
962        }
963        
964        public boolean supportsLikeEscapeClause() throws SQLException
965        {
966            return supportsLikeEscapeClause;
967        }
968        
969        public void setSupportsLikeEscapeClause(boolean supportsLikeEscapeClause)
970        {
971            this.supportsLikeEscapeClause = supportsLikeEscapeClause;
972        }
973        
974        public boolean supportsLimitedOuterJoins() throws SQLException
975        {
976            return supportsLimitedOuterJoins;
977        }
978        
979        public void setSupportsLimitedOuterJoins(boolean supportsLimitedOuterJoins)
980        {
981            this.supportsLimitedOuterJoins = supportsLimitedOuterJoins;
982        }
983        
984        public boolean supportsMinimumSQLGrammar() throws SQLException
985        {
986            return supportsMinimumSQLGrammar;
987        }
988        
989        public void setSupportsMinimumSQLGrammar(boolean supportsMinimumSQLGrammar)
990        {
991            this.supportsMinimumSQLGrammar = supportsMinimumSQLGrammar;
992        }
993        
994        public boolean supportsMixedCaseIdentifiers() throws SQLException
995        {
996            return supportsMixedCaseIdentifiers;
997        }
998        
999        public void setSupportsMixedCaseIdentifiers(boolean supportsMixedCaseIdentifiers)
1000        {
1001            this.supportsMixedCaseIdentifiers = supportsMixedCaseIdentifiers;
1002        }
1003        
1004        public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException
1005        {
1006            return supportsMixedCaseQuotedIdentifiers;
1007        }
1008        
1009        public void setSupportsMixedCaseQuotedIdentifiers(boolean supportsMixedCaseQuotedIdentifiers)
1010        {
1011            this.supportsMixedCaseQuotedIdentifiers = supportsMixedCaseQuotedIdentifiers;
1012        }
1013        
1014        public boolean supportsMultipleOpenResults() throws SQLException
1015        {
1016            return supportsMultipleOpenResults;
1017        }
1018        
1019        public void setSupportsMultipleOpenResults(boolean supportsMultipleOpenResults)
1020        {
1021            this.supportsMultipleOpenResults = supportsMultipleOpenResults;
1022        }
1023        
1024        public boolean supportsMultipleResultSets() throws SQLException
1025        {
1026            return supportsMultipleResultSets;
1027        }
1028        
1029        public void setSupportsMultipleResultSets(boolean supportsMultipleResultSets)
1030        {
1031            this.supportsMultipleResultSets = supportsMultipleResultSets;
1032        }
1033        
1034        public boolean supportsMultipleTransactions() throws SQLException
1035        {
1036            return supportsMultipleTransactions;
1037        }
1038        
1039        public void setSupportsMultipleTransactions(boolean supportsMultipleTransactions)
1040        {
1041            this.supportsMultipleTransactions = supportsMultipleTransactions;
1042        }
1043        
1044        public boolean supportsNamedParameters() throws SQLException
1045        {
1046            return supportsNamedParameters;
1047        }
1048        
1049        public void setSupportsNamedParameters(boolean supportsNamedParameters)
1050        {
1051            this.supportsNamedParameters = supportsNamedParameters;
1052        }
1053        
1054        public boolean supportsNonNullableColumns() throws SQLException
1055        {
1056            return supportsNonNullableColumns;
1057        }
1058        
1059        public void setSupportsNonNullableColumns(boolean supportsNonNullableColumns)
1060        {
1061            this.supportsNonNullableColumns = supportsNonNullableColumns;
1062        }
1063        
1064        public boolean supportsOpenCursorsAcrossCommit() throws SQLException
1065        {
1066            return supportsOpenCursorsAcrossCommit;
1067        }
1068        
1069        public void setSupportsOpenCursorsAcrossCommit(boolean supportsOpenCursorsAcrossCommit)
1070        {
1071            this.supportsOpenCursorsAcrossCommit = supportsOpenCursorsAcrossCommit;
1072        }
1073        
1074        public boolean supportsOpenCursorsAcrossRollback() throws SQLException
1075        {
1076            return supportsOpenCursorsAcrossRollback;
1077        }
1078        
1079        public void setSupportsOpenCursorsAcrossRollback(boolean supportsOpenCursorsAcrossRollback)
1080        {
1081            this.supportsOpenCursorsAcrossRollback = supportsOpenCursorsAcrossRollback;
1082        }
1083        
1084        public boolean supportsOpenStatementsAcrossCommit() throws SQLException
1085        {
1086            return supportsOpenStatementsAcrossCommit;
1087        }
1088        
1089        public void setSupportsOpenStatementsAcrossCommit(boolean supportsOpenStatementsAcrossCommit)
1090        {
1091            this.supportsOpenStatementsAcrossCommit = supportsOpenStatementsAcrossCommit;
1092        }
1093        
1094        public boolean supportsOpenStatementsAcrossRollback() throws SQLException
1095        {
1096            return supportsOpenStatementsAcrossRollback;
1097        }
1098        
1099        public void setSupportsOpenStatementsAcrossRollback(boolean supportsOpenStatementsAcrossRollback)
1100        {
1101            this.supportsOpenStatementsAcrossRollback = supportsOpenStatementsAcrossRollback;
1102        }
1103        
1104        public boolean supportsOrderByUnrelated() throws SQLException
1105        {
1106            return supportsOrderByUnrelated;
1107        }
1108        
1109        public void setSupportsOrderByUnrelated(boolean supportsOrderByUnrelated)
1110        {
1111            this.supportsOrderByUnrelated = supportsOrderByUnrelated;
1112        }
1113        
1114        public boolean supportsOuterJoins() throws SQLException
1115        {
1116            return supportsOuterJoins;
1117        }
1118        
1119        public void setSupportsOuterJoins(boolean supportsOuterJoins)
1120        {
1121            this.supportsOuterJoins = supportsOuterJoins;
1122        }
1123        
1124        public boolean supportsPositionedDelete() throws SQLException
1125        {
1126            return supportsPositionedDelete;
1127        }
1128        
1129        public void setSupportsPositionedDelete(boolean supportsPositionedDelete)
1130        {
1131            this.supportsPositionedDelete = supportsPositionedDelete;
1132        }
1133        
1134        public boolean supportsPositionedUpdate() throws SQLException
1135        {
1136            return supportsPositionedUpdate;
1137        }
1138        
1139        public void setSupportsPositionedUpdate(boolean supportsPositionedUpdate)
1140        {
1141            this.supportsPositionedUpdate = supportsPositionedUpdate;
1142        }
1143        
1144        public boolean supportsSavepoints() throws SQLException
1145        {
1146            return supportsSavepoints;
1147        }
1148        
1149        public void setSupportsSavepoints(boolean supportsSavepoints)
1150        {
1151            this.supportsSavepoints = supportsSavepoints;
1152        }
1153        
1154        public boolean supportsSchemasInDataManipulation() throws SQLException
1155        {
1156            return supportsSchemasInDataManipulation;
1157        }
1158        
1159        public void setSupportsSchemasInDataManipulation(boolean supportsSchemasInDataManipulation)
1160        {
1161            this.supportsSchemasInDataManipulation = supportsSchemasInDataManipulation;
1162        }
1163        
1164        public boolean supportsSchemasInIndexDefinitions() throws SQLException
1165        {
1166            return supportsSchemasInIndexDefinitions;
1167        }
1168        
1169        public void setSupportsSchemasInIndexDefinitions(boolean supportsSchemasInIndexDefinitions)
1170        {
1171            this.supportsSchemasInIndexDefinitions = supportsSchemasInIndexDefinitions;
1172        }
1173        
1174        public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException
1175        {
1176            return supportsSchemasInPrivilegeDefinitions;
1177        }
1178        
1179        public void setSupportsSchemasInPrivilegeDefinitions(boolean supportsSchemasInPrivilegeDefinitions)
1180        {
1181            this.supportsSchemasInPrivilegeDefinitions = supportsSchemasInPrivilegeDefinitions;
1182        }
1183        
1184        public boolean supportsSchemasInProcedureCalls() throws SQLException
1185        {
1186            return supportsSchemasInProcedureCalls;
1187        }
1188        
1189        public void setSupportsSchemasInProcedureCalls(boolean supportsSchemasInProcedureCalls)
1190        {
1191            this.supportsSchemasInProcedureCalls = supportsSchemasInProcedureCalls;
1192        }
1193        
1194        public boolean supportsSchemasInTableDefinitions() throws SQLException
1195        {
1196            return supportsSchemasInTableDefinitions;
1197        }
1198        
1199        public void setSupportsSchemasInTableDefinitions(boolean supportsSchemasInTableDefinitions)
1200        {
1201            this.supportsSchemasInTableDefinitions = supportsSchemasInTableDefinitions;
1202        }
1203        
1204        public boolean supportsSelectForUpdate() throws SQLException
1205        {
1206            return supportsSelectForUpdate;
1207        }
1208        
1209        public void setSupportsSelectForUpdate(boolean supportsSelectForUpdate)
1210        {
1211            this.supportsSelectForUpdate = supportsSelectForUpdate;
1212        }
1213        
1214        public boolean supportsStatementPooling() throws SQLException
1215        {
1216            return supportsStatementPooling;
1217        }
1218        
1219        public void setSupportsStatementPooling(boolean supportsStatementPooling)
1220        {
1221            this.supportsStatementPooling = supportsStatementPooling;
1222        }
1223        
1224        public boolean supportsStoredProcedures() throws SQLException
1225        {
1226            return supportsStoredProcedures;
1227        }
1228        
1229        public void setSupportsStoredProcedures(boolean supportsStoredProcedures)
1230        {
1231            this.supportsStoredProcedures = supportsStoredProcedures;
1232        }
1233        
1234        public boolean supportsSubqueriesInComparisons() throws SQLException
1235        {
1236            return supportsSubqueriesInComparisons;
1237        }
1238        
1239        public void setSupportsSubqueriesInComparisons(boolean supportsSubqueriesInComparisons)
1240        {
1241            this.supportsSubqueriesInComparisons = supportsSubqueriesInComparisons;
1242        }
1243        
1244        public boolean supportsSubqueriesInExists() throws SQLException
1245        {
1246            return supportsSubqueriesInExists;
1247        }
1248        
1249        public void setSupportsSubqueriesInExists(boolean supportsSubqueriesInExists)
1250        {
1251            this.supportsSubqueriesInExists = supportsSubqueriesInExists;
1252        }
1253        
1254        public boolean supportsSubqueriesInIns() throws SQLException
1255        {
1256            return supportsSubqueriesInIns;
1257        }
1258        
1259        public void setSupportsSubqueriesInIns(boolean supportsSubqueriesInIns)
1260        {
1261            this.supportsSubqueriesInIns = supportsSubqueriesInIns;
1262        }
1263        
1264        public boolean supportsSubqueriesInQuantifieds() throws SQLException
1265        {
1266            return supportsSubqueriesInQuantifieds;
1267        }
1268        
1269        public void setSupportsSubqueriesInQuantifieds(boolean supportsSubqueriesInQuantifieds)
1270        {
1271            this.supportsSubqueriesInQuantifieds = supportsSubqueriesInQuantifieds;
1272        }
1273        
1274        public boolean supportsTableCorrelationNames() throws SQLException
1275        {
1276            return supportsTableCorrelationNames;
1277        }
1278        
1279        public void setSupportsTableCorrelationNames(boolean supportsTableCorrelationNames)
1280        {
1281            this.supportsTableCorrelationNames = supportsTableCorrelationNames;
1282        }
1283        
1284        public boolean supportsTransactions() throws SQLException
1285        {
1286            return supportsTransactions;
1287        }
1288        
1289        public void setSupportsTransactions(boolean supportsTransactions)
1290        {
1291            this.supportsTransactions = supportsTransactions;
1292        }
1293        
1294        public boolean supportsUnion() throws SQLException
1295        {
1296            return supportsUnion;
1297        }
1298        
1299        public void setSupportsUnion(boolean supportsUnion)
1300        {
1301            this.supportsUnion = supportsUnion;
1302        }
1303        
1304        public boolean supportsUnionAll() throws SQLException
1305        {
1306            return supportsUnionAll;
1307        }
1308        
1309        public void setSupportsUnionAll(boolean supportsUnionAll)
1310        {
1311            this.supportsUnionAll = supportsUnionAll;
1312        }
1313        
1314        public boolean usesLocalFilePerTable() throws SQLException
1315        {
1316            return usesLocalFilePerTable;
1317        }
1318        
1319        public void setUsesLocalFilePerTable(boolean usesLocalFilePerTable)
1320        {
1321            this.usesLocalFilePerTable = usesLocalFilePerTable;
1322        }
1323        
1324        public boolean usesLocalFiles() throws SQLException
1325        {
1326            return usesLocalFiles;
1327        }
1328        
1329        public void setUsesLocalFiles(boolean usesLocalFiles)
1330        {
1331            this.usesLocalFiles = usesLocalFiles;
1332        }
1333        
1334        public boolean deletesAreDetected(int type) throws SQLException
1335        {
1336            return deletesAreDetected;
1337        }
1338        
1339        public void setDeletesAreDetected(boolean deletesAreDetected)
1340        {
1341            this.deletesAreDetected = deletesAreDetected;
1342        }
1343        
1344        public boolean insertsAreDetected(int type) throws SQLException
1345        {
1346            return insertsAreDetected;
1347        }
1348        
1349        public void setInsertsAreDetected(boolean insertsAreDetected)
1350        {
1351            this.insertsAreDetected = insertsAreDetected;
1352        }
1353        
1354        public boolean othersDeletesAreVisible(int type) throws SQLException
1355        {
1356            return othersDeletesAreVisible;
1357        }
1358        
1359        public void setOthersDeletesAreVisible(boolean othersDeletesAreVisible)
1360        {
1361            this.othersDeletesAreVisible = othersDeletesAreVisible;
1362        }
1363        
1364        public boolean othersInsertsAreVisible(int type) throws SQLException
1365        {
1366            return othersInsertsAreVisible;
1367        }
1368        
1369        public void setOthersInsertsAreVisible(boolean othersInsertsAreVisible)
1370        {
1371            this.othersInsertsAreVisible = othersInsertsAreVisible;
1372        }
1373        
1374        public boolean othersUpdatesAreVisible(int type) throws SQLException
1375        {
1376            return othersUpdatesAreVisible;
1377        }
1378        
1379        public void setOthersUpdatesAreVisible(boolean othersUpdatesAreVisible)
1380        {
1381            this.othersUpdatesAreVisible = othersUpdatesAreVisible;
1382        }
1383        
1384        public boolean ownDeletesAreVisible(int type) throws SQLException
1385        {
1386            return ownDeletesAreVisible;
1387        }
1388        
1389        public void setOwnDeletesAreVisible(boolean ownDeletesAreVisible)
1390        {
1391            this.ownDeletesAreVisible = ownDeletesAreVisible;
1392        }
1393        
1394        public boolean ownInsertsAreVisible(int type) throws SQLException
1395        {
1396            return ownInsertsAreVisible;
1397        }
1398        
1399        public void setOwnInsertsAreVisible(boolean ownInsertsAreVisible)
1400        {
1401            this.ownInsertsAreVisible = ownInsertsAreVisible;
1402        }
1403        
1404        public boolean ownUpdatesAreVisible(int type) throws SQLException
1405        {
1406            return ownUpdatesAreVisible;
1407        }
1408        
1409        public void setOwnUpdatesAreVisible(boolean ownUpdatesAreVisible)
1410        {
1411            this.ownUpdatesAreVisible = ownUpdatesAreVisible;
1412        }
1413        
1414        public boolean supportsResultSetHoldability(int holdability) throws SQLException
1415        {
1416            return supportsResultSetHoldability;
1417        }
1418        
1419        public void setSupportsResultSetHoldability(boolean supportsResultSetHoldability)
1420        {
1421            this.supportsResultSetHoldability = supportsResultSetHoldability;
1422        }
1423        
1424        public boolean supportsResultSetType(int type) throws SQLException
1425        {
1426            return supportsResultSetType;
1427        }
1428        
1429        public void setSupportsResultSetType(boolean supportsResultSetType)
1430        {
1431            this.supportsResultSetType = supportsResultSetType;
1432        }
1433        
1434        public boolean supportsTransactionIsolationLevel(int level) throws SQLException
1435        {
1436            return supportsTransactionIsolationLevel;
1437        }
1438        
1439        public void setSupportsTransactionIsolationLevel(boolean supportsTransactionIsolationLevel)
1440        {
1441            this.supportsTransactionIsolationLevel = supportsTransactionIsolationLevel;
1442        }
1443        
1444        public boolean updatesAreDetected(int type) throws SQLException
1445        {
1446            return updatesAreDetected;
1447        }
1448        
1449        public void setUpdatesAreDetected(boolean updatesAreDetected)
1450        {
1451            this.updatesAreDetected = updatesAreDetected;
1452        }
1453        
1454        public boolean supportsConvert(int fromType, int toType) throws SQLException
1455        {
1456            return supportsConvert;
1457        }
1458        
1459        public boolean supportsResultSetConcurrency(int type, int concurrency) throws SQLException
1460        {
1461            return supportsResultSetConcurrency;
1462        }
1463        
1464        public void setSupportsResultSetConcurrency(boolean supportsResultSetConcurrency)
1465        {
1466            this.supportsResultSetConcurrency = supportsResultSetConcurrency;
1467        }
1468        
1469        public boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException
1470        {
1471            return supportsStoredFunctionsUsingCallSyntax;
1472        }
1473        
1474        public void setSupportsStoredFunctionsUsingCallSyntax(boolean supportsStoredFunctions)
1475        {
1476            supportsStoredFunctionsUsingCallSyntax = supportsStoredFunctions;
1477        }
1478    
1479        public String getCatalogSeparator() throws SQLException
1480        {
1481            return catalogSeparator;
1482        }
1483        
1484        public void setCatalogSeparator(String catalogSeparator)
1485        {
1486            this.catalogSeparator = catalogSeparator;
1487        }
1488        
1489        public String getCatalogTerm() throws SQLException
1490        {
1491            return catalogTerm;
1492        }
1493        
1494        public void setCatalogTerm(String catalogTerm)
1495        {
1496            this.catalogTerm = catalogTerm;
1497        }
1498        
1499        public String getDatabaseProductName() throws SQLException
1500        {
1501            return databaseProductName;
1502        }
1503        
1504        public void setDatabaseProductName(String databaseProductName)
1505        {
1506            this.databaseProductName = databaseProductName;
1507        }
1508        
1509        public String getDatabaseProductVersion() throws SQLException
1510        {
1511            return databaseProductVersion;
1512        }
1513        
1514        public void setDatabaseProductVersion(String databaseProductVersion)
1515        {
1516            this.databaseProductVersion = databaseProductVersion;
1517        }
1518        
1519        public String getDriverName() throws SQLException
1520        {
1521            return driverName;
1522        }
1523        
1524        public void setDriverName(String driverName)
1525        {
1526            this.driverName = driverName;
1527        }
1528        
1529        public String getDriverVersion() throws SQLException
1530        {
1531            return driverVersion;
1532        }
1533        
1534        public void setDriverVersion(String driverVersion)
1535        {
1536            this.driverVersion = driverVersion;
1537        }
1538        
1539        public String getExtraNameCharacters() throws SQLException
1540        {
1541            return extraNameCharacters;
1542        }
1543        
1544        public void setExtraNameCharacters(String extraNameCharacters)
1545        {
1546            this.extraNameCharacters = extraNameCharacters;
1547        }
1548        
1549        public String getIdentifierQuoteString() throws SQLException
1550        {
1551            return identifierQuoteString;
1552        }
1553        
1554        public void setIdentifierQuoteString(String identifierQuoteString)
1555        {
1556            this.identifierQuoteString = identifierQuoteString;
1557        }
1558        
1559        public String getNumericFunctions() throws SQLException
1560        {
1561            return numericFunctions;
1562        }
1563        
1564        public void setNumericFunctions(String numericFunctions)
1565        {
1566            this.numericFunctions = numericFunctions;
1567        }
1568        
1569        public String getProcedureTerm() throws SQLException
1570        {
1571            return procedureTerm;
1572        }
1573        
1574        public void setProcedureTerm(String procedureTerm)
1575        {
1576            this.procedureTerm = procedureTerm;
1577        }
1578        
1579        public String getSQLKeywords() throws SQLException
1580        {
1581            return sqlKeywords;
1582        }
1583        
1584        public void setSQLKeywords(String sqlKeywords)
1585        {
1586            this.sqlKeywords = sqlKeywords;
1587        }
1588        
1589        public String getSchemaTerm() throws SQLException
1590        {
1591            return schemaTerm;
1592        }
1593        
1594        public void setSchemaTerm(String schemaTerm)
1595        {
1596            this.schemaTerm = schemaTerm;
1597        }
1598        
1599        public String getSearchStringEscape() throws SQLException
1600        {
1601            return searchStringEscape;
1602        }
1603        
1604        public void setSearchStringEscape(String searchStringEscape)
1605        {
1606            this.searchStringEscape = searchStringEscape;
1607        }
1608        
1609        public String getStringFunctions() throws SQLException
1610        {
1611            return stringFunctions;
1612        }
1613        
1614        public void setStringFunctions(String stringFunctions)
1615        {
1616            this.stringFunctions = stringFunctions;
1617        }
1618        
1619        public String getSystemFunctions() throws SQLException
1620        {
1621            return systemFunctions;
1622        }
1623        
1624        public void setSystemFunctions(String systemFunctions)
1625        {
1626            this.systemFunctions = systemFunctions;
1627        }
1628        
1629        public String getTimeDateFunctions() throws SQLException
1630        {
1631            return timeDateFunctions;
1632        }
1633        
1634        public void setTimeDateFunctions(String timeDateFunctions)
1635        {
1636            this.timeDateFunctions = timeDateFunctions;
1637        }
1638        
1639        public String getURL() throws SQLException
1640        {
1641            return url;
1642        }
1643        
1644        public void setURL(String url)
1645        {
1646            this.url = url;
1647        }
1648        
1649        public String getUserName() throws SQLException
1650        {
1651            return userName;
1652        }
1653        
1654        public void setUserName(String userName)
1655        {
1656            this.userName = userName;
1657        }
1658        
1659        public Connection getConnection() throws SQLException
1660        {
1661            return connection;
1662        }
1663        
1664        public void setConnection(Connection connection)
1665        {
1666            this.connection = connection;
1667        }
1668        
1669        public ResultSet getCatalogs() throws SQLException
1670        {
1671            return catalogs;
1672        }
1673        
1674        public void setCatalogs(ResultSet catalogs)
1675        {
1676            this.catalogs = catalogs;
1677        }
1678        
1679        public ResultSet getSchemas() throws SQLException
1680        {
1681            return getAll(schemasMap);
1682        }
1683        
1684        public ResultSet getSchemas(String catalog, String schemaPattern) throws SQLException
1685        {
1686            DatabaseIdentifier expected = new DatabaseIdentifierImpl(catalog, schemaPattern, "", true, false);
1687            return findMatchingDatabaseIdentifier(expected, schemasMap);
1688        }
1689        
1690        public void setSchemas(ResultSet schemas)
1691        {
1692            schemasMap.put(new DatabaseIdentifierImpl(), schemas);
1693        }
1694        
1695        public void setSchemas(String catalog, String schemaPattern, ResultSet schemas)
1696        {
1697            schemasMap.put(new DatabaseIdentifierImpl(catalog, schemaPattern, ""), schemas);
1698        }
1699        
1700        public void clearSchemas()
1701        {
1702            schemasMap.clear();
1703        }
1704        
1705        public ResultSet getTableTypes() throws SQLException
1706        {
1707            return tableTypes;
1708        }
1709        
1710        public void setTableTypes(ResultSet tableTypes)
1711        {
1712            this.tableTypes = tableTypes;
1713        }
1714        
1715        public ResultSet getTypeInfo() throws SQLException
1716        {
1717            return typeInfo;
1718        }
1719        
1720        public void setTypeInfo(ResultSet typeInfo)
1721        {
1722            this.typeInfo = typeInfo;
1723        }
1724        
1725        public ResultSet getClientInfoProperties() throws SQLException
1726        {
1727            return clientInfoProperties;
1728        }
1729        
1730        public void setClientInfoProperties(ResultSet clientInfoProperties)
1731        {
1732            this.clientInfoProperties = clientInfoProperties;
1733        }
1734    
1735        public ResultSet getExportedKeys(String catalog, String schema, String table) throws SQLException
1736        {
1737            DatabaseIdentifier expected = new DatabaseIdentifierImpl(catalog, schema, table);
1738            return findMatchingDatabaseIdentifier(expected, exportedKeysMap);
1739        }
1740        
1741        public void setExportedKeys(ResultSet exportedKeys)
1742        {
1743            exportedKeysMap.put(new DatabaseIdentifierImpl(), exportedKeys);
1744        }
1745        
1746        public void setExportedKeys(String catalog, String schema, String table, ResultSet exportedKeys)
1747        {
1748            exportedKeysMap.put(new DatabaseIdentifierImpl(catalog, schema, table), exportedKeys);
1749        }
1750        
1751        public void clearExportedKeys()
1752        {
1753            exportedKeysMap.clear();
1754        }
1755        
1756        public ResultSet getImportedKeys(String catalog, String schema, String table) throws SQLException
1757        {
1758            DatabaseIdentifier expected = new DatabaseIdentifierImpl(catalog, schema, table);
1759            return findMatchingDatabaseIdentifier(expected, importedKeysMap);
1760        }
1761        
1762        public void setImportedKeys(ResultSet importedKeys)
1763        {
1764            importedKeysMap.put(new DatabaseIdentifierImpl(), importedKeys);
1765        }
1766        
1767        public void setImportedKeys(String catalog, String schema, String table, ResultSet importedKeys)
1768        {
1769            importedKeysMap.put(new DatabaseIdentifierImpl(catalog, schema, table), importedKeys);
1770        }
1771        
1772        public void clearImportedKeys()
1773        {
1774            importedKeysMap.clear();
1775        }
1776        
1777        public ResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException
1778        {
1779            DatabaseIdentifier expected = new DatabaseIdentifierImpl(catalog, schema, table);
1780            return findMatchingDatabaseIdentifier(expected, primaryKeysMap);
1781        }
1782        
1783        public void setPrimaryKeys(ResultSet primaryKeys)
1784        {
1785            primaryKeysMap.put(new DatabaseIdentifierImpl(), primaryKeys);
1786        }
1787        
1788        public void setPrimaryKeys(String catalog, String schema, String table, ResultSet primaryKeys)
1789        {
1790            primaryKeysMap.put(new DatabaseIdentifierImpl(catalog, schema, table), primaryKeys);
1791        }
1792        
1793        public void clearPrimaryKeys()
1794        {
1795            primaryKeysMap.clear();
1796        }
1797        
1798        public ResultSet getProcedures(String catalog, String schemaPattern, String procedureNamePattern) throws SQLException
1799        {
1800            DatabaseIdentifier expected = new DatabaseIdentifierImpl(catalog, schemaPattern, procedureNamePattern, true, true);
1801            return findMatchingDatabaseIdentifier(expected, proceduresMap);
1802        }
1803        
1804        public void setProcedures(ResultSet procedures)
1805        {
1806            proceduresMap.put(new DatabaseIdentifierImpl(), procedures);
1807        }
1808        
1809        public void setProcedures(String catalog, String schemaPattern, String procedureNamePattern, ResultSet procedures)
1810        {
1811            proceduresMap.put(new DatabaseIdentifierImpl(catalog, schemaPattern, procedureNamePattern), procedures);
1812        }
1813        
1814        public void clearProcedures()
1815        {
1816            proceduresMap.clear();
1817        }
1818        
1819        public ResultSet getFunctions(String catalog, String schemaPattern, String functionNamePattern) throws SQLException
1820        {
1821            DatabaseIdentifier expected = new DatabaseIdentifierImpl(catalog, schemaPattern, functionNamePattern, true, true);
1822            return findMatchingDatabaseIdentifier(expected, functionsMap);
1823        }
1824        
1825        public void setFunctions(ResultSet functions)
1826        {
1827            functionsMap.put(new DatabaseIdentifierImpl(), functions);
1828        }
1829        
1830        public void setFunctions(String catalog, String schemaPattern, String functionNamePattern, ResultSet functions)
1831        {
1832            functionsMap.put(new DatabaseIdentifierImpl(catalog, schemaPattern, functionNamePattern), functions);
1833        }
1834        
1835        public void clearFunctions()
1836        {
1837            functionsMap.clear();
1838        }
1839        
1840        public ResultSet getSuperTables(String catalog, String schemaPattern, String tableNamePattern) throws SQLException
1841        {
1842            DatabaseIdentifier expected = new DatabaseIdentifierImpl(catalog, schemaPattern, tableNamePattern, true, true);
1843            return findMatchingDatabaseIdentifier(expected, superTablesMap);
1844        }
1845        
1846        public void setSuperTables(ResultSet superTables)
1847        {
1848            superTablesMap.put(new DatabaseIdentifierImpl(), superTables);
1849        }
1850        
1851        public void setSuperTables(String catalog, String schemaPattern, String tableName, ResultSet superTables)
1852        {
1853            superTablesMap.put(new DatabaseIdentifierImpl(catalog, schemaPattern, tableName), superTables);
1854        }
1855        
1856        public void clearSuperTables()
1857        {
1858            superTablesMap.clear();
1859        }
1860        
1861        public ResultSet getSuperTypes(String catalog, String schemaPattern, String typeNamePattern) throws SQLException
1862        {
1863            DatabaseIdentifier expected = new DatabaseIdentifierImpl(catalog, schemaPattern, typeNamePattern, true, true);
1864            return findMatchingDatabaseIdentifier(expected, superTypesMap);
1865        }
1866        
1867        public void setSuperTypes(ResultSet superTypes)
1868        {
1869            superTypesMap.put(new DatabaseIdentifierImpl(), superTypes);
1870        }
1871        
1872        public void setSuperTypes(String catalog, String schemaPattern, String typeNamePattern, ResultSet superTypes)
1873        {
1874            superTypesMap.put(new DatabaseIdentifierImpl(catalog, schemaPattern, typeNamePattern), superTypes);
1875        }
1876        
1877        public void clearSuperTypes()
1878        {
1879            superTypesMap.clear();
1880        }
1881        
1882        public ResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern) throws SQLException
1883        {
1884            DatabaseIdentifier expected = new DatabaseIdentifierImpl(catalog, schemaPattern, tableNamePattern, true, true);
1885            return findMatchingDatabaseIdentifier(expected, tablePrivilegesMap);
1886        }
1887        
1888        public void setTablePrivileges(ResultSet tablePrivileges)
1889        {
1890            tablePrivilegesMap.put(new DatabaseIdentifierImpl(), tablePrivileges);
1891        }
1892        
1893        public void setTablePrivileges(String catalog, String schemaPattern, String tableNamePattern, ResultSet tablePrivileges)
1894        {
1895            tablePrivilegesMap.put(new DatabaseIdentifierImpl(catalog, schemaPattern, tableNamePattern), tablePrivileges);
1896        }
1897        
1898        public void clearTablePrivileges()
1899        {
1900            tablePrivilegesMap.clear();
1901        }
1902        
1903        public ResultSet getVersionColumns(String catalog, String schema, String table) throws SQLException
1904        {
1905            DatabaseIdentifier expected = new DatabaseIdentifierImpl(catalog, schema, table);
1906            return findMatchingDatabaseIdentifier(expected, versionColumnsMap);
1907        }
1908        
1909        public void setVersionColumns(ResultSet versionColumns)
1910        {
1911            versionColumnsMap.put(new DatabaseIdentifierImpl(), versionColumns);
1912        }
1913        
1914        public void setVersionColumns(String catalog, String schema, String table, ResultSet versionColumns)
1915        {
1916            versionColumnsMap.put(new DatabaseIdentifierImpl(catalog, schema, table), versionColumns);
1917        }
1918        
1919        public void clearVersionColumns()
1920        {
1921            versionColumnsMap.clear();
1922        }
1923        
1924        public ResultSet getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) throws SQLException
1925        {
1926            DatabaseIdentifier expected = new RowIdentifierDatabaseIdentifierImpl(catalog, schema, table, scope, nullable);
1927            return findMatchingDatabaseIdentifier(expected, bestRowIdentifierMap);
1928        }
1929        
1930        public void setBestRowIdentifier(ResultSet bestRowIdentifier)
1931        {
1932            bestRowIdentifierMap.put(new RowIdentifierDatabaseIdentifierImpl(), bestRowIdentifier);
1933        }
1934        
1935        public void setBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable, ResultSet bestRowIdentifier)
1936        {
1937            bestRowIdentifierMap.put(new RowIdentifierDatabaseIdentifierImpl(catalog, schema, table, scope, nullable), bestRowIdentifier);
1938        }
1939        
1940        public void clearBestRowIdentifier()
1941        {
1942            bestRowIdentifierMap.clear();
1943        }
1944        
1945        public ResultSet getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate) throws SQLException
1946        {
1947            DatabaseIdentifier expected = new IndexInfoDatabaseIdentifierImpl(catalog, schema, table, unique, approximate);
1948            return findMatchingDatabaseIdentifier(expected, indexInfoMap);
1949        }
1950        
1951        public void setIndexInfo(ResultSet indexInfo)
1952        {
1953            indexInfoMap.put(new IndexInfoDatabaseIdentifierImpl(), indexInfo);
1954        }
1955        
1956        public void setIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate, ResultSet indexInfo)
1957        {
1958            indexInfoMap.put(new IndexInfoDatabaseIdentifierImpl(catalog, schema, table, unique, approximate), indexInfo);
1959        }
1960        
1961        public void clearIndexInfo()
1962        {
1963            indexInfoMap.clear();
1964        }
1965        
1966        public ResultSet getUDTs(String catalog, String schemaPattern, String typeNamePattern, int[] types) throws SQLException
1967        {
1968            DatabaseIdentifier expected = new UDTDatabaseIdentifierImpl(catalog, schemaPattern, typeNamePattern, true, true, types);
1969            return findMatchingDatabaseIdentifier(expected, udtsMap);
1970        }
1971        
1972        public void setUDTs(ResultSet udts)
1973        {
1974            udtsMap.put(new UDTDatabaseIdentifierImpl(), udts);
1975        }
1976        
1977        public void setUDTs(String catalog, String schemaPattern, String typeNamePattern, int[] types, ResultSet udts)
1978        {
1979            udtsMap.put(new UDTDatabaseIdentifierImpl(catalog, schemaPattern, typeNamePattern, types), udts);
1980        }
1981        
1982        public void clearUDTs()
1983        {
1984            udtsMap.clear();
1985        }
1986        
1987        public ResultSet getAttributes(String catalog, String schemaPattern, String typeNamePattern, String attributeNamePattern) throws SQLException
1988        {
1989            DatabaseIdentifier expected = new AttributesDatabaseIdentifierImpl(catalog, schemaPattern, typeNamePattern, true, true, attributeNamePattern);
1990            return findMatchingDatabaseIdentifier(expected, attributesMap);
1991        }
1992        
1993        public void setAttributes(ResultSet attributes)
1994        {
1995            attributesMap.put(new AttributesDatabaseIdentifierImpl(), attributes);
1996        }
1997        
1998        public void setAttributes(String catalog, String schemaPattern, String typeNamePattern, String attributeNamePattern, ResultSet attributes)
1999        {
2000            attributesMap.put(new AttributesDatabaseIdentifierImpl(catalog, schemaPattern, typeNamePattern, attributeNamePattern), attributes);
2001        }
2002        
2003        public void clearAttributes()
2004        {
2005            attributesMap.clear();
2006        }
2007        
2008        public ResultSet getColumnPrivileges(String catalog, String schema, String table, String columnNamePattern) throws SQLException
2009        {
2010            DatabaseIdentifier expected = new ColumnDatabaseIdentifierImpl(catalog, schema, table, columnNamePattern);
2011            return findMatchingDatabaseIdentifier(expected, columnPrivilegesMap);
2012        }
2013        
2014        public void setColumnPrivileges(ResultSet columnPrivileges)
2015        {
2016            columnPrivilegesMap.put(new ColumnDatabaseIdentifierImpl(), columnPrivileges);
2017        }
2018        
2019        public void setColumnPrivileges(String catalog, String schema, String table, String columnNamePattern, ResultSet columnPrivileges)
2020        {
2021            columnPrivilegesMap.put(new ColumnDatabaseIdentifierImpl(catalog, schema, table, columnNamePattern), columnPrivileges);
2022        }
2023        
2024        public void clearColumnPrivileges()
2025        {
2026            columnPrivilegesMap.clear();
2027        }
2028        
2029        public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException
2030        {
2031            DatabaseIdentifier expected = new ColumnDatabaseIdentifierImpl(catalog, schemaPattern, tableNamePattern, true, true, columnNamePattern);
2032            return findMatchingDatabaseIdentifier(expected, columnsMap);
2033        }
2034        
2035        public void setColumns(ResultSet columns)
2036        {
2037            columnsMap.put(new ColumnDatabaseIdentifierImpl(), columns);
2038        }
2039        
2040        public void setColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern, ResultSet columns)
2041        {
2042            columnsMap.put(new ColumnDatabaseIdentifierImpl(catalog, schemaPattern, tableNamePattern, columnNamePattern), columns);
2043        }
2044        
2045        public void clearColumns()
2046        {
2047            columnsMap.clear();
2048        }
2049        
2050        public ResultSet getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) throws SQLException
2051        {
2052            DatabaseIdentifier expected = new ColumnDatabaseIdentifierImpl(catalog, schemaPattern, procedureNamePattern, true, true, columnNamePattern);
2053            return findMatchingDatabaseIdentifier(expected, procedureColumnsMap);
2054        }
2055        
2056        public void setProcedureColumns(ResultSet procedureColumns)
2057        {
2058            procedureColumnsMap.put(new ColumnDatabaseIdentifierImpl(), procedureColumns);
2059        }
2060        
2061        public void setProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern, ResultSet procedureColumns)
2062        {
2063            procedureColumnsMap.put(new ColumnDatabaseIdentifierImpl(catalog, schemaPattern, procedureNamePattern, columnNamePattern), procedureColumns);
2064        }
2065        
2066        public void clearProcedureColumns()
2067        {
2068            procedureColumnsMap.clear();
2069        }
2070        
2071        public ResultSet getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern) throws SQLException
2072        {
2073            DatabaseIdentifier expected = new ColumnDatabaseIdentifierImpl(catalog, schemaPattern, functionNamePattern, true, true, columnNamePattern);
2074            return findMatchingDatabaseIdentifier(expected, functionColumnsMap);
2075        }
2076        
2077        public void setFunctionColumns(ResultSet functionColumns)
2078        {
2079            functionColumnsMap.put(new ColumnDatabaseIdentifierImpl(), functionColumns);
2080        }
2081        
2082        public void setFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern, ResultSet functionColumns)
2083        {
2084            functionColumnsMap.put(new ColumnDatabaseIdentifierImpl(catalog, schemaPattern, functionNamePattern, columnNamePattern), functionColumns);
2085        }
2086        
2087        public void clearFunctionColumns()
2088        {
2089            functionColumnsMap.clear();
2090        }
2091        
2092        public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) throws SQLException
2093        {
2094            DatabaseIdentifier expected = new TableDatabaseIdentifierImpl(catalog, schemaPattern, true, true, tableNamePattern, types);
2095            return findMatchingDatabaseIdentifier(expected, tablesMap);
2096        }
2097        
2098        public void setTables(ResultSet tables)
2099        {
2100            tablesMap.put(new TableDatabaseIdentifierImpl(), tables);
2101        }
2102        
2103        public void setTables(String catalog, String schemaPattern, String tableNamePattern, String[] types, ResultSet tables)
2104        {
2105            tablesMap.put(new TableDatabaseIdentifierImpl(catalog, schemaPattern, tableNamePattern, types), tables);
2106        }
2107        
2108        public void clearTables()
2109        {
2110            tablesMap.clear();
2111        }
2112        
2113        public ResultSet getCrossReference(String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable) throws SQLException
2114        {
2115            DatabaseIdentifier identifier1 = new DatabaseIdentifierImpl(primaryCatalog, primarySchema, primaryTable);
2116            DatabaseIdentifier identifier2 = new DatabaseIdentifierImpl(foreignCatalog, foreignSchema, foreignTable);
2117            DatabaseIdentifier expected = new DatabaseIdentifierImplWrapper(identifier1, identifier2);
2118            return findMatchingDatabaseIdentifier(expected, crossReferenceMap);
2119        }
2120        
2121        public void setCrossReference(ResultSet crossReference)
2122        {
2123            DatabaseIdentifier identifier1 = new DatabaseIdentifierImpl();
2124            DatabaseIdentifier identifier2 = new DatabaseIdentifierImpl();
2125            crossReferenceMap.put(new DatabaseIdentifierImplWrapper(identifier1, identifier2), crossReference);
2126        }
2127        
2128        public void setCrossReference(String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable, ResultSet crossReference)
2129        {
2130            DatabaseIdentifier identifier1 = new DatabaseIdentifierImpl(primaryCatalog, primarySchema, primaryTable);
2131            DatabaseIdentifier identifier2 = new DatabaseIdentifierImpl(foreignCatalog, foreignSchema, foreignTable);
2132            crossReferenceMap.put(new DatabaseIdentifierImplWrapper(identifier1, identifier2), crossReference);
2133        }
2134        
2135        public void clearCrossReference()
2136        {
2137            crossReferenceMap.clear();
2138        }
2139    
2140        public boolean isWrapperFor(Class iface) throws SQLException
2141        {
2142            return false;
2143        }
2144    
2145        public Object unwrap(Class iface) throws SQLException
2146        {
2147            throw new SQLException("No object found for " + iface);
2148        }
2149        
2150        /*
2151         * If there is only one matching DatabaseIdentifier, then return its
2152         * ResultSet otherwise return a PolyResultSet with the ResultSet of each
2153         * matching DatabaseIdentifier.
2154         */
2155        private ResultSet findMatchingDatabaseIdentifier(DatabaseIdentifier expected, Map theMap)
2156        {
2157            List list = new ArrayList();
2158            for(Iterator it = theMap.entrySet().iterator(); it.hasNext(); )
2159            {
2160                Map.Entry entry = (Map.Entry)it.next();
2161                DatabaseIdentifier next = (DatabaseIdentifier)entry.getKey();
2162                if(next.isGlobal() || expected.matches(next)) 
2163                {
2164                    list.add(entry.getValue());
2165                }
2166            }
2167            if(list.isEmpty()) return null;
2168            if(list.size() == 1) return (ResultSet)list.get(0);
2169            return new PolyResultSet(list);
2170        }
2171        
2172        private ResultSet getAll(Map theMap)
2173        {
2174            List list = new ArrayList();
2175            list.addAll(theMap.values());
2176            if(list.isEmpty()) return null;
2177            if(list.size() == 1) return (ResultSet)list.get(0);
2178            return new PolyResultSet(list);
2179        }
2180        
2181        private interface DatabaseIdentifier
2182        {
2183            public boolean isGlobal();
2184            
2185            public boolean matches(DatabaseIdentifier other);
2186        }
2187        
2188        private class DatabaseIdentifierImpl implements DatabaseIdentifier
2189        {
2190            private boolean isGlobal;
2191            private String catalog;
2192            private String schema;
2193            private String table;
2194            private boolean useSchemaPattern;
2195            private boolean useTablePattern;
2196            
2197            public DatabaseIdentifierImpl()
2198            {
2199                isGlobal = true;
2200            }
2201            
2202            public DatabaseIdentifierImpl(String catalog, String schema, String table)
2203            {
2204                this(catalog, schema, table, false, false);
2205            }
2206            
2207            public DatabaseIdentifierImpl(String catalog, String schema, String table, boolean useSchemaPattern, boolean useTablePattern)
2208            {
2209                isGlobal = false;
2210                this.catalog = catalog;
2211                this.schema = schema;
2212                this.table = table;
2213                this.useSchemaPattern = useSchemaPattern;
2214                this.useTablePattern = useTablePattern;
2215            }
2216            
2217            public String getCatalog()
2218            {
2219                return catalog;
2220            }
2221            
2222            public boolean isGlobal()
2223            {
2224                return isGlobal;
2225            }
2226            
2227            public String getSchema()
2228            {
2229                return schema;
2230            }
2231            
2232            public String getTable()
2233            {
2234                return table;
2235            }
2236            
2237            protected String convert(String name) 
2238            {
2239                if(name.indexOf('%') != -1) 
2240                {
2241                    name = StringUtil.replaceAll(name, "%", ".*");
2242                }
2243                if(name.indexOf('_') != -1) 
2244                {
2245                    name = StringUtil.replaceAll(name, "_", ".");
2246                }
2247                return name;
2248            }
2249            
2250            public boolean matches(DatabaseIdentifier object) 
2251            {
2252                if(null == object) return false;
2253                if(!object.getClass().equals(this.getClass())) return false;
2254                DatabaseIdentifierImpl other = (DatabaseIdentifierImpl)object;
2255                if(isGlobal != other.isGlobal()) return false;
2256                if(!matchesCatalog(other)) return false;
2257                if(!matchesSchema(other)) return false;
2258                return matchesTable(other);
2259            }
2260            
2261            private boolean matchesCatalog(DatabaseIdentifierImpl other)
2262            {
2263                if(null == getCatalog()) return true;
2264                if(catalog.length() == 0) 
2265                {
2266                    return (other.getCatalog() == null) || (other.getCatalog().length() == 0);
2267                } 
2268                else 
2269                {
2270                    if(other.getCatalog() == null) return false;
2271                    return StringUtil.matchesExact(other.getCatalog(), catalog, caseSensitive);
2272                }
2273            }
2274            
2275            private boolean matchesSchema(DatabaseIdentifierImpl other)
2276            {
2277                if(null == getSchema()) return true;
2278                if(schema.length() == 0) 
2279                {
2280                    return (other.getSchema() == null) || (other.getSchema().length() == 0);
2281                } 
2282                else 
2283                {
2284                    if(other.getSchema() == null) return false;
2285                    if(!useSchemaPattern)
2286                    {
2287                        return StringUtil.matchesExact(other.getSchema(), schema, caseSensitive);
2288                    }
2289                    else
2290                    {
2291                        return StringUtil.matchesPerl5(other.getSchema(), convert(schema), caseSensitive);
2292                    }
2293                }
2294            }
2295            
2296            private boolean matchesTable(DatabaseIdentifierImpl other)
2297            {
2298                if(null == table) return false;
2299                if(null == other.getTable()) return false;
2300                if(!useTablePattern)
2301                {
2302                    return StringUtil.matchesExact(other.getTable(), table, caseSensitive);
2303                }
2304                else
2305                {
2306                    return StringUtil.matchesPerl5(other.getTable(), convert(table), caseSensitive);
2307                }
2308            }
2309            
2310            public boolean equals(Object object)
2311            {
2312                if(null == object) return false;
2313                if(!object.getClass().equals(this.getClass())) return false;
2314                DatabaseIdentifierImpl other = (DatabaseIdentifierImpl)object;
2315                if(isGlobal != other.isGlobal()) return false;
2316                if(null != catalog && !catalog.equals(other.getCatalog())) return false;
2317                if(null != other.getCatalog() && !other.getCatalog().equals(catalog)) return false;
2318                if(null != schema && !schema.equals(other.getSchema())) return false;
2319                if(null != other.getSchema() && !other.getSchema().equals(schema)) return false;
2320                if(null != table && !table.equals(other.getTable())) return false;
2321                if(null != other.getTable() && !other.getTable().equals(table)) return false;
2322                return true;
2323            }
2324            
2325            public int hashCode()
2326            {
2327                int hashCode = 17;
2328                if(null != catalog) hashCode = (31 * hashCode) + catalog.hashCode();
2329                if(null != schema) hashCode = (31 * hashCode) + schema.hashCode();
2330                if(null != table) hashCode = (31 * hashCode) + table.hashCode();
2331                return hashCode;
2332            }
2333        }
2334        
2335        private class AttributesDatabaseIdentifierImpl extends DatabaseIdentifierImpl
2336        {
2337            private String attributeNamePattern;
2338            
2339            public AttributesDatabaseIdentifierImpl()
2340            {
2341                
2342            }
2343            
2344            public AttributesDatabaseIdentifierImpl(String catalog, String schema, String table, String attributeNamePattern)
2345            {
2346                super(catalog, schema, table);
2347                this.attributeNamePattern = attributeNamePattern;
2348            }
2349            
2350            public AttributesDatabaseIdentifierImpl(String catalog, String schema, String table, boolean useSchemaPattern, boolean useTablePattern, String attributeNamePattern)
2351            {
2352                super(catalog, schema, table, useSchemaPattern, useTablePattern);
2353                this.attributeNamePattern = attributeNamePattern;
2354            }
2355            
2356            public String getAttributeNamePattern()
2357            {
2358                return attributeNamePattern;
2359            }
2360            
2361            public boolean matches(DatabaseIdentifier object) 
2362            {
2363                if(!super.matches(object)) return false;
2364                AttributesDatabaseIdentifierImpl other = (AttributesDatabaseIdentifierImpl)object;
2365                if(null == attributeNamePattern) return false;
2366                if(null == other.getAttributeNamePattern()) return false;
2367                return StringUtil.matchesPerl5(other.getAttributeNamePattern(), convert(attributeNamePattern), caseSensitive);
2368            }
2369            
2370            public boolean equals(Object object)
2371            {
2372                if(!super.equals(object)) return false;
2373                AttributesDatabaseIdentifierImpl other = (AttributesDatabaseIdentifierImpl)object;
2374                if(null != attributeNamePattern && !attributeNamePattern.equals(other.getAttributeNamePattern())) return false;
2375                if(null != other.getAttributeNamePattern() && !other.getAttributeNamePattern().equals(attributeNamePattern)) return false;
2376                return true;
2377            }
2378            
2379            public int hashCode()
2380            {
2381                int hashCode = super.hashCode();
2382                if(null != attributeNamePattern) hashCode = (31 * hashCode) + attributeNamePattern.hashCode();
2383                return hashCode;
2384            }
2385        }
2386        
2387        private class ColumnDatabaseIdentifierImpl extends DatabaseIdentifierImpl
2388        {
2389            private String columnNamePattern;
2390            
2391            public ColumnDatabaseIdentifierImpl()
2392            {
2393                
2394            }
2395            
2396            public ColumnDatabaseIdentifierImpl(String catalog, String schema, String table, String columnNamePattern)
2397            {
2398                super(catalog, schema, table);
2399                this.columnNamePattern = columnNamePattern;
2400            }
2401            
2402            public ColumnDatabaseIdentifierImpl(String catalog, String schema, String table, boolean useSchemaPattern, boolean useTablePattern, String columnNamePattern)
2403            {
2404                super(catalog, schema, table, useSchemaPattern, useTablePattern);
2405                this.columnNamePattern = columnNamePattern;
2406            }
2407            
2408            public String getColumnNamePattern()
2409            {
2410                return columnNamePattern;
2411            }
2412            
2413            public boolean matches(DatabaseIdentifier object) 
2414            {
2415                if(!super.matches(object)) return false;
2416                ColumnDatabaseIdentifierImpl other = (ColumnDatabaseIdentifierImpl)object;
2417                if(null == columnNamePattern) return false;
2418                if(null == other.getColumnNamePattern()) return false;
2419                return StringUtil.matchesPerl5(other.getColumnNamePattern(), convert(columnNamePattern), caseSensitive);
2420            }
2421            
2422            public boolean equals(Object object)
2423            {
2424                if(!super.equals(object)) return false;
2425                ColumnDatabaseIdentifierImpl other = (ColumnDatabaseIdentifierImpl)object;
2426                if(null != columnNamePattern && !columnNamePattern.equals(other.getColumnNamePattern())) return false;
2427                if(null != other.getColumnNamePattern() && !other.getColumnNamePattern().equals(columnNamePattern)) return false;
2428                return true;
2429            }
2430            
2431            public int hashCode()
2432            {
2433                int hashCode = super.hashCode();
2434                if(null != columnNamePattern) hashCode = (31 * hashCode) + columnNamePattern.hashCode();
2435                return hashCode;
2436            }
2437        }
2438        
2439        private class RowIdentifierDatabaseIdentifierImpl extends DatabaseIdentifierImpl
2440        {
2441            private int scope;
2442            private boolean nullable;
2443            
2444            public RowIdentifierDatabaseIdentifierImpl()
2445            {
2446                
2447            }
2448            
2449            public RowIdentifierDatabaseIdentifierImpl(String catalog, String schema, String table, int scope, boolean nullable)
2450            {
2451                super(catalog, schema, table);
2452                this.scope = scope;
2453                this.nullable = nullable;
2454            }
2455            
2456            public boolean isNullable()
2457            {
2458                return nullable;
2459            }
2460            
2461            public int getScope()
2462            {
2463                return scope;
2464            }
2465            
2466            public boolean matches(DatabaseIdentifier object)
2467            {
2468                if(!super.matches(object)) return false;
2469                return isEqual(object);
2470            }
2471    
2472            public boolean equals(Object object)
2473            {
2474                if(!super.equals(object)) return false;
2475                return isEqual(object);
2476            }
2477    
2478            private boolean isEqual(Object object)
2479            {
2480                RowIdentifierDatabaseIdentifierImpl other = (RowIdentifierDatabaseIdentifierImpl)object;
2481                if(scope != other.getScope()) return false;
2482                if(nullable != other.isNullable()) return false;
2483                return true;
2484            }
2485            
2486            public int hashCode()
2487            {
2488                int hashCode = (super.hashCode() * 31) + scope;
2489                hashCode = (31 * hashCode) + (nullable ? 31 : 62);
2490                return hashCode;
2491            }
2492        }
2493        
2494        private class IndexInfoDatabaseIdentifierImpl extends DatabaseIdentifierImpl
2495        {
2496            private boolean unique;
2497            private boolean approximate;
2498            
2499            public IndexInfoDatabaseIdentifierImpl()
2500            {
2501                
2502            }
2503            
2504            public IndexInfoDatabaseIdentifierImpl(String catalog, String schema, String table, boolean unique, boolean approximate)
2505            {
2506                super(catalog, schema, table);
2507                this.unique = unique;
2508                this.approximate = approximate;
2509            }
2510            
2511            public boolean isApproximate()
2512            {
2513                return approximate;
2514            }
2515            
2516            public boolean isUnique()
2517            {
2518                return unique;
2519            }
2520            
2521            public boolean matches(DatabaseIdentifier object)
2522            {
2523                if(!super.matches(object)) return false;
2524                return isEqual(object);
2525            }
2526            
2527            public boolean equals(Object object)
2528            {
2529                if(!super.equals(object)) return false;
2530                return isEqual(object);
2531            }
2532    
2533            private boolean isEqual(Object object)
2534            {
2535                IndexInfoDatabaseIdentifierImpl other = (IndexInfoDatabaseIdentifierImpl)object;
2536                if(unique != other.isUnique()) return false;
2537                if(approximate != other.isApproximate()) return false;
2538                return true;
2539            }
2540            
2541            public int hashCode()
2542            {
2543                int hashCode = super.hashCode();
2544                hashCode = (31 * hashCode) + (unique ? 31 : 62);
2545                hashCode = (31 * hashCode) + (approximate ? (3 * 31) : (4 * 31));
2546                return hashCode;
2547            }
2548        }
2549        
2550        private class TableDatabaseIdentifierImpl extends DatabaseIdentifierImpl
2551        {
2552            private String[] types;
2553            
2554            public TableDatabaseIdentifierImpl()
2555            {
2556                
2557            }
2558            
2559            public TableDatabaseIdentifierImpl(String catalog, String schema, String table, String[] types)
2560            {
2561                super(catalog, schema, table);
2562                this.types = types;
2563            }
2564            
2565            public TableDatabaseIdentifierImpl(String catalog, String schema, boolean useSchemaPattern, boolean useTablePattern, String table, String[] types)
2566            {
2567                super(catalog, schema, table, useSchemaPattern, useTablePattern);
2568                this.types = types;
2569            }
2570            
2571            public String[] getTypes()
2572            {
2573                return types;
2574            }
2575            
2576            public boolean matches(DatabaseIdentifier object) 
2577            {
2578                if(!super.matches(object)) return false;
2579                TableDatabaseIdentifierImpl other = (TableDatabaseIdentifierImpl)object;
2580                if(null == types) return true;
2581                if(null == other.getTypes()) return false;
2582                return matchesTypes(other);
2583            }
2584            
2585            private boolean matchesTypes(TableDatabaseIdentifierImpl other)
2586            {
2587                String[] otherTypes = other.getTypes();
2588                for(int ii = 0; ii < types.length; ii++) 
2589                {
2590                    String type = types[ii];
2591                    for(int jj = 0; jj < otherTypes.length; jj++) 
2592                    {
2593                        if(type.equals(otherTypes[jj])) return true;
2594                    }
2595                }
2596                return false;
2597            }
2598            
2599            public boolean equals(Object object)
2600            {
2601                if(!super.equals(object)) return false;
2602                TableDatabaseIdentifierImpl other = (TableDatabaseIdentifierImpl)object;
2603                if(null == types && null == other.getTypes()) return true;
2604                if(null == types) return false;
2605                if(null == other.getTypes()) return false;
2606                return Arrays.equals(types, other.getTypes());
2607            }
2608            
2609            public int hashCode()
2610            {
2611                int hashCode = super.hashCode();
2612                if(null != types)
2613                {
2614                    for(int ii = 0; ii < types.length; ii++)
2615                    {
2616                        if(null != types[ii])
2617                        {
2618                            hashCode = (31 * hashCode) + types[ii].hashCode();
2619                        }
2620                    }
2621                }
2622                return hashCode;
2623            }
2624        }
2625        
2626        private class UDTDatabaseIdentifierImpl extends DatabaseIdentifierImpl
2627        {
2628            private int[] types;
2629            
2630            public UDTDatabaseIdentifierImpl()
2631            {
2632                
2633            }
2634            
2635            public UDTDatabaseIdentifierImpl(String catalog, String schema, String table, int[] types)
2636            {
2637                super(catalog, schema, table);
2638                this.types = types;
2639            }
2640            
2641            public UDTDatabaseIdentifierImpl(String catalog, String schema, String table, boolean useSchemaPattern, boolean useTablePattern, int[] types)
2642            {
2643                super(catalog, schema, table, useSchemaPattern, useTablePattern);
2644                this.types = types;
2645            }
2646            
2647            public int[] getTypes()
2648            {
2649                return types;
2650            }
2651            
2652            public boolean matches(DatabaseIdentifier object) 
2653            {
2654                if(!super.matches(object)) return false;
2655                UDTDatabaseIdentifierImpl other = (UDTDatabaseIdentifierImpl)object;
2656                if(null == types) return true;
2657                if(null == other.getTypes()) return false;
2658                return matchesTypes(other);
2659            }
2660            
2661            private boolean matchesTypes(UDTDatabaseIdentifierImpl other)
2662            {
2663                int[] otherTypes = other.getTypes();
2664                for(int ii = 0; ii < types.length; ii++) 
2665                {
2666                    int type = types[ii];
2667                    for(int jj = 0; jj < otherTypes.length; jj++) 
2668                    {
2669                        if (type == otherTypes[jj]) return true;
2670                    }
2671                }
2672                return false;
2673            }
2674            
2675            public boolean equals(Object object)
2676            {
2677                if(!super.equals(object)) return false;
2678                UDTDatabaseIdentifierImpl other = (UDTDatabaseIdentifierImpl)object;
2679                if(null == types && null == other.getTypes()) return true;
2680                if(null == types) return false;
2681                if(null == other.getTypes()) return false;
2682                return Arrays.equals(types, other.getTypes());
2683            }
2684            
2685            public int hashCode()
2686            {
2687                int hashCode = super.hashCode();
2688                if(null != types)
2689                {
2690                    for(int ii = 0; ii < types.length; ii++)
2691                    {
2692                        hashCode = (31 * hashCode) + types[ii];
2693                    }
2694                }
2695                return hashCode;
2696            }
2697        }
2698        
2699        private class DatabaseIdentifierImplWrapper implements DatabaseIdentifier
2700        {
2701            private DatabaseIdentifier identifier1;
2702            private DatabaseIdentifier identifier2;
2703            
2704            public DatabaseIdentifierImplWrapper(DatabaseIdentifier identifier1, DatabaseIdentifier identifier2)
2705            {
2706                this.identifier1 = identifier1;
2707                this.identifier2 = identifier2;
2708            }
2709            
2710            public DatabaseIdentifier getIdentifier1()
2711            {
2712                return identifier1;
2713            }
2714            
2715            public DatabaseIdentifier getIdentifier2()
2716            {
2717                return identifier2;
2718            }
2719            
2720            public boolean isGlobal()
2721            {
2722                if(null == identifier1) return false;
2723                if(null == identifier2) return false;
2724                return (identifier1.isGlobal() && identifier1.isGlobal());
2725            }
2726            
2727            public boolean matches(DatabaseIdentifier object)
2728            {
2729                if(null == object) return false;
2730                if(!object.getClass().equals(this.getClass())) return false;
2731                DatabaseIdentifierImplWrapper other = (DatabaseIdentifierImplWrapper)object;
2732                if(null != identifier1 && !identifier1.matches(other.getIdentifier1())) return false; 
2733                if(null != identifier2 && !identifier2.matches(other.getIdentifier2())) return false;
2734                return true;
2735            }
2736            
2737            public boolean equals(Object object)
2738            {
2739                if(null == object) return false;
2740                if(!object.getClass().equals(this.getClass())) return false;
2741                DatabaseIdentifierImplWrapper other = (DatabaseIdentifierImplWrapper)object;
2742                if(null != identifier1 && !identifier1.equals(other.getIdentifier1())) return false;
2743                if(null != other.getIdentifier1() && !other.getIdentifier1().equals(identifier1)) return false;
2744                if(null != identifier2 && !identifier2.equals(other.getIdentifier2())) return false;
2745                if(null != other.getIdentifier2() && !other.getIdentifier2().equals(identifier2)) return false;
2746                return true;
2747            }
2748            
2749            public int hashCode()
2750            {
2751                int hashCode = 0;
2752                if(null != identifier1) hashCode = (31 * hashCode) + identifier1.hashCode();
2753                if(null != identifier2) hashCode = (31 * hashCode) + identifier2.hashCode();
2754                return hashCode;
2755            }
2756        }
2757    }
2758