00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 package org.objectweb.cjdbc.driver;
00026
00027 import java.sql.SQLException;
00028 import java.util.HashMap;
00029
00030 import org.objectweb.cjdbc.common.sql.NotImplementedException;
00031 import org.objectweb.cjdbc.common.sql.metadata.MetadataContainer;
00032 import org.objectweb.cjdbc.common.sql.metadata.MetadataDescription;
00033 import org.objectweb.cjdbc.common.util.Constants;
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 public class DatabaseMetaData implements java.sql.DatabaseMetaData
00046 {
00047
00048 private Connection connection;
00049
00050
00051
00052
00053 private HashMap metadataContainer;
00054
00055
00056
00057
00058
00059
00060 public DatabaseMetaData(Connection conn)
00061 {
00062 this.connection = conn;
00063 metadataContainer = new HashMap();
00064 }
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078 private Object getMetadata(String methodName, Class[] parametersType,
00079 Object[] arguments, boolean allowsNull) throws SQLException
00080 {
00081 String key = MetadataContainer.getContainerKey(methodName,
00082 parametersType, arguments);
00083 Object value = metadataContainer.get(key);
00084
00085 if (value == null)
00086 {
00087 value = connection.getStaticMetadata(key);
00088 if ((value == null) && !allowsNull)
00089 throw new SQLException("Unable to retrieve metadata for " + key);
00090 metadataContainer.put(key, value);
00091 }
00092 return value;
00093 }
00094
00095
00096
00097
00098 public boolean allProceduresAreCallable() throws SQLException
00099 {
00100 return ((Boolean) getMetadata(
00101 MetadataDescription.ALL_PROCEDURES_ARE_CALLABLE, null, null, false))
00102 .booleanValue();
00103 }
00104
00105
00106
00107
00108 public boolean allTablesAreSelectable() throws SQLException
00109 {
00110 return ((Boolean) getMetadata(
00111 MetadataDescription.ALL_TABLES_ARE_SELECTABLE, null, null, false))
00112 .booleanValue();
00113 }
00114
00115
00116
00117
00118 public boolean dataDefinitionCausesTransactionCommit() throws SQLException
00119 {
00120 return ((Boolean) getMetadata(
00121 MetadataDescription.DATA_DEFINITION_CAUSES_TRANSACTION_COMMIT, null,
00122 null, false)).booleanValue();
00123 }
00124
00125
00126
00127
00128 public boolean dataDefinitionIgnoredInTransactions() throws SQLException
00129 {
00130 return ((Boolean) getMetadata(
00131 MetadataDescription.DATA_DEFINITION_IGNORED_IN_TRANSACTIONS, null,
00132 null, false)).booleanValue();
00133 }
00134
00135
00136
00137
00138 public boolean deletesAreDetected(int type) throws SQLException
00139 {
00140 return ((Boolean) getMetadata(MetadataDescription.DELETES_ARE_DETECTED,
00141 new Class[]{Integer.TYPE}, new Object[]{new Integer(type)}, false))
00142 .booleanValue();
00143 }
00144
00145
00146
00147
00148 public boolean doesMaxRowSizeIncludeBlobs() throws SQLException
00149 {
00150 return ((Boolean) getMetadata(
00151 MetadataDescription.DOES_MAX_ROW_SIZE_INCLUDE_BLOBS, null, null, false))
00152 .booleanValue();
00153 }
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168 public java.sql.ResultSet getBestRowIdentifier(String catalog, String schema,
00169 String table, int scope, boolean nullable) throws SQLException
00170 {
00171 return null;
00172 }
00173
00174
00175
00176
00177 public java.sql.ResultSet getCatalogs() throws SQLException
00178 {
00179 return connection.getCatalogs();
00180 }
00181
00182
00183
00184
00185 public String getCatalogSeparator() throws SQLException
00186 {
00187 return ((String) getMetadata(MetadataDescription.GET_CATALOG_SEPARATOR,
00188 null, null, true));
00189 }
00190
00191
00192
00193
00194 public String getCatalogTerm() throws SQLException
00195 {
00196 return ((String) getMetadata(MetadataDescription.GET_CATALOG_TERM, null,
00197 null, true));
00198 }
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210 public java.sql.ResultSet getColumns(String catalog, String schemaPattern,
00211 String tableNamePattern, String columnNamePattern) throws SQLException
00212 {
00213 return connection.getColumns(catalog, schemaPattern, tableNamePattern,
00214 columnNamePattern);
00215 }
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229 public java.sql.ResultSet getColumnPrivileges(String catalog,
00230 String schemaPattern, String tableNamePattern, String columnNamePattern)
00231 throws SQLException
00232 {
00233 return null;
00234 }
00235
00236
00237
00238
00239
00240
00241
00242
00243 public java.sql.Connection getConnection() throws SQLException
00244 {
00245 return connection;
00246 }
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261 public java.sql.ResultSet getCrossReference(String primaryCatalog,
00262 String primarySchema, String primaryTable, String foreignCatalog,
00263 String foreignSchema, String foreignTable) throws SQLException
00264 {
00265 return null;
00266 }
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277 public String getDatabaseProductName() throws SQLException
00278 {
00279 return connection.getDatabaseProductName();
00280 }
00281
00282
00283
00284
00285
00286
00287
00288 public String getDatabaseProductVersion() throws SQLException
00289 {
00290 return connection.getControllerVersionNumber();
00291 }
00292
00293
00294
00295
00296 public int getDefaultTransactionIsolation() throws SQLException
00297 {
00298 return ((Integer) getMetadata(
00299 MetadataDescription.GET_DEFAULT_TRANSACTION_ISOLATION, null, null,
00300 false)).intValue();
00301 }
00302
00303
00304
00305
00306
00307
00308 public int getDriverMajorVersion()
00309 {
00310 return Driver.MAJOR_VERSION;
00311 }
00312
00313
00314
00315
00316
00317
00318 public int getDriverMinorVersion()
00319 {
00320 return Driver.MINOR_VERSION;
00321 }
00322
00323
00324
00325
00326
00327
00328
00329 public String getDriverName() throws SQLException
00330 {
00331 return "C-JDBC Generic Driver";
00332 }
00333
00334
00335
00336
00337
00338
00339
00340 public String getDriverVersion() throws SQLException
00341 {
00342 return Constants.VERSION;
00343 }
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355 public java.sql.ResultSet getExportedKeys(String catalog, String schema,
00356 String table) throws SQLException
00357 {
00358 return null;
00359 }
00360
00361
00362
00363
00364 public String getExtraNameCharacters() throws SQLException
00365 {
00366 return ((String) getMetadata(MetadataDescription.GET_EXTRA_NAME_CHARACTERS,
00367 null, null, true));
00368 }
00369
00370
00371
00372
00373 public String getIdentifierQuoteString() throws SQLException
00374 {
00375 return ((String) getMetadata(
00376 MetadataDescription.GET_IDENTIFIER_QUOTE_STRING, null, null, true));
00377 }
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389 public java.sql.ResultSet getImportedKeys(String catalog, String schema,
00390 String table) throws SQLException
00391 {
00392 return null;
00393 }
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410 public java.sql.ResultSet getIndexInfo(String catalog, String schema,
00411 String table, boolean unique, boolean approximate) throws SQLException
00412 {
00413 return new DriverResultSet(new Field[0], null);
00414 }
00415
00416
00417
00418
00419 public int getMaxBinaryLiteralLength() throws SQLException
00420 {
00421 return ((Integer) getMetadata(
00422 MetadataDescription.GET_MAX_BINARY_LITERAL_LENGTH, null, null, false))
00423 .intValue();
00424
00425 }
00426
00427
00428
00429
00430 public int getMaxCatalogNameLength() throws SQLException
00431 {
00432 return ((Integer) getMetadata(
00433 MetadataDescription.GET_MAX_CATALOG_NAME_LENGTH, null, null, false))
00434 .intValue();
00435 }
00436
00437
00438
00439
00440 public int getMaxCharLiteralLength() throws SQLException
00441 {
00442 return ((Integer) getMetadata(
00443 MetadataDescription.GET_MAX_CHAR_LITERAL_LENGTH, null, null, false))
00444 .intValue();
00445 }
00446
00447
00448
00449
00450 public int getMaxColumnNameLength() throws SQLException
00451 {
00452 return ((Integer) getMetadata(
00453 MetadataDescription.GET_MAX_COLUMN_NAME_LENGTH, null, null, false))
00454 .intValue();
00455 }
00456
00457
00458
00459
00460 public int getMaxColumnsInGroupBy() throws SQLException
00461 {
00462 return ((Integer) getMetadata(
00463 MetadataDescription.GET_MAX_COLUMNS_IN_GROUP_BY, null, null, false))
00464 .intValue();
00465 }
00466
00467
00468
00469
00470 public int getMaxColumnsInIndex() throws SQLException
00471 {
00472 return ((Integer) getMetadata(MetadataDescription.GET_MAX_COLUMNS_IN_INDEX,
00473 null, null, false)).intValue();
00474 }
00475
00476
00477
00478
00479 public int getMaxColumnsInOrderBy() throws SQLException
00480 {
00481 return ((Integer) getMetadata(
00482 MetadataDescription.GET_MAX_COLUMNS_IN_ORDER_BY, null, null, false))
00483 .intValue();
00484 }
00485
00486
00487
00488
00489 public int getMaxColumnsInSelect() throws SQLException
00490 {
00491 return ((Integer) getMetadata(
00492 MetadataDescription.GET_MAX_COLUMNS_IN_SELECT, null, null, false))
00493 .intValue();
00494 }
00495
00496
00497
00498
00499 public int getMaxColumnsInTable() throws SQLException
00500 {
00501 return ((Integer) getMetadata(MetadataDescription.GET_MAX_COLUMNS_IN_TABLE,
00502 null, null, false)).intValue();
00503 }
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513 public int getMaxConnections() throws SQLException
00514 {
00515
00516
00517 return ((Integer) getMetadata(MetadataDescription.GET_MAX_CONNECTIONS,
00518 null, null, false)).intValue();
00519 }
00520
00521
00522
00523
00524 public int getMaxCursorNameLength() throws SQLException
00525 {
00526 return ((Integer) getMetadata(
00527 MetadataDescription.GET_MAX_CURSOR_NAME_LENGTH, null, null, false))
00528 .intValue();
00529 }
00530
00531
00532
00533
00534 public int getMaxIndexLength() throws SQLException
00535 {
00536 return ((Integer) getMetadata(MetadataDescription.GET_MAX_INDEX_LENGTH,
00537 null, null, false)).intValue();
00538 }
00539
00540
00541
00542
00543 public int getMaxProcedureNameLength() throws SQLException
00544 {
00545 return ((Integer) getMetadata(
00546 MetadataDescription.GET_MAX_PROCEDURE_NAME_LENGTH, null, null, false))
00547 .intValue();
00548 }
00549
00550
00551
00552
00553 public int getMaxRowSize() throws SQLException
00554 {
00555 return ((Integer) getMetadata(MetadataDescription.GET_MAX_ROW_SIZE, null,
00556 null, false)).intValue();
00557 }
00558
00559
00560
00561
00562 public int getMaxSchemaNameLength() throws SQLException
00563 {
00564 return ((Integer) getMetadata(
00565 MetadataDescription.GET_MAX_SCHEMA_NAME_LENGTH, null, null, false))
00566 .intValue();
00567 }
00568
00569
00570
00571
00572 public int getMaxStatementLength() throws SQLException
00573 {
00574 return ((Integer) getMetadata(MetadataDescription.GET_MAX_STATEMENT_LENGTH,
00575 null, null, false)).intValue();
00576 }
00577
00578
00579
00580
00581 public int getMaxStatements() throws SQLException
00582 {
00583 return ((Integer) getMetadata(MetadataDescription.GET_MAX_STATEMENTS, null,
00584 null, false)).intValue();
00585 }
00586
00587
00588
00589
00590 public int getMaxTableNameLength() throws SQLException
00591 {
00592 return ((Integer) getMetadata(
00593 MetadataDescription.GET_MAX_TABLE_NAME_LENGTH, null, null, false))
00594 .intValue();
00595 }
00596
00597
00598
00599
00600 public int getMaxTablesInSelect() throws SQLException
00601 {
00602 return ((Integer) getMetadata(MetadataDescription.GET_MAX_TABLES_IN_SELECT,
00603 null, null, false)).intValue();
00604 }
00605
00606
00607
00608
00609 public int getMaxUserNameLength() throws SQLException
00610 {
00611 return ((Integer) getMetadata(MetadataDescription.GET_MAX_USER_NAME_LENGTH,
00612 null, null, false)).intValue();
00613 }
00614
00615
00616
00617
00618 public String getNumericFunctions() throws SQLException
00619 {
00620 return ((String) getMetadata(MetadataDescription.GET_NUMERIC_FUNCTIONS,
00621 null, null, true));
00622 }
00623
00624
00625
00626
00627
00628 public java.sql.ResultSet getPrimaryKeys(String catalog, String schema,
00629 String table) throws SQLException
00630 {
00631 return connection.getPrimaryKeys(catalog, schema, table);
00632 }
00633
00634
00635
00636
00637
00638 public java.sql.ResultSet getProcedureColumns(String catalog,
00639 String schemaPattern, String procedureNamePattern,
00640 String columnNamePattern) throws SQLException
00641 {
00642 return connection.getProcedureColumns(catalog, schemaPattern,
00643 procedureNamePattern, columnNamePattern);
00644 }
00645
00646
00647
00648
00649
00650 public java.sql.ResultSet getProcedures(String catalog, String schemaPattern,
00651 String procedureNamePattern) throws SQLException
00652 {
00653 return connection.getProcedures(catalog, schemaPattern,
00654 procedureNamePattern);
00655 }
00656
00657
00658
00659
00660 public String getProcedureTerm() throws SQLException
00661 {
00662 return ((String) getMetadata(MetadataDescription.GET_PROCEDURE_TERM, null,
00663 null, true));
00664 }
00665
00666
00667
00668
00669 public java.sql.ResultSet getSchemas() throws SQLException
00670 {
00671 return connection.getSchemas();
00672 }
00673
00674
00675
00676
00677 public String getSchemaTerm() throws SQLException
00678 {
00679 return ((String) getMetadata(MetadataDescription.GET_SCHEMA_TERM, null,
00680 null, true));
00681 }
00682
00683
00684
00685
00686 public String getSearchStringEscape() throws SQLException
00687 {
00688 return ((String) getMetadata(MetadataDescription.GET_SEARCH_STRING_ESCAPE,
00689 null, null, true));
00690 }
00691
00692
00693
00694
00695 public String getSQLKeywords() throws SQLException
00696 {
00697 return ((String) getMetadata(MetadataDescription.GET_SQL_KEYWORDS, null,
00698 null, true));
00699 }
00700
00701
00702
00703
00704 public String getStringFunctions() throws SQLException
00705 {
00706 return ((String) getMetadata(MetadataDescription.GET_STRING_FUNCTIONS,
00707 null, null, true));
00708 }
00709
00710
00711
00712
00713 public String getSystemFunctions() throws SQLException
00714 {
00715 return ((String) getMetadata(MetadataDescription.GET_SYSTEM_FUNCTIONS,
00716 null, null, true));
00717 }
00718
00719
00720
00721
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731
00732
00733 public java.sql.ResultSet getTables(String catalog, String schemaPattern,
00734 String tableNamePattern, String types[]) throws SQLException
00735 {
00736 return connection
00737 .getTables(catalog, schemaPattern, tableNamePattern, types);
00738 }
00739
00740
00741
00742
00743
00744
00745
00746
00747
00748
00749
00750
00751
00752
00753
00754
00755
00756 public java.sql.ResultSet getTablePrivileges(String catalog,
00757 String schemaPattern, String tableNamePattern) throws SQLException
00758 {
00759 return connection.getTablePrivileges(catalog, schemaPattern,
00760 tableNamePattern);
00761 }
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771 public java.sql.ResultSet getTableTypes() throws SQLException
00772 {
00773 return connection.getTableTypes();
00774 }
00775
00776
00777
00778
00779 public String getTimeDateFunctions() throws SQLException
00780 {
00781 return ((String) getMetadata(MetadataDescription.GET_TIME_DATE_FUNCTIONS,
00782 null, null, true));
00783 }
00784
00785
00786
00787
00788
00789
00790
00791 public java.sql.ResultSet getTypeInfo() throws SQLException
00792 {
00793 return null;
00794 }
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806 public java.sql.ResultSet getUDTs(String catalog, String schemaPattern,
00807 String typeNamePattern, int[] types) throws SQLException
00808 {
00809 return null;
00810 }
00811
00812
00813
00814
00815
00816
00817
00818 public String getURL() throws SQLException
00819 {
00820 return connection.getURL();
00821 }
00822
00823
00824
00825
00826
00827
00828
00829 public String getUserName() throws SQLException
00830 {
00831 return connection.getUserName();
00832 }
00833
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843 public java.sql.ResultSet getVersionColumns(String catalog, String schema,
00844 String table) throws SQLException
00845 {
00846 return null;
00847 }
00848
00849
00850
00851
00852 public boolean insertsAreDetected(int type) throws SQLException
00853 {
00854 return ((Boolean) getMetadata(MetadataDescription.INSERTS_ARE_DETECTED,
00855 new Class[]{Integer.TYPE}, new Object[]{new Integer(type)}, false))
00856 .booleanValue();
00857 }
00858
00859
00860
00861
00862 public boolean isCatalogAtStart() throws SQLException
00863 {
00864 return ((Boolean) getMetadata(MetadataDescription.IS_CATALOG_AT_START,
00865 null, null, false)).booleanValue();
00866 }
00867
00868
00869
00870
00871
00872
00873
00874 public boolean isReadOnly() throws SQLException
00875 {
00876 return connection.isReadOnly();
00877 }
00878
00879
00880
00881
00882 public boolean nullPlusNonNullIsNull() throws SQLException
00883 {
00884 return ((Boolean) getMetadata(
00885 MetadataDescription.NULL_PLUS_NON_NULL_IS_NULL, null, null, false))
00886 .booleanValue();
00887 }
00888
00889
00890
00891
00892 public boolean nullsAreSortedAtEnd() throws SQLException
00893 {
00894 return ((Boolean) getMetadata(MetadataDescription.NULLS_ARE_SORTED_AT_END,
00895 null, null, false)).booleanValue();
00896 }
00897
00898
00899
00900
00901 public boolean nullsAreSortedAtStart() throws SQLException
00902 {
00903 return ((Boolean) getMetadata(
00904 MetadataDescription.NULLS_ARE_SORTED_AT_START, null, null, false))
00905 .booleanValue();
00906 }
00907
00908
00909
00910
00911 public boolean nullsAreSortedHigh() throws SQLException
00912 {
00913 return ((Boolean) getMetadata(MetadataDescription.NULLS_ARE_SORTED_HIGH,
00914 null, null, false)).booleanValue();
00915 }
00916
00917
00918
00919
00920 public boolean nullsAreSortedLow() throws SQLException
00921 {
00922 return ((Boolean) getMetadata(MetadataDescription.NULLS_ARE_SORTED_LOW,
00923 null, null, false)).booleanValue();
00924 }
00925
00926
00927
00928
00929 public boolean othersDeletesAreVisible(int type) throws SQLException
00930 {
00931 return ((Boolean) getMetadata(
00932 MetadataDescription.OTHERS_DELETES_ARE_VISIBLE,
00933 new Class[]{Integer.TYPE}, new Object[]{new Integer(type)}, false))
00934 .booleanValue();
00935 }
00936
00937
00938
00939
00940 public boolean othersInsertsAreVisible(int type) throws SQLException
00941 {
00942 return ((Boolean) getMetadata(
00943 MetadataDescription.OTHERS_INSERTS_ARE_VISIBLE,
00944 new Class[]{Integer.TYPE}, new Object[]{new Integer(type)}, false))
00945 .booleanValue();
00946 }
00947
00948
00949
00950
00951 public boolean othersUpdatesAreVisible(int type) throws SQLException
00952 {
00953 return ((Boolean) getMetadata(
00954 MetadataDescription.OTHERS_UPDATES_ARE_VISIBLE,
00955 new Class[]{Integer.TYPE}, new Object[]{new Integer(type)}, false))
00956 .booleanValue();
00957 }
00958
00959
00960
00961
00962 public boolean ownDeletesAreVisible(int type) throws SQLException
00963 {
00964 return ((Boolean) getMetadata(MetadataDescription.OWN_DELETES_ARE_VISIBLE,
00965 new Class[]{Integer.TYPE}, new Object[]{new Integer(type)}, false))
00966 .booleanValue();
00967 }
00968
00969
00970
00971
00972 public boolean ownInsertsAreVisible(int type) throws SQLException
00973 {
00974 return ((Boolean) getMetadata(MetadataDescription.OWN_INSERTS_ARE_VISIBLE,
00975 new Class[]{Integer.TYPE}, new Object[]{new Integer(type)}, false))
00976 .booleanValue();
00977
00978 }
00979
00980
00981
00982
00983 public boolean ownUpdatesAreVisible(int type) throws SQLException
00984 {
00985 return ((Boolean) getMetadata(MetadataDescription.OWN_UPDATES_ARE_VISIBLE,
00986 new Class[]{Integer.TYPE}, new Object[]{new Integer(type)}, false))
00987 .booleanValue();
00988 }
00989
00990
00991
00992
00993 public boolean storesLowerCaseIdentifiers() throws SQLException
00994 {
00995 return ((Boolean) getMetadata(
00996 MetadataDescription.STORES_LOWER_CASE_IDENTIFIERS, null, null, false))
00997 .booleanValue();
00998 }
00999
01000
01001
01002
01003 public boolean storesLowerCaseQuotedIdentifiers() throws SQLException
01004 {
01005 return ((Boolean) getMetadata(
01006 MetadataDescription.STORES_LOWER_CASE_QUOTED_IDENTIFIERS, null, null,
01007 false)).booleanValue();
01008 }
01009
01010
01011
01012
01013 public boolean storesMixedCaseIdentifiers() throws SQLException
01014 {
01015 return ((Boolean) getMetadata(
01016 MetadataDescription.STORES_MIXED_CASE_IDENTIFIERS, null, null, false))
01017 .booleanValue();
01018 }
01019
01020
01021
01022
01023 public boolean storesMixedCaseQuotedIdentifiers() throws SQLException
01024 {
01025 return ((Boolean) getMetadata(
01026 MetadataDescription.STORES_MIXED_CASE_QUOTED_IDENTIFIERS, null, null,
01027 false)).booleanValue();
01028 }
01029
01030
01031
01032
01033 public boolean storesUpperCaseIdentifiers() throws SQLException
01034 {
01035 return ((Boolean) getMetadata(
01036 MetadataDescription.STORES_UPPER_CASE_IDENTIFIERS, null, null, false))
01037 .booleanValue();
01038 }
01039
01040
01041
01042
01043 public boolean storesUpperCaseQuotedIdentifiers() throws SQLException
01044 {
01045 return ((Boolean) getMetadata(
01046 MetadataDescription.STORES_UPPER_CASE_QUOTED_IDENTIFIERS, null, null,
01047 false)).booleanValue();
01048 }
01049
01050
01051
01052
01053 public boolean supportsAlterTableWithAddColumn() throws SQLException
01054 {
01055 return ((Boolean) getMetadata(
01056 MetadataDescription.SUPPORTS_ALTER_TABLE_WITH_ADD_COLUMN, null, null,
01057 false)).booleanValue();
01058 }
01059
01060
01061
01062
01063 public boolean supportsAlterTableWithDropColumn() throws SQLException
01064 {
01065 return ((Boolean) getMetadata(
01066 MetadataDescription.SUPPORTS_ALTER_TABLE_WITH_DROP_COLUMN, null, null,
01067 false)).booleanValue();
01068 }
01069
01070
01071
01072
01073 public boolean supportsANSI92EntryLevelSQL() throws SQLException
01074 {
01075 return ((Boolean) getMetadata(
01076 MetadataDescription.SUPPORTS_ANSI92_ENTRY_LEVEL_SQL, null, null, false))
01077 .booleanValue();
01078 }
01079
01080
01081
01082
01083 public boolean supportsANSI92FullSQL() throws SQLException
01084 {
01085 return ((Boolean) getMetadata(MetadataDescription.SUPPORTS_ANSI92_FULL_SQL,
01086 null, null, false)).booleanValue();
01087 }
01088
01089
01090
01091
01092 public boolean supportsANSI92IntermediateSQL() throws SQLException
01093 {
01094 return ((Boolean) getMetadata(
01095 MetadataDescription.SUPPORTS_ANSI92_INTERMEDIATE_SQL, null, null, false))
01096 .booleanValue();
01097 }
01098
01099
01100
01101
01102 public boolean supportsBatchUpdates() throws SQLException
01103 {
01104 return ((Boolean) getMetadata(MetadataDescription.SUPPORTS_BATCH_UPDATES,
01105 null, null, false)).booleanValue();
01106 }
01107
01108
01109
01110
01111 public boolean supportsCatalogsInDataManipulation() throws SQLException
01112 {
01113 return ((Boolean) getMetadata(
01114 MetadataDescription.SUPPORTS_CATALOGS_IN_DATA_MANIPULATION, null, null,
01115 false)).booleanValue();
01116 }
01117
01118
01119
01120
01121 public boolean supportsCatalogsInIndexDefinitions() throws SQLException
01122 {
01123 return ((Boolean) getMetadata(
01124 MetadataDescription.SUPPORTS_CATALOGS_IN_INDEX_DEFINITIONS, null, null,
01125 false)).booleanValue();
01126 }
01127
01128
01129
01130
01131 public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException
01132 {
01133 return ((Boolean) getMetadata(
01134 MetadataDescription.SUPPORTS_CATALOGS_IN_PRIVILEGE_DEFINITIONS, null,
01135 null, false)).booleanValue();
01136 }
01137
01138
01139
01140
01141 public boolean supportsCatalogsInProcedureCalls() throws SQLException
01142 {
01143 return ((Boolean) getMetadata(
01144 MetadataDescription.SUPPORTS_CATALOGS_IN_PROCEDURE_CALLS, null, null,
01145 false)).booleanValue();
01146 }
01147
01148
01149
01150
01151 public boolean supportsCatalogsInTableDefinitions() throws SQLException
01152 {
01153 return ((Boolean) getMetadata(
01154 MetadataDescription.SUPPORTS_CATALOGS_IN_TABLE_DEFINITIONS, null, null,
01155 false)).booleanValue();
01156 }
01157
01158
01159
01160
01161 public boolean supportsColumnAliasing() throws SQLException
01162 {
01163 return ((Boolean) getMetadata(MetadataDescription.SUPPORTS_COLUMN_ALIASING,
01164 null, null, false)).booleanValue();
01165 }
01166
01167
01168
01169
01170 public boolean supportsConvert() throws SQLException
01171 {
01172 return ((Boolean) getMetadata(MetadataDescription.SUPPORTS_CONVERT, null,
01173 null, false)).booleanValue();
01174 }
01175
01176
01177
01178
01179
01180
01181
01182
01183
01184
01185 public boolean supportsConvert(int fromType, int toType) throws SQLException
01186 {
01187 return false;
01188 }
01189
01190
01191
01192
01193 public boolean supportsCoreSQLGrammar() throws SQLException
01194 {
01195 return ((Boolean) getMetadata(
01196 MetadataDescription.SUPPORTS_CORE_SQL_GRAMMAR, null, null, false))
01197 .booleanValue();
01198 }
01199
01200
01201
01202
01203 public boolean supportsCorrelatedSubqueries() throws SQLException
01204 {
01205 return ((Boolean) getMetadata(
01206 MetadataDescription.SUPPORTS_CORRELATED_SUBQUERIES, null, null, false))
01207 .booleanValue();
01208 }
01209
01210
01211
01212
01213 public boolean supportsDataDefinitionAndDataManipulationTransactions()
01214 throws SQLException
01215 {
01216 return ((Boolean) getMetadata(
01217 MetadataDescription.SUPPORTS_DATA_DEFINITION_AND_DATA_MANIPULATION_TRANSACTIONS,
01218 null, null, false)).booleanValue();
01219 }
01220
01221
01222
01223
01224 public boolean supportsDataManipulationTransactionsOnly() throws SQLException
01225 {
01226 return ((Boolean) getMetadata(
01227 MetadataDescription.SUPPORTS_DATA_MANIPULATION_TRANSACTIONS_ONLY, null,
01228 null, false)).booleanValue();
01229 }
01230
01231
01232
01233
01234 public boolean supportsDifferentTableCorrelationNames() throws SQLException
01235 {
01236 return ((Boolean) getMetadata(
01237 MetadataDescription.SUPPORTS_DIFFERENT_TABLE_CORRELATION_NAMES, null,
01238 null, false)).booleanValue();
01239 }
01240
01241
01242
01243
01244 public boolean supportsExpressionsInOrderBy() throws SQLException
01245 {
01246 return ((Boolean) getMetadata(
01247 MetadataDescription.SUPPORTS_EXPRESSIONS_IN_ORDER_BY, null, null, false))
01248 .booleanValue();
01249 }
01250
01251
01252
01253
01254 public boolean supportsExtendedSQLGrammar() throws SQLException
01255 {
01256 return ((Boolean) getMetadata(
01257 MetadataDescription.SUPPORTS_EXTENDED_SQL_GRAMMAR, null, null, false))
01258 .booleanValue();
01259 }
01260
01261
01262
01263
01264 public boolean supportsFullOuterJoins() throws SQLException
01265 {
01266 return ((Boolean) getMetadata(
01267 MetadataDescription.SUPPORTS_FULL_OUTER_JOINS, null, null, false))
01268 .booleanValue();
01269 }
01270
01271
01272
01273
01274 public boolean supportsGroupBy() throws SQLException
01275 {
01276 return ((Boolean) getMetadata(MetadataDescription.SUPPORTS_GROUP_BY, null,
01277 null, false)).booleanValue();
01278 }
01279
01280
01281
01282
01283 public boolean supportsGroupByBeyondSelect() throws SQLException
01284 {
01285 return ((Boolean) getMetadata(
01286 MetadataDescription.SUPPORTS_GROUP_BY_BEYOND_SELECT, null, null, false))
01287 .booleanValue();
01288 }
01289
01290
01291
01292
01293 public boolean supportsGroupByUnrelated() throws SQLException
01294 {
01295 return ((Boolean) getMetadata(
01296 MetadataDescription.SUPPORTS_GROUP_BY_UNRELATED, null, null, false))
01297 .booleanValue();
01298 }
01299
01300
01301
01302
01303 public boolean supportsIntegrityEnhancementFacility() throws SQLException
01304 {
01305 return ((Boolean) getMetadata(
01306 MetadataDescription.SUPPORTS_INTEGRITY_ENHANCEMENT_FACILITY, null,
01307 null, false)).booleanValue();
01308 }
01309
01310
01311
01312
01313 public boolean supportsLikeEscapeClause() throws SQLException
01314 {
01315 return ((Boolean) getMetadata(
01316 MetadataDescription.SUPPORTS_LIKE_ESCAPE_CLAUSE, null, null, false))
01317 .booleanValue();
01318 }
01319
01320
01321
01322
01323 public boolean supportsLimitedOuterJoins() throws SQLException
01324 {
01325 return ((Boolean) getMetadata(
01326 MetadataDescription.SUPPORTS_LIMITED_OUTER_JOINS, null, null, false))
01327 .booleanValue();
01328 }
01329
01330
01331
01332
01333 public boolean supportsMinimumSQLGrammar() throws SQLException
01334 {
01335 return ((Boolean) getMetadata(
01336 MetadataDescription.SUPPORTS_MINIMUM_SQL_GRAMMAR, null, null, false))
01337 .booleanValue();
01338 }
01339
01340
01341
01342
01343 public boolean supportsMixedCaseIdentifiers() throws SQLException
01344 {
01345 return ((Boolean) getMetadata(
01346 MetadataDescription.SUPPORTS_MIXED_CASE_IDENTIFIERS, null, null, false))
01347 .booleanValue();
01348 }
01349
01350
01351
01352
01353 public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException
01354 {
01355 return ((Boolean) getMetadata(
01356 MetadataDescription.SUPPORTS_MIXED_CASE_QUOTED_IDENTIFIERS, null, null,
01357 false)).booleanValue();
01358 }
01359
01360
01361
01362
01363 public boolean supportsMultipleResultSets() throws SQLException
01364 {
01365 return ((Boolean) getMetadata(
01366 MetadataDescription.SUPPORTS_MULTIPLE_RESULTSETS, null, null, false))
01367 .booleanValue();
01368 }
01369
01370
01371
01372
01373 public boolean supportsMultipleTransactions() throws SQLException
01374 {
01375 return ((Boolean) getMetadata(
01376 MetadataDescription.SUPPORTS_MULTIPLE_TRANSACTIONS, null, null, false))
01377 .booleanValue();
01378 }
01379
01380
01381
01382
01383 public boolean supportsNonNullableColumns() throws SQLException
01384 {
01385 return ((Boolean) getMetadata(
01386 MetadataDescription.SUPPORTS_NON_NULLABLE_COLUMNS, null, null, false))
01387 .booleanValue();
01388 }
01389
01390
01391
01392
01393 public boolean supportsOpenCursorsAcrossCommit() throws SQLException
01394 {
01395 return ((Boolean) getMetadata(
01396 MetadataDescription.SUPPORTS_OPEN_CURSORS_ACROSS_COMMIT, null, null,
01397 false)).booleanValue();
01398 }
01399
01400
01401
01402
01403 public boolean supportsOpenCursorsAcrossRollback() throws SQLException
01404 {
01405 return ((Boolean) getMetadata(
01406 MetadataDescription.SUPPORTS_OPEN_CURSORS_ACROSS_ROLLBACK, null, null,
01407 false)).booleanValue();
01408 }
01409
01410
01411
01412
01413 public boolean supportsOpenStatementsAcrossCommit() throws SQLException
01414 {
01415 return ((Boolean) getMetadata(
01416 MetadataDescription.SUPPORTS_OPEN_STATEMENTS_ACROSS_COMMIT, null, null,
01417 false)).booleanValue();
01418 }
01419
01420
01421
01422
01423 public boolean supportsOpenStatementsAcrossRollback() throws SQLException
01424 {
01425 return ((Boolean) getMetadata(
01426 MetadataDescription.SUPPORTS_OPEN_STATEMENTS_ACROSS_ROLLBACK, null,
01427 null, false)).booleanValue();
01428 }
01429
01430
01431
01432
01433 public boolean supportsOrderByUnrelated() throws SQLException
01434 {
01435 return ((Boolean) getMetadata(
01436 MetadataDescription.SUPPORTS_ORDER_BY_UNRELATED, null, null, false))
01437 .booleanValue();
01438 }
01439
01440
01441
01442
01443 public boolean supportsOuterJoins() throws SQLException
01444 {
01445 return ((Boolean) getMetadata(MetadataDescription.SUPPORTS_OUTER_JOINS,
01446 null, null, false)).booleanValue();
01447 }
01448
01449
01450
01451
01452 public boolean supportsPositionedDelete() throws SQLException
01453 {
01454 return ((Boolean) getMetadata(
01455 MetadataDescription.SUPPORTS_POSITIONED_DELETE, null, null, false))
01456 .booleanValue();
01457 }
01458
01459
01460
01461
01462 public boolean supportsPositionedUpdate() throws SQLException
01463 {
01464 return ((Boolean) getMetadata(
01465 MetadataDescription.SUPPORTS_POSITIONED_UPDATE, null, null, false))
01466 .booleanValue();
01467 }
01468
01469
01470
01471
01472 public boolean supportsResultSetConcurrency(int type, int concurrency)
01473 throws SQLException
01474 {
01475 return ((Boolean) getMetadata(
01476 MetadataDescription.SUPPORTS_RESULT_SET_CONCURRENCY,
01477 new Class[]{Integer.TYPE, Integer.TYPE},
01478 new Object[]{new Integer(type), new Integer(concurrency)},
01479 false)).booleanValue();
01480 }
01481
01482
01483
01484
01485 public boolean supportsResultSetHoldability(int holdability)
01486 throws SQLException
01487 {
01488 return ((Boolean) getMetadata(
01489 MetadataDescription.SUPPORTS_RESULT_SET_HOLDABILITY,
01490 new Class[]{Integer.TYPE}, new Object[]{new Integer(holdability)},
01491 false)).booleanValue();
01492 }
01493
01494
01495
01496
01497 public boolean supportsResultSetType(int type) throws SQLException
01498 {
01499 return ((Boolean) getMetadata(MetadataDescription.SUPPORTS_RESULT_SET_TYPE,
01500 new Class[]{Integer.TYPE}, new Object[]{new Integer(type)}, false))
01501 .booleanValue();
01502 }
01503
01504
01505
01506
01507 public boolean supportsSchemasInDataManipulation() throws SQLException
01508 {
01509 return ((Boolean) getMetadata(
01510 MetadataDescription.SUPPORTS_SCHEMAS_IN_DATA_MANIPULATION, null, null,
01511 false)).booleanValue();
01512 }
01513
01514
01515
01516
01517 public boolean supportsSchemasInIndexDefinitions() throws SQLException
01518 {
01519 return ((Boolean) getMetadata(
01520 MetadataDescription.SUPPORTS_SCHEMAS_IN_INDEX_DEFINITIONS, null, null,
01521 false)).booleanValue();
01522 }
01523
01524
01525
01526
01527 public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException
01528 {
01529 return ((Boolean) getMetadata(
01530 MetadataDescription.SUPPORTS_SCHEMAS_IN_PRIVILEGE_DEFINITIONS, null,
01531 null, false)).booleanValue();
01532 }
01533
01534
01535
01536
01537 public boolean supportsSchemasInProcedureCalls() throws SQLException
01538 {
01539 return ((Boolean) getMetadata(
01540 MetadataDescription.SUPPORTS_SCHEMAS_IN_PROCEDURE_CALLS, null, null,
01541 false)).booleanValue();
01542 }
01543
01544
01545
01546
01547 public boolean supportsSchemasInTableDefinitions() throws SQLException
01548 {
01549 return ((Boolean) getMetadata(
01550 MetadataDescription.SUPPORTS_SCHEMAS_IN_TABLE_DEFINITIONS, null, null,
01551 false)).booleanValue();
01552 }
01553
01554
01555
01556
01557 public boolean supportsSelectForUpdate() throws SQLException
01558 {
01559 return ((Boolean) getMetadata(
01560 MetadataDescription.SUPPORTS_SELECT_FOR_UPDATE, null, null, false))
01561 .booleanValue();
01562 }
01563
01564
01565
01566
01567 public boolean supportsStoredProcedures() throws SQLException
01568 {
01569 return ((Boolean) getMetadata(
01570 MetadataDescription.SUPPORTS_STORED_PROCEDURES, null, null, false))
01571 .booleanValue();
01572 }
01573
01574
01575
01576
01577 public boolean supportsSubqueriesInComparisons() throws SQLException
01578 {
01579 return ((Boolean) getMetadata(
01580 MetadataDescription.SUPPORTS_SUB_QUERIES_IN_COMPARISONS, null, null,
01581 false)).booleanValue();
01582 }
01583
01584
01585
01586
01587 public boolean supportsSubqueriesInExists() throws SQLException
01588 {
01589 return ((Boolean) getMetadata(
01590 MetadataDescription.SUPPORTS_SUB_QUERIES_IN_EXISTS, null, null, false))
01591 .booleanValue();
01592 }
01593
01594
01595
01596
01597 public boolean supportsSubqueriesInIns() throws SQLException
01598 {
01599 return ((Boolean) getMetadata(
01600 MetadataDescription.SUPPORTS_SUB_QUERIES_IN_INS, null, null, false))
01601 .booleanValue();
01602 }
01603
01604
01605
01606
01607 public boolean supportsSubqueriesInQuantifieds() throws SQLException
01608 {
01609 return ((Boolean) getMetadata(
01610 MetadataDescription.SUPPORTS_SUB_QUERIES_IN_QUANTIFIEDS, null, null,
01611 false)).booleanValue();
01612 }
01613
01614
01615
01616
01617 public boolean supportsTableCorrelationNames() throws SQLException
01618 {
01619 return ((Boolean) getMetadata(
01620 MetadataDescription.SUPPORTS_TABLE_CORRELATION_NAMES, null, null, false))
01621 .booleanValue();
01622 }
01623
01624
01625
01626
01627 public boolean supportsTransactionIsolationLevel(int level)
01628 throws SQLException
01629 {
01630 return ((Boolean) getMetadata(
01631 MetadataDescription.SUPPORTS_TRANSACTION_ISOLATION_LEVEL,
01632 new Class[]{Integer.TYPE}, new Object[]{new Integer(level)}, false))
01633 .booleanValue();
01634 }
01635
01636
01637
01638
01639 public boolean supportsTransactions() throws SQLException
01640 {
01641 return ((Boolean) getMetadata(MetadataDescription.SUPPORTS_TRANSACTIONS,
01642 null, null, false)).booleanValue();
01643 }
01644
01645
01646
01647
01648 public boolean supportsUnion() throws SQLException
01649 {
01650 return ((Boolean) getMetadata(MetadataDescription.SUPPORTS_UNION, null,
01651 null, false)).booleanValue();
01652 }
01653
01654
01655
01656
01657 public boolean supportsUnionAll() throws SQLException
01658 {
01659 return ((Boolean) getMetadata(MetadataDescription.SUPPORTS_UNION_ALL, null,
01660 null, false)).booleanValue();
01661 }
01662
01663
01664
01665
01666 public boolean updatesAreDetected(int type) throws SQLException
01667 {
01668 return ((Boolean) getMetadata(MetadataDescription.UPDATES_ARE_DETECTED,
01669 new Class[]{Integer.TYPE}, new Object[]{new Integer(type)}, false))
01670 .booleanValue();
01671 }
01672
01673
01674
01675
01676 public boolean usesLocalFilePerTable() throws SQLException
01677 {
01678 return ((Boolean) getMetadata(
01679 MetadataDescription.USES_LOCAL_FILE_PER_TABLE, null, null, false))
01680 .booleanValue();
01681 }
01682
01683
01684
01685
01686 public boolean usesLocalFiles() throws SQLException
01687 {
01688 return ((Boolean) getMetadata(MetadataDescription.USES_LOCAL_FILES, null,
01689 null, false)).booleanValue();
01690 }
01691
01692
01693
01694
01695
01696
01697 public boolean supportsSavepoints() throws SQLException
01698 {
01699 return ((Boolean) getMetadata(MetadataDescription.SUPPORTS_SAVEPOINTS,
01700 null, null, false)).booleanValue();
01701 }
01702
01703
01704
01705
01706 public boolean supportsNamedParameters() throws SQLException
01707 {
01708 return ((Boolean) getMetadata(
01709 MetadataDescription.SUPPORTS_NAMED_PARAMETERS, null, null, false))
01710 .booleanValue();
01711 }
01712
01713
01714
01715
01716 public boolean supportsMultipleOpenResults() throws SQLException
01717 {
01718 return ((Boolean) getMetadata(
01719 MetadataDescription.SUPPORTS_MULTIPLE_OPEN_RESULTS, null, null, false))
01720 .booleanValue();
01721 }
01722
01723
01724
01725
01726 public boolean supportsGetGeneratedKeys() throws SQLException
01727 {
01728 return ((Boolean) getMetadata(
01729 MetadataDescription.SUPPORTS_GET_GENERATED_KEYS, null, null, false))
01730 .booleanValue();
01731 }
01732
01733
01734
01735
01736
01737
01738
01739
01740
01741
01742
01743
01744
01745
01746
01747 public java.sql.ResultSet getSuperTypes(String catalog, String schemaPattern,
01748 String typeNamePattern) throws SQLException
01749 {
01750 throw new NotImplementedException("getSuperTypes");
01751 }
01752
01753
01754
01755
01756
01757
01758
01759
01760
01761
01762
01763
01764
01765
01766
01767 public java.sql.ResultSet getSuperTables(String catalog,
01768 String schemaPattern, String tableNamePattern) throws SQLException
01769 {
01770 throw new NotImplementedException("getSuperTables");
01771 }
01772
01773
01774
01775
01776
01777
01778
01779
01780
01781
01782
01783
01784
01785
01786
01787
01788
01789
01790
01791
01792
01793 public java.sql.ResultSet getAttributes(String catalog, String schemaPattern,
01794 String typeNamePattern, String attributeNamePattern) throws SQLException
01795 {
01796 throw new NotImplementedException("getAttributes");
01797 }
01798
01799
01800
01801
01802 public int getResultSetHoldability() throws SQLException
01803 {
01804 return ((Integer) getMetadata(
01805 MetadataDescription.GET_RESULTSET_HOLDABILITY, null, null, false))
01806 .intValue();
01807 }
01808
01809
01810
01811
01812 public int getDatabaseMajorVersion() throws SQLException
01813 {
01814 return ((Integer) getMetadata(
01815 MetadataDescription.GET_DATABASE_MAJOR_VERSION, null, null, false))
01816 .intValue();
01817 }
01818
01819
01820
01821
01822 public int getDatabaseMinorVersion() throws SQLException
01823 {
01824 return ((Integer) getMetadata(
01825 MetadataDescription.GET_DATABASE_MINOR_VERSION, null, null, false))
01826 .intValue();
01827 }
01828
01829
01830
01831
01832
01833
01834
01835
01836 public int getJDBCMajorVersion() throws SQLException
01837 {
01838 return Driver.MAJOR_VERSION;
01839 }
01840
01841
01842
01843
01844
01845
01846
01847
01848 public int getJDBCMinorVersion() throws SQLException
01849 {
01850 return Driver.MINOR_VERSION;
01851 }
01852
01853
01854
01855
01856 public int getSQLStateType() throws SQLException
01857 {
01858 return ((Integer) getMetadata(MetadataDescription.GET_SQL_STATE_TYPE, null,
01859 null, false)).intValue();
01860 }
01861
01862
01863
01864
01865 public boolean locatorsUpdateCopy() throws SQLException
01866 {
01867 return ((Boolean) getMetadata(MetadataDescription.LOCATORS_UPDATE_COPY,
01868 null, null, false)).booleanValue();
01869 }
01870
01871
01872
01873
01874 public boolean supportsStatementPooling() throws SQLException
01875 {
01876 return ((Boolean) getMetadata(
01877 MetadataDescription.SUPPORTS_STATEMENT_POOLING, null, null, false))
01878 .booleanValue();
01879 }
01880 }