1 23 24 package org.continuent.sequoia.driver; 25 26 import java.sql.SQLException ; 27 import java.util.HashMap ; 28 29 import org.continuent.sequoia.common.sql.metadata.MetadataContainer; 30 import org.continuent.sequoia.common.sql.metadata.MetadataDescription; 31 import org.continuent.sequoia.common.util.Constants; 32 33 43 public class DatabaseMetaData implements java.sql.DatabaseMetaData 44 { 45 46 private Connection connection; 47 48 51 private HashMap metadataContainer; 52 53 58 public DatabaseMetaData(Connection conn) 59 { 60 this.connection = conn; 61 metadataContainer = new HashMap (); 62 } 63 64 77 private Object getMetadata(String methodName, Class [] parametersType, 78 Object [] arguments, boolean allowsNull) throws SQLException 79 { 80 String key = MetadataContainer.getContainerKey(methodName, parametersType, 81 arguments); 82 Object value = metadataContainer.get(key); 83 84 if (value == null) 85 { value = connection.getStaticMetadata(key); 87 if ((value == null) && !allowsNull) 88 throw new SQLException ("Unable to retrieve metadata for " + key); 89 metadataContainer.put(key, value); 90 } 91 return value; 92 } 93 94 97 public boolean allProceduresAreCallable() throws SQLException 98 { 99 return ((Boolean ) getMetadata( 100 MetadataDescription.ALL_PROCEDURES_ARE_CALLABLE, null, null, false)) 101 .booleanValue(); 102 } 103 104 107 public boolean allTablesAreSelectable() throws SQLException 108 { 109 return ((Boolean ) getMetadata( 110 MetadataDescription.ALL_TABLES_ARE_SELECTABLE, null, null, false)) 111 .booleanValue(); 112 } 113 114 117 public boolean dataDefinitionCausesTransactionCommit() throws SQLException 118 { 119 return ((Boolean ) getMetadata( 120 MetadataDescription.DATA_DEFINITION_CAUSES_TRANSACTION_COMMIT, null, 121 null, false)).booleanValue(); 122 } 123 124 127 public boolean dataDefinitionIgnoredInTransactions() throws SQLException 128 { 129 return ((Boolean ) getMetadata( 130 MetadataDescription.DATA_DEFINITION_IGNORED_IN_TRANSACTIONS, null, 131 null, false)).booleanValue(); 132 } 133 134 137 public boolean deletesAreDetected(int type) throws SQLException 138 { 139 return ((Boolean ) getMetadata(MetadataDescription.DELETES_ARE_DETECTED, 140 new Class []{Integer.TYPE}, new Object []{new Integer (type)}, false)) 141 .booleanValue(); 142 } 143 144 147 public boolean doesMaxRowSizeIncludeBlobs() throws SQLException 148 { 149 return ((Boolean ) getMetadata( 150 MetadataDescription.DOES_MAX_ROW_SIZE_INCLUDE_BLOBS, null, null, false)) 151 .booleanValue(); 152 } 153 154 158 public java.sql.ResultSet getBestRowIdentifier(String catalog, String schema, 159 String table, int scope, boolean nullable) throws SQLException 160 { 161 return connection.getBestRowIdentifier(catalog, schema, table, scope, 162 nullable); 163 } 164 165 168 public java.sql.ResultSet getCatalogs() throws SQLException 169 { 170 return connection.getCatalogs(); 171 } 172 173 176 public String getCatalogSeparator() throws SQLException 177 { 178 return ((String ) getMetadata(MetadataDescription.GET_CATALOG_SEPARATOR, 179 null, null, true)); 180 } 181 182 185 public String getCatalogTerm() throws SQLException 186 { 187 return ((String ) getMetadata(MetadataDescription.GET_CATALOG_TERM, null, 188 null, true)); 189 } 190 191 201 public java.sql.ResultSet getColumns(String catalog, String schemaPattern, 202 String tableNamePattern, String columnNamePattern) throws SQLException 203 { 204 return connection.getColumns(catalog, schemaPattern, tableNamePattern, 205 columnNamePattern); 206 } 207 208 212 public java.sql.ResultSet getColumnPrivileges(String catalog, 213 String schemaPattern, String tableNamePattern, String columnNamePattern) 214 throws SQLException 215 { 216 return connection.getColumnPrivileges(catalog, schemaPattern, 217 tableNamePattern, columnNamePattern); 218 } 219 220 227 public java.sql.Connection getConnection() throws SQLException 228 { 229 return connection; 230 } 231 232 237 public java.sql.ResultSet getCrossReference(String primaryCatalog, 238 String primarySchema, String primaryTable, String foreignCatalog, 239 String foreignSchema, String foreignTable) throws SQLException 240 { 241 return connection.getCrossReference(primaryCatalog, primarySchema, 242 primaryTable, foreignCatalog, foreignSchema, foreignTable); 243 } 244 245 254 public String getDatabaseProductName() throws SQLException 255 { 256 return connection.getDatabaseProductName(); 257 } 258 259 265 public String getDatabaseProductVersion() throws SQLException 266 { 267 return connection.getControllerVersionNumber(); 268 } 269 270 273 public int getDefaultTransactionIsolation() throws SQLException 274 { 275 return ((Integer ) getMetadata( 276 MetadataDescription.GET_DEFAULT_TRANSACTION_ISOLATION, null, null, 277 false)).intValue(); 278 } 279 280 285 public int getDriverMajorVersion() 286 { 287 return Driver.MAJOR_VERSION; 288 } 289 290 295 public int getDriverMinorVersion() 296 { 297 return Driver.MINOR_VERSION; 298 } 299 300 306 public String getDriverName() throws SQLException 307 { 308 return "Sequoia Generic Driver"; 309 } 310 311 317 public String getDriverVersion() throws SQLException 318 { 319 return Constants.VERSION; 320 } 321 322 326 public java.sql.ResultSet getExportedKeys(String catalog, String schema, 327 String table) throws SQLException 328 { 329 return connection.getExportedKeys(catalog, schema, table); 330 } 331 332 335 public String getExtraNameCharacters() throws SQLException 336 { 337 return ((String ) getMetadata(MetadataDescription.GET_EXTRA_NAME_CHARACTERS, 338 null, null, true)); 339 } 340 341 344 public String getIdentifierQuoteString() throws SQLException 345 { 346 return ((String ) getMetadata( 347 MetadataDescription.GET_IDENTIFIER_QUOTE_STRING, null, null, true)); 348 } 349 350 354 public java.sql.ResultSet getImportedKeys(String catalog, String schema, 355 String table) throws SQLException 356 { 357 return connection.getImportedKeys(catalog, schema, table); 358 } 359 360 364 public java.sql.ResultSet getIndexInfo(String catalog, String schema, 365 String table, boolean unique, boolean approximate) throws SQLException 366 { 367 return connection.getIndexInfo(catalog, schema, table, unique, approximate); 368 } 369 370 373 public int getMaxBinaryLiteralLength() throws SQLException 374 { 375 return ((Integer ) getMetadata( 376 MetadataDescription.GET_MAX_BINARY_LITERAL_LENGTH, null, null, false)) 377 .intValue(); 378 379 } 380 381 384 public int getMaxCatalogNameLength() throws SQLException 385 { 386 return ((Integer ) getMetadata( 387 MetadataDescription.GET_MAX_CATALOG_NAME_LENGTH, null, null, false)) 388 .intValue(); 389 } 390 391 394 public int getMaxCharLiteralLength() throws SQLException 395 { 396 return ((Integer ) getMetadata( 397 MetadataDescription.GET_MAX_CHAR_LITERAL_LENGTH, null, null, false)) 398 .intValue(); 399 } 400 401 404 public int getMaxColumnNameLength() throws SQLException 405 { 406 return ((Integer ) getMetadata( 407 MetadataDescription.GET_MAX_COLUMN_NAME_LENGTH, null, null, false)) 408 .intValue(); 409 } 410 411 414 public int getMaxColumnsInGroupBy() throws SQLException 415 { 416 return ((Integer ) getMetadata( 417 MetadataDescription.GET_MAX_COLUMNS_IN_GROUP_BY, null, null, false)) 418 .intValue(); 419 } 420 421 424 public int getMaxColumnsInIndex() throws SQLException 425 { 426 return ((Integer ) getMetadata(MetadataDescription.GET_MAX_COLUMNS_IN_INDEX, 427 null, null, false)).intValue(); 428 } 429 430 433 public int getMaxColumnsInOrderBy() throws SQLException 434 { 435 return ((Integer ) getMetadata( 436 MetadataDescription.GET_MAX_COLUMNS_IN_ORDER_BY, null, null, false)) 437 .intValue(); 438 } 439 440 443 public int getMaxColumnsInSelect() throws SQLException 444 { 445 return ((Integer ) getMetadata( 446 MetadataDescription.GET_MAX_COLUMNS_IN_SELECT, null, null, false)) 447 .intValue(); 448 } 449 450 453 public int getMaxColumnsInTable() throws SQLException 454 { 455 return ((Integer ) getMetadata(MetadataDescription.GET_MAX_COLUMNS_IN_TABLE, 456 null, null, false)).intValue(); 457 } 458 459 467 public int getMaxConnections() throws SQLException 468 { 469 return ((Integer ) getMetadata(MetadataDescription.GET_MAX_CONNECTIONS, 472 null, null, false)).intValue(); 473 } 474 475 478 public int getMaxCursorNameLength() throws SQLException 479 { 480 return ((Integer ) getMetadata( 481 MetadataDescription.GET_MAX_CURSOR_NAME_LENGTH, null, null, false)) 482 .intValue(); 483 } 484 485 488 public int getMaxIndexLength() throws SQLException 489 { 490 return ((Integer ) getMetadata(MetadataDescription.GET_MAX_INDEX_LENGTH, 491 null, null, false)).intValue(); 492 } 493 494 497 public int getMaxProcedureNameLength() throws SQLException 498 { 499 return ((Integer ) getMetadata( 500 MetadataDescription.GET_MAX_PROCEDURE_NAME_LENGTH, null, null, false)) 501 .intValue(); 502 } 503 504 507 public int getMaxRowSize() throws SQLException 508 { 509 return ((Integer ) getMetadata(MetadataDescription.GET_MAX_ROW_SIZE, null, 510 null, false)).intValue(); 511 } 512 513 516 public int getMaxSchemaNameLength() throws SQLException 517 { 518 return ((Integer ) getMetadata( 519 MetadataDescription.GET_MAX_SCHEMA_NAME_LENGTH, null, null, false)) 520 .intValue(); 521 } 522 523 526 public int getMaxStatementLength() throws SQLException 527 { 528 return ((Integer ) getMetadata(MetadataDescription.GET_MAX_STATEMENT_LENGTH, 529 null, null, false)).intValue(); 530 } 531 532 535 public int getMaxStatements() throws SQLException 536 { 537 return ((Integer ) getMetadata(MetadataDescription.GET_MAX_STATEMENTS, null, 538 null, false)).intValue(); 539 } 540 541 544 public int getMaxTableNameLength() throws SQLException 545 { 546 return ((Integer ) getMetadata( 547 MetadataDescription.GET_MAX_TABLE_NAME_LENGTH, null, null, false)) 548 .intValue(); 549 } 550 551 554 public int getMaxTablesInSelect() throws SQLException 555 { 556 return ((Integer ) getMetadata(MetadataDescription.GET_MAX_TABLES_IN_SELECT, 557 null, null, false)).intValue(); 558 } 559 560 563 public int getMaxUserNameLength() throws SQLException 564 { 565 return ((Integer ) getMetadata(MetadataDescription.GET_MAX_USER_NAME_LENGTH, 566 null, null, false)).intValue(); 567 } 568 569 572 public String getNumericFunctions() throws SQLException 573 { 574 return ((String ) getMetadata(MetadataDescription.GET_NUMERIC_FUNCTIONS, 575 null, null, true)); 576 } 577 578 582 public java.sql.ResultSet getPrimaryKeys(String catalog, String schema, 583 String table) throws SQLException 584 { 585 return connection.getPrimaryKeys(catalog, schema, table); 586 } 587 588 592 public java.sql.ResultSet getProcedureColumns(String catalog, 593 String schemaPattern, String procedureNamePattern, 594 String columnNamePattern) throws SQLException 595 { 596 return connection.getProcedureColumns(catalog, schemaPattern, 597 procedureNamePattern, columnNamePattern); 598 } 599 600 604 public java.sql.ResultSet getProcedures(String catalog, String schemaPattern, 605 String procedureNamePattern) throws SQLException 606 { 607 return connection.getProcedures(catalog, schemaPattern, 608 procedureNamePattern); 609 } 610 611 614 public String getProcedureTerm() throws SQLException 615 { 616 return ((String ) getMetadata(MetadataDescription.GET_PROCEDURE_TERM, null, 617 null, true)); 618 } 619 620 623 public java.sql.ResultSet getSchemas() throws SQLException 624 { 625 return connection.getSchemas(); 626 } 627 628 631 public String getSchemaTerm() throws SQLException 632 { 633 return ((String ) getMetadata(MetadataDescription.GET_SCHEMA_TERM, null, 634 null, true)); 635 } 636 637 640 public String getSearchStringEscape() throws SQLException 641 { 642 return ((String ) getMetadata(MetadataDescription.GET_SEARCH_STRING_ESCAPE, 643 null, null, true)); 644 } 645 646 649 public String getSQLKeywords() throws SQLException 650 { 651 return ((String ) getMetadata(MetadataDescription.GET_SQL_KEYWORDS, null, 652 null, true)); 653 } 654 655 658 public String getStringFunctions() throws SQLException 659 { 660 return ((String ) getMetadata(MetadataDescription.GET_STRING_FUNCTIONS, 661 null, null, true)); 662 } 663 664 667 public String getSystemFunctions() throws SQLException 668 { 669 return ((String ) getMetadata(MetadataDescription.GET_SYSTEM_FUNCTIONS, 670 null, null, true)); 671 } 672 673 687 public java.sql.ResultSet getTables(String catalog, String schemaPattern, 688 String tableNamePattern, String [] types) throws SQLException 689 { 690 return connection 691 .getTables(catalog, schemaPattern, tableNamePattern, types); 692 } 693 694 710 public java.sql.ResultSet getTablePrivileges(String catalog, 711 String schemaPattern, String tableNamePattern) throws SQLException 712 { 713 return connection.getTablePrivileges(catalog, schemaPattern, 714 tableNamePattern); 715 } 716 717 725 public java.sql.ResultSet getTableTypes() throws SQLException 726 { 727 return connection.getTableTypes(); 728 } 729 730 733 public String getTimeDateFunctions() throws SQLException 734 { 735 return ((String ) getMetadata(MetadataDescription.GET_TIME_DATE_FUNCTIONS, 736 null, null, true)); 737 } 738 739 742 public java.sql.ResultSet getTypeInfo() throws SQLException 743 { 744 return connection.getTypeInfo(); 745 } 746 747 751 public java.sql.ResultSet getUDTs(String catalog, String schemaPattern, 752 String typeNamePattern, int[] types) throws SQLException 753 { 754 return connection.getUDTs(catalog, schemaPattern, typeNamePattern, types); 755 } 756 757 763 public String getURL() throws SQLException 764 { 765 return connection.getUrl(); 766 } 767 768 774 public String getUserName() throws SQLException 775 { 776 return connection.getUserName(); 777 } 778 779 783 public java.sql.ResultSet getVersionColumns(String catalog, String schema, 784 String table) throws SQLException 785 { 786 return connection.getVersionColumns(catalog, schema, table); 787 } 788 789 792 public boolean insertsAreDetected(int type) throws SQLException 793 { 794 return ((Boolean ) getMetadata(MetadataDescription.INSERTS_ARE_DETECTED, 795 new Class []{Integer.TYPE}, new Object []{new Integer (type)}, false)) 796 .booleanValue(); 797 } 798 799 802 public boolean isCatalogAtStart() throws SQLException 803 { 804 return ((Boolean ) getMetadata(MetadataDescription.IS_CATALOG_AT_START, 805 null, null, false)).booleanValue(); 806 } 807 808 814 public boolean isReadOnly() throws SQLException 815 { 816 return connection.isReadOnly(); 817 } 818 819 822 public boolean nullPlusNonNullIsNull() throws SQLException 823 { 824 return ((Boolean ) getMetadata( 825 MetadataDescription.NULL_PLUS_NON_NULL_IS_NULL, null, null, false)) 826 .booleanValue(); 827 } 828 829 832 public boolean nullsAreSortedAtEnd() throws SQLException 833 { 834 return ((Boolean ) getMetadata(MetadataDescription.NULLS_ARE_SORTED_AT_END, 835 null, null, false)).booleanValue(); 836 } 837 838 841 public boolean nullsAreSortedAtStart() throws SQLException 842 { 843 return ((Boolean ) getMetadata( 844 MetadataDescription.NULLS_ARE_SORTED_AT_START, null, null, false)) 845 .booleanValue(); 846 } 847 848 851 public boolean nullsAreSortedHigh() throws SQLException 852 { 853 return ((Boolean ) getMetadata(MetadataDescription.NULLS_ARE_SORTED_HIGH, 854 null, null, false)).booleanValue(); 855 } 856 857 860 public boolean nullsAreSortedLow() throws SQLException 861 { 862 return ((Boolean ) getMetadata(MetadataDescription.NULLS_ARE_SORTED_LOW, 863 null, null, false)).booleanValue(); 864 } 865 866 869 public boolean othersDeletesAreVisible(int type) throws SQLException 870 { 871 return ((Boolean ) getMetadata( 872 MetadataDescription.OTHERS_DELETES_ARE_VISIBLE, 873 new Class []{Integer.TYPE}, new Object []{new Integer (type)}, false)) 874 .booleanValue(); 875 } 876 877 880 public boolean othersInsertsAreVisible(int type) throws SQLException 881 { 882 return ((Boolean ) getMetadata( 883 MetadataDescription.OTHERS_INSERTS_ARE_VISIBLE, 884 new Class []{Integer.TYPE}, new Object []{new Integer (type)}, false)) 885 .booleanValue(); 886 } 887 888 891 public boolean othersUpdatesAreVisible(int type) throws SQLException 892 { 893 return ((Boolean ) getMetadata( 894 MetadataDescription.OTHERS_UPDATES_ARE_VISIBLE, 895 new Class []{Integer.TYPE}, new Object []{new Integer (type)}, false)) 896 .booleanValue(); 897 } 898 899 902 public boolean ownDeletesAreVisible(int type) throws SQLException 903 { 904 return ((Boolean ) getMetadata(MetadataDescription.OWN_DELETES_ARE_VISIBLE, 905 new Class []{Integer.TYPE}, new Object []{new Integer (type)}, false)) 906 .booleanValue(); 907 } 908 909 912 public boolean ownInsertsAreVisible(int type) throws SQLException 913 { 914 return ((Boolean ) getMetadata(MetadataDescription.OWN_INSERTS_ARE_VISIBLE, 915 new Class []{Integer.TYPE}, new Object []{new Integer (type)}, false)) 916 .booleanValue(); 917 918 } 919 920 923 public boolean ownUpdatesAreVisible(int type) throws SQLException 924 { 925 return ((Boolean ) getMetadata(MetadataDescription.OWN_UPDATES_ARE_VISIBLE, 926 new Class []{Integer.TYPE}, new Object []{new Integer (type)}, false)) 927 .booleanValue(); 928 } 929 930 933 public boolean storesLowerCaseIdentifiers() throws SQLException 934 { 935 return ((Boolean ) getMetadata( 936 MetadataDescription.STORES_LOWER_CASE_IDENTIFIERS, null, null, false)) 937 .booleanValue(); 938 } 939 940 943 public boolean storesLowerCaseQuotedIdentifiers() throws SQLException 944 { 945 return ((Boolean ) getMetadata( 946 MetadataDescription.STORES_LOWER_CASE_QUOTED_IDENTIFIERS, null, null, 947 false)).booleanValue(); 948 } 949 950 953 public boolean storesMixedCaseIdentifiers() throws SQLException 954 { 955 return ((Boolean ) getMetadata( 956 MetadataDescription.STORES_MIXED_CASE_IDENTIFIERS, null, null, false)) 957 .booleanValue(); 958 } 959 960 963 public boolean storesMixedCaseQuotedIdentifiers() throws SQLException 964 { 965 return ((Boolean ) getMetadata( 966 MetadataDescription.STORES_MIXED_CASE_QUOTED_IDENTIFIERS, null, null, 967 false)).booleanValue(); 968 } 969 970 973 public boolean storesUpperCaseIdentifiers() throws SQLException 974 { 975 return ((Boolean ) getMetadata( 976 MetadataDescription.STORES_UPPER_CASE_IDENTIFIERS, null, null, false)) 977 .booleanValue(); 978 } 979 980 983 public boolean storesUpperCaseQuotedIdentifiers() throws SQLException 984 { 985 return ((Boolean ) getMetadata( 986 MetadataDescription.STORES_UPPER_CASE_QUOTED_IDENTIFIERS, null, null, 987 false)).booleanValue(); 988 } 989 990 993 public boolean supportsAlterTableWithAddColumn() throws SQLException 994 { 995 return ((Boolean ) getMetadata( 996 MetadataDescription.SUPPORTS_ALTER_TABLE_WITH_ADD_COLUMN, null, null, 997 false)).booleanValue(); 998 } 999 1000 1003 public boolean supportsAlterTableWithDropColumn() throws SQLException 1004 { 1005 return ((Boolean ) getMetadata( 1006 MetadataDescription.SUPPORTS_ALTER_TABLE_WITH_DROP_COLUMN, null, null, 1007 false)).booleanValue(); 1008 } 1009 1010 1013 public boolean supportsANSI92EntryLevelSQL() throws SQLException 1014 { 1015 return ((Boolean ) getMetadata( 1016 MetadataDescription.SUPPORTS_ANSI92_ENTRY_LEVEL_SQL, null, null, false)) 1017 .booleanValue(); 1018 } 1019 1020 1023 public boolean supportsANSI92FullSQL() throws SQLException 1024 { 1025 return ((Boolean ) getMetadata(MetadataDescription.SUPPORTS_ANSI92_FULL_SQL, 1026 null, null, false)).booleanValue(); 1027 } 1028 1029 1032 public boolean supportsANSI92IntermediateSQL() throws SQLException 1033 { 1034 return ((Boolean ) getMetadata( 1035 MetadataDescription.SUPPORTS_ANSI92_INTERMEDIATE_SQL, null, null, false)) 1036 .booleanValue(); 1037 } 1038 1039 1042 public boolean supportsBatchUpdates() throws SQLException 1043 { 1044 return ((Boolean ) getMetadata(MetadataDescription.SUPPORTS_BATCH_UPDATES, 1045 null, null, false)).booleanValue(); 1046 } 1047 1048 1051 public boolean supportsCatalogsInDataManipulation() throws SQLException 1052 { 1053 return ((Boolean ) getMetadata( 1054 MetadataDescription.SUPPORTS_CATALOGS_IN_DATA_MANIPULATION, null, null, 1055 false)).booleanValue(); 1056 } 1057 1058 1061 public boolean supportsCatalogsInIndexDefinitions() throws SQLException 1062 { 1063 return ((Boolean ) getMetadata( 1064 MetadataDescription.SUPPORTS_CATALOGS_IN_INDEX_DEFINITIONS, null, null, 1065 false)).booleanValue(); 1066 } 1067 1068 1071 public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException 1072 { 1073 return ((Boolean ) getMetadata( 1074 MetadataDescription.SUPPORTS_CATALOGS_IN_PRIVILEGE_DEFINITIONS, null, 1075 null, false)).booleanValue(); 1076 } 1077 1078 1081 public boolean supportsCatalogsInProcedureCalls() throws SQLException 1082 { 1083 return ((Boolean ) getMetadata( 1084 MetadataDescription.SUPPORTS_CATALOGS_IN_PROCEDURE_CALLS, null, null, 1085 false)).booleanValue(); 1086 } 1087 1088 1091 public boolean supportsCatalogsInTableDefinitions() throws SQLException 1092 { 1093 return ((Boolean ) getMetadata( 1094 MetadataDescription.SUPPORTS_CATALOGS_IN_TABLE_DEFINITIONS, null, null, 1095 false)).booleanValue(); 1096 } 1097 1098 1101 public boolean supportsColumnAliasing() throws SQLException 1102 { 1103 return ((Boolean ) getMetadata(MetadataDescription.SUPPORTS_COLUMN_ALIASING, 1104 null, null, false)).booleanValue(); 1105 } 1106 1107 1110 public boolean supportsConvert() throws SQLException 1111 { 1112 return ((Boolean ) getMetadata(MetadataDescription.SUPPORTS_CONVERT, null, 1113 null, false)).booleanValue(); 1114 } 1115 1116 1125 public boolean supportsConvert(int fromType, int toType) throws SQLException 1126 { 1127 return false; 1128 } 1129 1130 1133 public boolean supportsCoreSQLGrammar() throws SQLException 1134 { 1135 return ((Boolean ) getMetadata( 1136 MetadataDescription.SUPPORTS_CORE_SQL_GRAMMAR, null, null, false)) 1137 .booleanValue(); 1138 } 1139 1140 1143 public boolean supportsCorrelatedSubqueries() throws SQLException 1144 { 1145 return ((Boolean ) getMetadata( 1146 MetadataDescription.SUPPORTS_CORRELATED_SUBQUERIES, null, null, false)) 1147 .booleanValue(); 1148 } 1149 1150 1153 public boolean supportsDataDefinitionAndDataManipulationTransactions() 1154 throws SQLException 1155 { 1156 return ((Boolean ) getMetadata( 1157 MetadataDescription.SUPPORTS_DATA_DEFINITION_AND_DATA_MANIPULATION_TRANSACTIONS, 1158 null, null, false)).booleanValue(); 1159 } 1160 1161 1164 public boolean supportsDataManipulationTransactionsOnly() throws SQLException 1165 { 1166 return ((Boolean ) getMetadata( 1167 MetadataDescription.SUPPORTS_DATA_MANIPULATION_TRANSACTIONS_ONLY, null, 1168 null, false)).booleanValue(); 1169 } 1170 1171 1174 public boolean supportsDifferentTableCorrelationNames() throws SQLException 1175 { 1176 return ((Boolean ) getMetadata( 1177 MetadataDescription.SUPPORTS_DIFFERENT_TABLE_CORRELATION_NAMES, null, 1178 null, false)).booleanValue(); 1179 } 1180 1181 1184 public boolean supportsExpressionsInOrderBy() throws SQLException 1185 { 1186 return ((Boolean ) getMetadata( 1187 MetadataDescription.SUPPORTS_EXPRESSIONS_IN_ORDER_BY, null, null, false)) 1188 .booleanValue(); 1189 } 1190 1191 1194 public boolean supportsExtendedSQLGrammar() throws SQLException 1195 { 1196 return ((Boolean ) getMetadata( 1197 MetadataDescription.SUPPORTS_EXTENDED_SQL_GRAMMAR, null, null, false)) 1198 .booleanValue(); 1199 } 1200 1201 1204 public boolean supportsFullOuterJoins() throws SQLException 1205 { 1206 return ((Boolean ) getMetadata( 1207 MetadataDescription.SUPPORTS_FULL_OUTER_JOINS, null, null, false)) 1208 .booleanValue(); 1209 } 1210 1211 1214 public boolean supportsGroupBy() throws SQLException 1215 { 1216 return ((Boolean ) getMetadata(MetadataDescription.SUPPORTS_GROUP_BY, null, 1217 null, false)).booleanValue(); 1218 } 1219 1220 1223 public boolean supportsGroupByBeyondSelect() throws SQLException 1224 { 1225 return ((Boolean ) getMetadata( 1226 MetadataDescription.SUPPORTS_GROUP_BY_BEYOND_SELECT, null, null, false)) 1227 .booleanValue(); 1228 } 1229 1230 1233 public boolean supportsGroupByUnrelated() throws SQLException 1234 { 1235 return ((Boolean ) getMetadata( 1236 MetadataDescription.SUPPORTS_GROUP_BY_UNRELATED, null, null, false)) 1237 .booleanValue(); 1238 } 1239 1240 1243 public boolean supportsIntegrityEnhancementFacility() throws SQLException 1244 { 1245 return ((Boolean ) getMetadata( 1246 MetadataDescription.SUPPORTS_INTEGRITY_ENHANCEMENT_FACILITY, null, 1247 null, false)).booleanValue(); 1248 } 1249 1250 1253 public boolean supportsLikeEscapeClause() throws SQLException 1254 { 1255 return ((Boolean ) getMetadata( 1256 MetadataDescription.SUPPORTS_LIKE_ESCAPE_CLAUSE, null, null, false)) 1257 .booleanValue(); 1258 } 1259 1260 1263 public boolean supportsLimitedOuterJoins() throws SQLException 1264 { 1265 return ((Boolean ) getMetadata( 1266 MetadataDescription.SUPPORTS_LIMITED_OUTER_JOINS, null, null, false)) 1267 .booleanValue(); 1268 } 1269 1270 1273 public boolean supportsMinimumSQLGrammar() throws SQLException 1274 { 1275 return ((Boolean ) getMetadata( 1276 MetadataDescription.SUPPORTS_MINIMUM_SQL_GRAMMAR, null, null, false)) 1277 .booleanValue(); 1278 } 1279 1280 1283 public boolean supportsMixedCaseIdentifiers() throws SQLException 1284 { 1285 return ((Boolean ) getMetadata( 1286 MetadataDescription.SUPPORTS_MIXED_CASE_IDENTIFIERS, null, null, false)) 1287 .booleanValue(); 1288 } 1289 1290 1293 public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException 1294 { 1295 return ((Boolean ) getMetadata( 1296 MetadataDescription.SUPPORTS_MIXED_CASE_QUOTED_IDENTIFIERS, null, null, 1297 false)).booleanValue(); 1298 } 1299 1300 1303 public boolean supportsMultipleResultSets() throws SQLException 1304 { 1305 return ((Boolean ) getMetadata( 1306 MetadataDescription.SUPPORTS_MULTIPLE_RESULTSETS, null, null, false)) 1307 .booleanValue(); 1308 } 1309 1310 1313 public boolean supportsMultipleTransactions() throws SQLException 1314 { 1315 return ((Boolean ) getMetadata( 1316 MetadataDescription.SUPPORTS_MULTIPLE_TRANSACTIONS, null, null, false)) 1317 .booleanValue(); 1318 } 1319 1320 1323 public boolean supportsNonNullableColumns() throws SQLException 1324 { 1325 return ((Boolean ) getMetadata( 1326 MetadataDescription.SUPPORTS_NON_NULLABLE_COLUMNS, null, null, false)) 1327 .booleanValue(); 1328 } 1329 1330 1333 public boolean supportsOpenCursorsAcrossCommit() throws SQLException 1334 { 1335 return ((Boolean ) getMetadata( 1336 MetadataDescription.SUPPORTS_OPEN_CURSORS_ACROSS_COMMIT, null, null, 1337 false)).booleanValue(); 1338 } 1339 1340 1343 public boolean supportsOpenCursorsAcrossRollback() throws SQLException 1344 { 1345 return ((Boolean ) getMetadata( 1346 MetadataDescription.SUPPORTS_OPEN_CURSORS_ACROSS_ROLLBACK, null, null, 1347 false)).booleanValue(); 1348 } 1349 1350 1353 public boolean supportsOpenStatementsAcrossCommit() throws SQLException 1354 { 1355 return ((Boolean ) getMetadata( 1356 MetadataDescription.SUPPORTS_OPEN_STATEMENTS_ACROSS_COMMIT, null, null, 1357 false)).booleanValue(); 1358 } 1359 1360 1363 public boolean supportsOpenStatementsAcrossRollback() throws SQLException 1364 { 1365 return ((Boolean ) getMetadata( 1366 MetadataDescription.SUPPORTS_OPEN_STATEMENTS_ACROSS_ROLLBACK, null, 1367 null, false)).booleanValue(); 1368 } 1369 1370 1373 public boolean supportsOrderByUnrelated() throws SQLException 1374 { 1375 return ((Boolean ) getMetadata( 1376 MetadataDescription.SUPPORTS_ORDER_BY_UNRELATED, null, null, false)) 1377 .booleanValue(); 1378 } 1379 1380 1383 public boolean supportsOuterJoins() throws SQLException 1384 { 1385 return ((Boolean ) getMetadata(MetadataDescription.SUPPORTS_OUTER_JOINS, 1386 null, null, false)).booleanValue(); 1387 } 1388 1389 1392 public boolean supportsPositionedDelete() throws SQLException 1393 { 1394 return ((Boolean ) getMetadata( 1395 MetadataDescription.SUPPORTS_POSITIONED_DELETE, null, null, false)) 1396 .booleanValue(); 1397 } 1398 1399 1402 public boolean supportsPositionedUpdate() throws SQLException 1403 { 1404 return ((Boolean ) getMetadata( 1405 MetadataDescription.SUPPORTS_POSITIONED_UPDATE, null, null, false)) 1406 .booleanValue(); 1407 } 1408 1409 1412 public boolean supportsResultSetConcurrency(int type, int concurrency) 1413 throws SQLException 1414 { 1415 return ((Boolean ) getMetadata( 1416 MetadataDescription.SUPPORTS_RESULT_SET_CONCURRENCY, new Class []{ 1417 Integer.TYPE, Integer.TYPE}, new Object []{new Integer (type), 1418 new Integer (concurrency)}, false)).booleanValue(); 1419 } 1420 1421 1424 public boolean supportsResultSetHoldability(int holdability) 1425 throws SQLException 1426 { 1427 return ((Boolean ) getMetadata( 1428 MetadataDescription.SUPPORTS_RESULT_SET_HOLDABILITY, 1429 new Class []{Integer.TYPE}, new Object []{new Integer (holdability)}, 1430 false)).booleanValue(); 1431 } 1432 1433 1436 public boolean supportsResultSetType(int type) throws SQLException 1437 { 1438 return ((Boolean ) getMetadata(MetadataDescription.SUPPORTS_RESULT_SET_TYPE, 1439 new Class []{Integer.TYPE}, new Object []{new Integer (type)}, false)) 1440 .booleanValue(); 1441 } 1442 1443 1446 public boolean supportsSchemasInDataManipulation() throws SQLException 1447 { 1448 return ((Boolean ) getMetadata( 1449 MetadataDescription.SUPPORTS_SCHEMAS_IN_DATA_MANIPULATION, null, null, 1450 false)).booleanValue(); 1451 } 1452 1453 1456 public boolean supportsSchemasInIndexDefinitions() throws SQLException 1457 { 1458 return ((Boolean ) getMetadata( 1459 MetadataDescription.SUPPORTS_SCHEMAS_IN_INDEX_DEFINITIONS, null, null, 1460 false)).booleanValue(); 1461 } 1462 1463 1466 public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException 1467 { 1468 return ((Boolean ) getMetadata( 1469 MetadataDescription.SUPPORTS_SCHEMAS_IN_PRIVILEGE_DEFINITIONS, null, 1470 null, false)).booleanValue(); 1471 } 1472 1473 1476 public boolean supportsSchemasInProcedureCalls() throws SQLException 1477 { 1478 return ((Boolean ) getMetadata( 1479 MetadataDescription.SUPPORTS_SCHEMAS_IN_PROCEDURE_CALLS, null, null, 1480 false)).booleanValue(); 1481 } 1482 1483 1486 public boolean supportsSchemasInTableDefinitions() throws SQLException 1487 { 1488 return ((Boolean ) getMetadata( 1489 MetadataDescription.SUPPORTS_SCHEMAS_IN_TABLE_DEFINITIONS, null, null, 1490 false)).booleanValue(); 1491 } 1492 1493 1496 public boolean supportsSelectForUpdate() throws SQLException 1497 { 1498 return ((Boolean ) getMetadata( 1499 MetadataDescription.SUPPORTS_SELECT_FOR_UPDATE, null, null, false)) 1500 .booleanValue(); 1501 } 1502 1503 1506 public boolean supportsStoredProcedures() throws SQLException 1507 { 1508 return ((Boolean ) getMetadata( 1509 MetadataDescription.SUPPORTS_STORED_PROCEDURES, null, null, false)) 1510 .booleanValue(); 1511 } 1512 1513 1516 public boolean supportsSubqueriesInComparisons() throws SQLException 1517 { 1518 return ((Boolean ) getMetadata( 1519 MetadataDescription.SUPPORTS_SUB_QUERIES_IN_COMPARISONS, null, null, 1520 false)).booleanValue(); 1521 } 1522 1523 1526 public boolean supportsSubqueriesInExists() throws SQLException 1527 { 1528 return ((Boolean ) getMetadata( 1529 MetadataDescription.SUPPORTS_SUB_QUERIES_IN_EXISTS, null, null, false)) 1530 .booleanValue(); 1531 } 1532 1533 1536 public boolean supportsSubqueriesInIns() throws SQLException 1537 { 1538 return ((Boolean ) getMetadata( 1539 MetadataDescription.SUPPORTS_SUB_QUERIES_IN_INS, null, null, false)) 1540 .booleanValue(); 1541 } 1542 1543 1546 public boolean supportsSubqueriesInQuantifieds() throws SQLException 1547 { 1548 return ((Boolean ) getMetadata( 1549 MetadataDescription.SUPPORTS_SUB_QUERIES_IN_QUANTIFIEDS, null, null, 1550 false)).booleanValue(); 1551 } 1552 1553 1556 public boolean supportsTableCorrelationNames() throws SQLException 1557 { 1558 return ((Boolean ) getMetadata( 1559 MetadataDescription.SUPPORTS_TABLE_CORRELATION_NAMES, null, null, false)) 1560 .booleanValue(); 1561 } 1562 1563 1566 public boolean supportsTransactionIsolationLevel(int level) 1567 throws SQLException 1568 { 1569 return ((Boolean ) getMetadata( 1570 MetadataDescription.SUPPORTS_TRANSACTION_ISOLATION_LEVEL, 1571 new Class []{Integer.TYPE}, new Object []{new Integer (level)}, false)) 1572 .booleanValue(); 1573 } 1574 1575 1578 public boolean supportsTransactions() throws SQLException 1579 { 1580 return ((Boolean ) getMetadata(MetadataDescription.SUPPORTS_TRANSACTIONS, 1581 null, null, false)).booleanValue(); 1582 } 1583 1584 1587 public boolean supportsUnion() throws SQLException 1588 { 1589 return ((Boolean ) getMetadata(MetadataDescription.SUPPORTS_UNION, null, 1590 null, false)).booleanValue(); 1591 } 1592 1593 1596 public boolean supportsUnionAll() throws SQLException 1597 { 1598 return ((Boolean ) getMetadata(MetadataDescription.SUPPORTS_UNION_ALL, null, 1599 null, false)).booleanValue(); 1600 } 1601 1602 1605 public boolean updatesAreDetected(int type) throws SQLException 1606 { 1607 return ((Boolean ) getMetadata(MetadataDescription.UPDATES_ARE_DETECTED, 1608 new Class []{Integer.TYPE}, new Object []{new Integer (type)}, false)) 1609 .booleanValue(); 1610 } 1611 1612 1615 public boolean usesLocalFilePerTable() throws SQLException 1616 { 1617 return ((Boolean ) getMetadata( 1618 MetadataDescription.USES_LOCAL_FILE_PER_TABLE, null, null, false)) 1619 .booleanValue(); 1620 } 1621 1622 1625 public boolean usesLocalFiles() throws SQLException 1626 { 1627 return ((Boolean ) getMetadata(MetadataDescription.USES_LOCAL_FILES, null, 1628 null, false)).booleanValue(); 1629 } 1630 1631 1633 1636 public boolean supportsSavepoints() throws SQLException 1637 { 1638 return ((Boolean ) getMetadata(MetadataDescription.SUPPORTS_SAVEPOINTS, 1639 null, null, false)).booleanValue(); 1640 } 1641 1642 1645 public boolean supportsNamedParameters() throws SQLException 1646 { 1647 return ((Boolean ) getMetadata( 1648 MetadataDescription.SUPPORTS_NAMED_PARAMETERS, null, null, false)) 1649 .booleanValue(); 1650 } 1651 1652 1655 public boolean supportsMultipleOpenResults() throws SQLException 1656 { 1657 return ((Boolean ) getMetadata( 1658 MetadataDescription.SUPPORTS_MULTIPLE_OPEN_RESULTS, null, null, false)) 1659 .booleanValue(); 1660 } 1661 1662 1665 public boolean supportsGetGeneratedKeys() throws SQLException 1666 { 1667 return ((Boolean ) getMetadata( 1668 MetadataDescription.SUPPORTS_GET_GENERATED_KEYS, null, null, false)) 1669 .booleanValue(); 1670 } 1671 1672 1676 public java.sql.ResultSet getSuperTypes(String catalog, String schemaPattern, 1677 String typeNamePattern) throws SQLException 1678 { 1679 return connection.getSuperTypes(catalog, schemaPattern, typeNamePattern); 1680 } 1681 1682 1686 public java.sql.ResultSet getSuperTables(String catalog, 1687 String schemaPattern, String tableNamePattern) throws SQLException 1688 { 1689 return connection.getSuperTables(catalog, schemaPattern, tableNamePattern); 1690 } 1691 1692 1696 public java.sql.ResultSet getAttributes(String catalog, String schemaPattern, 1697 String typeNamePattern, String attributeNamePattern) throws SQLException 1698 { 1699 return connection.getAttributes(catalog, schemaPattern, typeNamePattern, 1700 attributeNamePattern); 1701 } 1702 1703 1706 public int getResultSetHoldability() throws SQLException 1707 { 1708 return ((Integer ) getMetadata( 1709 MetadataDescription.GET_RESULTSET_HOLDABILITY, null, null, false)) 1710 .intValue(); 1711 } 1712 1713 1716 public int getDatabaseMajorVersion() throws SQLException 1717 { 1718 return ((Integer ) getMetadata( 1719 MetadataDescription.GET_DATABASE_MAJOR_VERSION, null, null, false)) 1720 .intValue(); 1721 } 1722 1723 1726 public int getDatabaseMinorVersion() throws SQLException 1727 { 1728 return ((Integer ) getMetadata( 1729 MetadataDescription.GET_DATABASE_MINOR_VERSION, null, null, false)) 1730 .intValue(); 1731 } 1732 1733 1740 public int getJDBCMajorVersion() throws SQLException 1741 { 1742 return Driver.MAJOR_VERSION; 1743 } 1744 1745 1752 public int getJDBCMinorVersion() throws SQLException 1753 { 1754 return Driver.MINOR_VERSION; 1755 } 1756 1757 1760 public int getSQLStateType() throws SQLException 1761 { 1762 return ((Integer ) getMetadata(MetadataDescription.GET_SQL_STATE_TYPE, null, 1763 null, false)).intValue(); 1764 } 1765 1766 1769 public boolean locatorsUpdateCopy() throws SQLException 1770 { 1771 return ((Boolean ) getMetadata(MetadataDescription.LOCATORS_UPDATE_COPY, 1772 null, null, false)).booleanValue(); 1773 } 1774 1775 1778 public boolean supportsStatementPooling() throws SQLException 1779 { 1780 return ((Boolean ) getMetadata( 1781 MetadataDescription.SUPPORTS_STATEMENT_POOLING, null, null, false)) 1782 .booleanValue(); 1783 } 1784} | Popular Tags |