1 19 20 package org.netbeans.lib.ddl.adaptors; 21 22 import java.beans.PropertyChangeListener ; 23 import java.beans.PropertyChangeSupport ; 24 import java.io.Serializable ; 25 import java.sql.Connection ; 26 import java.sql.DatabaseMetaData ; 27 import java.sql.PreparedStatement ; 28 import java.sql.ResultSet ; 29 import java.sql.RowIdLifetime ; 30 import java.sql.SQLException ; 31 import java.util.HashMap ; 32 import java.util.Map ; 33 import java.util.ResourceBundle ; 34 35 import org.openide.util.NbBundle; 36 37 public class DefaultAdaptor implements DatabaseMetaDataAdaptor, Serializable { 38 39 private transient Connection con; 40 private transient DatabaseMetaData dmd; 41 protected Map properties; 42 private transient PropertyChangeSupport propertySupport; 43 44 private ResourceBundle bundle = NbBundle.getBundle("org.netbeans.lib.ddl.resources.Bundle"); 46 public static final int NOT_SET = 0; 47 public static final String NOT_SET_STRING = ""; 48 49 public static final int YES = 1; 50 public static final int NO = 2; 51 52 public static final int NULLSORT_HIGH = 1; 53 public static final int NULLSORT_LOW = 2; 54 public static final int NULLSORT_START = 3; 55 public static final int NULLSORT_END = 4; 56 57 public static final int STORE_LOWERCASE = 1; 58 public static final int STORE_UPPERCASE = 2; 59 public static final int STORE_MIXEDCASE = 3; 60 61 63 public static final String PROP_PROCEDURES_ARE_CALLABLE = "proceduresAreCallable"; public static final String PROP_TABLES_ARE_SELECTABLE = "tablesAreSelectable"; public static final String PROP_READONLY = "readOnly"; public static final String PROP_LOCAL_FILES = "localFiles"; public static final String PROP_FILE_PER_TABLE = "localFilePerTable"; public static final String PROP_MIXEDCASE_IDENTIFIERS = "mixedCaseIdentifiers"; public static final String PROP_MIXEDCASE_QUOTED_IDENTIFIERS = "mixedCaseQuotedIdentifiers"; public static final String PROP_ALTER_ADD = "alterTableWithAddColumn"; public static final String PROP_ALTER_DROP = "alterTableWithDropColumn"; public static final String PROP_COLUMN_ALIASING = "columnAliasing"; public static final String PROP_NULL_PLUS_NULL_IS_NULL = "nullPlusNonNullIsNull"; public static final String PROP_CONVERT = "convert"; public static final String PROP_TABLE_CORRELATION_NAMES = "tableCorrelationNames"; public static final String PROP_DIFF_TABLE_CORRELATION_NAMES = "differentTableCorrelationNames"; public static final String PROP_EXPRESSIONS_IN_ORDERBY = "expressionsInOrderBy"; public static final String PROP_ORDER_BY_UNRELATED = "orderByUnrelated"; public static final String PROP_GROUP_BY = "groupBy"; public static final String PROP_UNRELATED_GROUP_BY = "groupByUnrelated"; public static final String PROP_BEYOND_GROUP_BY = "groupByBeyondSelect"; public static final String PROP_ESCAPE_LIKE = "likeEscapeClause"; public static final String PROP_MULTIPLE_RS = "multipleResultSets"; public static final String PROP_MULTIPLE_TRANSACTIONS = "multipleTransactions"; public static final String PROP_NON_NULL_COLUMNSS = "nonNullableColumns"; public static final String PROP_MINUMUM_SQL_GRAMMAR = "minimumSQLGrammar"; public static final String PROP_CORE_SQL_GRAMMAR = "coreSQLGrammar"; public static final String PROP_EXTENDED_SQL_GRAMMAR = "extendedSQLGrammar"; public static final String PROP_ANSI_SQL_GRAMMAR = "ANSI92EntryLevelSQL"; public static final String PROP_INTERMEDIATE_SQL_GRAMMAR = "ANSI92IntermediateSQL"; public static final String PROP_FULL_SQL_GRAMMAR = "ANSI92FullSQL"; public static final String PROP_INTEGRITY_ENHANCEMENT = "IntegrityEnhancementFacility"; public static final String PROP_OUTER_JOINS = "outerJoins"; public static final String PROP_FULL_OUTER_JOINS = "fullOuterJoins"; public static final String PROP_LIMITED_OUTER_JOINS = "limitedOuterJoins"; public static final String PROP_CATALOG_AT_START = "catalogAtStart"; public static final String PROP_SCHEMAS_IN_DML = "schemasInDataManipulation"; public static final String PROP_SCHEMAS_IN_PROCEDURE_CALL = "schemasInProcedureCalls"; public static final String PROP_SCHEMAS_IN_TABLE_DEFINITION = "schemasInTableDefinitions"; public static final String PROP_SCHEMAS_IN_INDEX = "schemasInIndexDefinitions"; public static final String PROP_SCHEMAS_IN_PRIVILEGE_DEFINITION = "schemasInPrivilegeDefinitions"; public static final String PROP_CATALOGS_IN_DML = "catalogsInDataManipulation"; public static final String PROP_CATALOGS_IN_PROCEDURE_CALL = "catalogsInProcedureCalls"; public static final String PROP_CATALOGS_IN_TABLE_DEFINITION = "catalogsInTableDefinitions"; public static final String PROP_CATALOGS_IN_INDEX = "catalogsInIndexDefinitions"; public static final String PROP_CATALOGS_IN_PRIVILEGE_DEFINITION = "catalogsInPrivilegeDefinitions"; public static final String PROP_POSITIONED_DELETE = "positionedDelete"; public static final String PROP_POSITIONED_UPDATE = "positionedUpdate"; public static final String PROP_SELECT_FOR_UPDATE = "selectForUpdate"; public static final String PROP_STORED_PROCEDURES = "storedProcedures"; public static final String PROP_SUBQUERY_IN_COMPARSIONS = "subqueriesInComparisons"; public static final String PROP_SUBQUERY_IN_EXISTS = "subqueriesInExists"; public static final String PROP_SUBQUERY_IN_INS = "subqueriesInIns"; public static final String PROP_SUBQUERY_IN_QUANTIFIEDS = "subqueriesInQuantifieds"; public static final String PROP_CORRELATED_SUBQUERIES = "correlatedSubqueries"; public static final String PROP_UNION = "union"; public static final String PROP_UNION_ALL = "unionAll"; public static final String PROP_OPEN_CURSORS_ACROSS_COMMIT = "openCursorsAcrossCommit"; public static final String PROP_OPEN_CURSORS_ACROSS_ROLLBACK = "openCursorsAcrossRollback"; public static final String PROP_OPEN_STATEMENTS_ACROSS_COMMIT = "openStatementsAcrossCommit"; public static final String PROP_OPEN_STATEMENTS_ACROSS_ROLLBACK = "openStatementsAcrossRollback"; public static final String PROP_ROWSIZE_INCLUDING_BLOBS = "maxRowSizeIncludeBlobs"; public static final String PROP_TRANSACTIONS = "transactions"; public static final String PROP_DDL_AND_DML_TRANSACTIONS = "dataDefinitionAndDataManipulationTransactions"; public static final String PROP_DML_TRANSACTIONS_ONLY = "dataManipulationTransactionsOnly"; public static final String PROP_DDL_CAUSES_COMMIT = "dataDefinitionCausesTransactionCommit"; public static final String PROP_DDL_IGNORED_IN_TRANSACTIONS = "dataDefinitionIgnoredInTransactions"; public static final String PROP_BATCH_UPDATES = "batchUpdates"; 130 132 public static final String PROP_NULL_SORT = "nullSort"; public static final String PROP_IDENTIFIER_STORE = "identifierStore"; public static final String PROP_QUOTED_IDENTS = "quotedIdentifierStore"; public static final String PROP_MAX_BINARY_LITERAL_LENGTH = "maxBinaryLiteralLength"; public static final String PROP_MAX_CHAR_LITERAL_LENGTH = "maxCharLiteralLength"; public static final String PROP_MAX_COLUMN_NAME_LENGTH = "maxColumnNameLength"; public static final String PROP_MAX_COLUMNS_IN_GROUPBY = "maxColumnsInGroupBy"; public static final String PROP_MAX_COLUMNS_IN_INDEX = "maxColumnsInIndex"; public static final String PROP_MAX_COLUMNS_IN_ORDERBY = "maxColumnsInOrderBy"; public static final String PROP_MAX_COLUMNS_IN_SELECT = "maxColumnsInSelect"; public static final String PROP_MAX_COLUMNS_IN_TABLE = "maxColumnsInTable"; public static final String PROP_MAX_CONNECTIONS = "maxConnections"; public static final String PROP_MAX_CURSORNAME_LENGTH = "maxCursorNameLength"; public static final String PROP_MAX_INDEX_LENGTH = "maxIndexLength"; public static final String PROP_MAX_SCHEMA_NAME = "maxSchemaNameLength"; public static final String PROP_MAX_PROCEDURE_NAME = "maxProcedureNameLength"; public static final String PROP_MAX_CATALOG_NAME = "maxCatalogNameLength"; public static final String PROP_MAX_ROW_SIZE = "maxRowSize"; public static final String PROP_MAX_STATEMENT_LENGTH = "maxStatementLength"; public static final String PROP_MAX_STATEMENTS = "maxStatements"; public static final String PROP_MAX_TABLENAME_LENGTH = "maxTableNameLength"; public static final String PROP_MAX_TABLES_IN_SELECT = "maxTablesInSelect"; public static final String PROP_MAX_USERNAME = "maxUserNameLength"; public static final String PROP_DEFAULT_ISOLATION = "defaultTransactionIsolation"; 157 159 public static final String PROP_URL = "URL"; public static final String PROP_USERNAME = "userName"; public static final String PROP_PRODUCTNAME = "databaseProductName"; public static final String PROP_PRODUCTVERSION = "databaseProductVersion"; public static final String PROP_DRIVERNAME = "driverName"; public static final String PROP_DRIVER_VERSION = "driverVersion"; public static final String PROP_DRIVER_MAJOR_VERSION = "driverMajorVersion"; public static final String PROP_DRIVER_MINOR_VERSION = "driverMinorVersion"; public static final String PROP_IDENTIFIER_QUOTE = "identifierQuoteString"; public static final String PROP_SQL_KEYWORDS = "SQLKeywords"; public static final String PROP_NUMERIC_FUNCTIONS = "numericFunctions"; public static final String PROP_STRING_FUNCTIONS = "stringFunctions"; public static final String PROP_SYSTEM_FUNCTIONS = "systemFunctions"; public static final String PROP_TIME_FUNCTIONS = "timeDateFunctions"; public static final String PROP_STRING_ESCAPE = "searchStringEscape"; public static final String PROP_EXTRA_CHARACTERS = "extraNameCharacters"; public static final String PROP_SCHEMA_TERM = "schemaTerm"; public static final String PROP_PROCEDURE_TERM = "procedureTerm"; public static final String PROP_CATALOG_TERM = "catalogTerm"; public static final String PROP_CATALOGS_SEPARATOR = "catalogSeparator"; 180 182 public static final String PROP_PROCEDURES_QUERY = "proceduresQuery"; public static final String PROP_PROCEDURE_COLUMNS_QUERY = "procedureColumnsQuery"; public static final String PROP_SCHEMAS_QUERY = "schemasQuery"; public static final String PROP_CATALOGS_QUERY = "catalogsQuery"; public static final String PROP_TABLES_QUERY = "tablesQuery"; public static final String PROP_TABLE_TYPES_QUERY = "tableTypesQuery"; public static final String PROP_COLUMNS_QUERY = "columnsQuery"; public static final String PROP_COLUMNS_PRIVILEGES_QUERY = "columnPrivilegesQuery"; public static final String PROP_TABLE_PRIVILEGES_QUERY = "tablePrivilegesQuery"; public static final String PROP_BEST_ROW_IDENTIFIER = "bestRowIdentifierQuery"; public static final String PROP_VERSION_COLUMNS = "versionColumnsQuery"; public static final String PROP_PK_QUERY = "primaryKeysQuery"; public static final String PROP_IK_QUERY = "importedKeysQuery"; public static final String PROP_EK_QUERY = "exportedKeysQuery"; public static final String PROP_CROSSREF_QUERY = "crossReferenceQuery"; public static final String PROP_TYPE_INFO_QUERY = "typeInfoQuery"; public static final String PROP_INDEX_INFO_QUERY = "indexInfoQuery"; public static final String PROP_UDT_QUERY = "UDTsQuery"; 201 203 public static final String PROP_CAPITALIZE_USERNAME = "capitializeUsername"; 205 static final long serialVersionUID =2490518619095829944L; 206 public DefaultAdaptor() 207 { 208 propertySupport = new PropertyChangeSupport (this); 209 properties = new HashMap (); 210 } 211 212 public DefaultAdaptor(Connection conn) throws SQLException 213 { 214 propertySupport = new PropertyChangeSupport (this); 215 properties = new HashMap (); 216 con = conn; 217 if (con != null) dmd = con.getMetaData(); 218 else dmd = null; 219 } 220 221 public void addPropertyChangeListener(PropertyChangeListener listener) 222 { 223 propertySupport.addPropertyChangeListener(listener); 224 } 225 226 public void removePropertyChangeListener(PropertyChangeListener listener) 227 { 228 propertySupport.removePropertyChangeListener(listener); 229 } 230 231 public DatabaseMetaData getMetaData() 232 { 233 return this; 234 } 235 236 240 public Connection getConnection() throws SQLException 241 { 242 return con; 243 } 244 245 249 public void setConnection(Connection conn) throws SQLException 250 { 251 con = conn; 252 if (con != null) dmd = con.getMetaData(); 253 else dmd = null; 254 } 255 256 private int getBoolean(String key) 257 { 258 Boolean val = (Boolean )properties.get(key); 259 if (val != null) return (val.booleanValue() ? YES : NO); 260 return NOT_SET; 261 } 262 263 private void setBoolean(String key, int value) 264 { 265 Boolean newValue, oldValue = (Boolean )properties.get(key); 266 if (value != NOT_SET) { 267 newValue = value == YES ? Boolean.TRUE : Boolean.FALSE; 268 properties.put(key, newValue); 269 } else { 270 newValue = null; 271 properties.remove(key); 272 } 273 274 propertySupport.firePropertyChange(key, oldValue, newValue); 275 } 276 277 private int getInt(String key) 278 { 279 Integer val = (Integer )properties.get(key); 280 if (val == null) return NOT_SET; 281 return val.intValue(); 282 } 283 284 private void setInt(String key, int value) 285 { 286 Integer newValue, oldValue = (Integer )properties.get(key); 287 if (value != NOT_SET) { 288 newValue = new Integer (value); 289 properties.put(key, newValue); 290 } else { 291 newValue = null; 292 properties.remove(key); 293 } 294 295 propertySupport.firePropertyChange(key, oldValue, newValue); 296 } 297 298 private String getString(String key) 299 { 300 String val = (String )properties.get(key); 301 if (val == null) return NOT_SET_STRING; 302 return val; 303 } 304 305 private void setString(String key, String value) 306 { 307 String newValue, oldValue = (String )properties.get(key); 308 if (value.length() > 0) { 309 newValue = value; 310 properties.put(key, newValue); 311 } else { 312 newValue = null; 313 properties.remove(key); 314 } 315 316 propertySupport.firePropertyChange(key, oldValue, newValue); 317 } 318 319 321 public boolean allProceduresAreCallable() throws SQLException 322 { 323 Boolean proceduresAreCallable = (Boolean )properties.get(PROP_PROCEDURES_ARE_CALLABLE); 324 if (proceduresAreCallable == null) { 325 if (dmd != null) proceduresAreCallable = dmd.allProceduresAreCallable() ? Boolean.TRUE : Boolean.FALSE; 326 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_PROCEDURES_ARE_CALLABLE, proceduresAreCallable); 328 } 329 330 return proceduresAreCallable.booleanValue(); 331 } 332 333 public int getProceduresAreCallable() 334 { 335 return getBoolean(PROP_PROCEDURES_ARE_CALLABLE); 336 } 337 338 public void setProceduresAreCallable(int value) throws SQLException 339 { 340 setBoolean(PROP_PROCEDURES_ARE_CALLABLE, value); 341 } 342 343 345 public boolean allTablesAreSelectable() throws SQLException 346 { 347 Boolean tablesAreSelectable = (Boolean )properties.get(PROP_TABLES_ARE_SELECTABLE); 348 if (tablesAreSelectable == null) { 349 if (dmd != null) tablesAreSelectable = dmd.allTablesAreSelectable() ? Boolean.TRUE : Boolean.FALSE; 350 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_TABLES_ARE_SELECTABLE, tablesAreSelectable); 352 } 353 354 return tablesAreSelectable.booleanValue(); 355 } 356 357 public int getTablesAreSelectable() 358 { 359 return getBoolean(PROP_TABLES_ARE_SELECTABLE); 360 } 361 362 public void setTablesAreSelectable(int value) 363 { 364 setBoolean(PROP_TABLES_ARE_SELECTABLE, value); 365 } 366 367 369 public String getURL() throws SQLException 370 { 371 String url = (String )properties.get(PROP_URL); 372 if (url == null) { 373 if (dmd != null) url = dmd.getURL(); 374 else return NOT_SET_STRING; 375 properties.put(PROP_URL, url); 376 } 377 378 return url; 379 } 380 381 public void setURL(String value) 382 { 383 setString(PROP_URL, value); 384 } 385 386 388 public String getUserName() throws SQLException 389 { 390 String username = (String )properties.get(PROP_USERNAME); 391 if (username == null) { 392 if (dmd != null) username = dmd.getUserName(); 393 else return NOT_SET_STRING; 394 properties.put(PROP_USERNAME, username); 395 } 396 397 return username; 398 } 399 400 public void setUserName(String value) 401 { 402 setString(PROP_USERNAME, value); 403 } 404 405 407 public boolean isReadOnly() throws SQLException { 408 Boolean readonly = (Boolean )properties.get(PROP_READONLY); 409 if (readonly == null) { 410 if (dmd != null) 411 readonly = dmd.isReadOnly() ? Boolean.TRUE : Boolean.FALSE; 412 else 413 throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_READONLY, readonly); 415 } 416 417 return readonly.booleanValue(); 418 } 419 420 public int getreadOnly() { 422 return getBoolean(PROP_READONLY); 423 } 424 425 public void setreadOnly(int flag) { 427 setBoolean(PROP_READONLY, flag); 428 } 429 430 432 public int getNullSort() 433 { 434 return getInt(PROP_NULL_SORT); 435 } 436 437 public void setNullSort(int value) 438 { 439 setInt(PROP_NULL_SORT, value); 440 } 441 442 public boolean nullsAreSortedHigh() throws SQLException 443 { 444 Integer nullSort = (Integer )properties.get(PROP_NULL_SORT); 445 if (nullSort != null) return (nullSort.intValue() == NULLSORT_HIGH); 446 if (dmd != null) return dmd.nullsAreSortedAtStart(); 447 throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 449 450 public boolean nullsAreSortedLow() throws SQLException 451 { 452 Integer nullSort = (Integer )properties.get(PROP_NULL_SORT); 453 if (nullSort != null) return (nullSort.intValue() == NULLSORT_LOW); 454 if (dmd != null) return dmd.nullsAreSortedLow(); 455 throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 457 458 public boolean nullsAreSortedAtStart() throws SQLException 459 { 460 Integer nullSort = (Integer )properties.get(PROP_NULL_SORT); 461 if (nullSort != null) return (nullSort.intValue() == NULLSORT_START); 462 if (dmd != null) return dmd.nullsAreSortedAtStart(); 463 throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 465 466 public boolean nullsAreSortedAtEnd() throws SQLException 467 { 468 Integer nullSort = (Integer )properties.get(PROP_NULL_SORT); 469 if (nullSort != null) return (nullSort.intValue() == NULLSORT_END); 470 if (dmd != null) return dmd.nullsAreSortedAtEnd(); 471 throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 473 474 476 public String getDatabaseProductName() throws SQLException 477 { 478 String product = (String )properties.get(PROP_PRODUCTNAME); 479 if (product == null) { 480 if (dmd != null) product = dmd.getDatabaseProductName().trim(); 481 else return NOT_SET_STRING; 482 properties.put(PROP_PRODUCTNAME, product); 483 } 484 485 return product; 486 } 487 488 public void setDatabaseProductName(String value) 489 { 490 setString(PROP_PRODUCTNAME, value); 491 } 492 493 495 public String getDatabaseProductVersion() throws SQLException 496 { 497 String version = (String )properties.get(PROP_PRODUCTVERSION); 498 if (version == null) { 499 if (dmd != null) version = dmd.getDatabaseProductVersion(); 500 else return NOT_SET_STRING; 501 properties.put(PROP_PRODUCTVERSION, version); 502 } 503 504 return version; 505 } 506 507 public void setDatabaseProductVersion(String value) 508 { 509 setString(PROP_PRODUCTVERSION, value); 510 } 511 512 514 public String getDriverName() throws SQLException 515 { 516 String driverName = (String )properties.get(PROP_DRIVERNAME); 517 if (driverName == null) { 518 if (dmd != null) driverName = dmd.getDriverName(); 519 else return NOT_SET_STRING; 520 properties.put(PROP_DRIVERNAME, driverName); 521 } 522 523 return driverName; 524 } 525 526 public void setDriverName(String value) 527 { 528 setString(PROP_DRIVERNAME, value); 529 } 530 531 536 public String getDriverVersion() throws SQLException 537 { 538 String driverVersion = (String )properties.get(PROP_DRIVER_VERSION); 539 if (driverVersion == null) { 540 if (dmd != null) driverVersion = dmd.getDriverVersion(); 541 else return NOT_SET_STRING; 542 properties.put(PROP_DRIVER_VERSION, driverVersion); 543 } 544 545 return driverVersion; 546 } 547 548 public void setDriverVersion(String value) 549 { 550 setString(PROP_DRIVER_VERSION, value); 551 } 552 553 557 public int getDriverMajorVersion() 558 { 559 Integer driverMajorVersion = (Integer )properties.get(PROP_DRIVER_MAJOR_VERSION); 560 if (driverMajorVersion == null) { 561 if (dmd != null) driverMajorVersion = new Integer (dmd.getDriverMajorVersion()); 562 else driverMajorVersion = new Integer (NOT_SET); 563 properties.put(PROP_DRIVER_MAJOR_VERSION, driverMajorVersion); 564 } 565 566 return driverMajorVersion.intValue(); 567 } 568 569 public void setDriverMajorVersion(int value) 570 { 571 setInt(PROP_DRIVER_MAJOR_VERSION, value); 572 } 573 574 578 public int getDriverMinorVersion() 579 { 580 Integer driverMinorVersion = (Integer )properties.get(PROP_DRIVER_MINOR_VERSION); 581 if (driverMinorVersion == null) { 582 if (dmd != null) driverMinorVersion = new Integer (dmd.getDriverMinorVersion()); 583 else driverMinorVersion = new Integer (NOT_SET); 584 properties.put(PROP_DRIVER_MINOR_VERSION, driverMinorVersion); 585 } 586 587 return driverMinorVersion.intValue(); 588 } 589 590 public void setDriverMinorVersion(int value) 591 { 592 setInt(PROP_DRIVER_MINOR_VERSION, value); 593 } 594 595 600 public boolean usesLocalFiles() throws SQLException 601 { 602 Boolean localFiles = (Boolean )properties.get(PROP_LOCAL_FILES); 603 if (localFiles == null) { 604 if (dmd != null) localFiles = dmd.usesLocalFiles() ? Boolean.TRUE : Boolean.FALSE; 605 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_LOCAL_FILES, localFiles); 607 } 608 609 return localFiles.booleanValue(); 610 } 611 612 public int getLocalFiles() 613 { 614 return getBoolean(PROP_LOCAL_FILES); 615 } 616 617 public void setLocalFiles(int value) 618 { 619 setBoolean(PROP_LOCAL_FILES, value); 620 } 621 622 627 public boolean usesLocalFilePerTable() throws SQLException 628 { 629 Boolean filePerTable = (Boolean )properties.get(PROP_FILE_PER_TABLE); 630 if (filePerTable == null) { 631 if (dmd != null) filePerTable = dmd.usesLocalFilePerTable() ? Boolean.TRUE : Boolean.FALSE; 632 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_FILE_PER_TABLE, filePerTable); 634 } 635 636 return filePerTable.booleanValue(); 637 } 638 639 public int getLocalFilePerTable() 640 { 641 return getBoolean(PROP_FILE_PER_TABLE); 642 } 643 644 public void setLocalFilePerTable(int value) 645 { 646 setBoolean(PROP_FILE_PER_TABLE, value); 647 } 648 649 654 public boolean supportsMixedCaseIdentifiers() throws SQLException 655 { 656 Boolean mixedCaseIdentifiers = (Boolean )properties.get(PROP_MIXEDCASE_IDENTIFIERS); 657 if (mixedCaseIdentifiers == null) { 658 if (dmd != null) mixedCaseIdentifiers = dmd.supportsMixedCaseIdentifiers() ? Boolean.TRUE : Boolean.FALSE; 659 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_MIXEDCASE_IDENTIFIERS, mixedCaseIdentifiers); 661 } 662 663 return mixedCaseIdentifiers.booleanValue(); 664 } 665 666 public int getMixedCaseIdentifiers() 667 { 668 return getBoolean(PROP_MIXEDCASE_IDENTIFIERS); 669 } 670 671 public void setMixedCaseIdentifiers(int value) 672 { 673 setBoolean(PROP_MIXEDCASE_IDENTIFIERS, value); 674 } 675 676 678 public int getIdentifierStore() 679 { 680 return getInt(PROP_IDENTIFIER_STORE); 681 } 682 683 public void setIdentifierStore(int value) 684 { 685 setInt(PROP_IDENTIFIER_STORE, value); 686 } 687 688 694 public boolean storesUpperCaseIdentifiers() throws SQLException 695 { 696 Integer identStore = (Integer )properties.get(PROP_IDENTIFIER_STORE); 697 if (identStore != null) return (identStore.intValue() == STORE_UPPERCASE); 698 if (dmd != null) return dmd.storesUpperCaseIdentifiers(); 699 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 701 702 708 public boolean storesLowerCaseIdentifiers() throws SQLException 709 { 710 Integer identStore = (Integer )properties.get(PROP_IDENTIFIER_STORE); 711 if (identStore != null) return (identStore.intValue() == STORE_LOWERCASE); 712 if (dmd != null) return dmd.storesLowerCaseIdentifiers(); 713 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 715 716 722 public boolean storesMixedCaseIdentifiers() throws SQLException 723 { 724 Integer identStore = (Integer )properties.get(PROP_IDENTIFIER_STORE); 725 if (identStore != null) return (identStore.intValue() == STORE_MIXEDCASE); 726 if (dmd != null) return dmd.storesLowerCaseIdentifiers(); 727 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 729 730 737 public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException 738 { 739 Boolean mixedCaseQuotedIdentifiers = (Boolean )properties.get(PROP_MIXEDCASE_QUOTED_IDENTIFIERS); 740 if (mixedCaseQuotedIdentifiers == null) { 741 if (dmd != null) mixedCaseQuotedIdentifiers = dmd.supportsMixedCaseQuotedIdentifiers() ? Boolean.TRUE : Boolean.FALSE; 742 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_MIXEDCASE_QUOTED_IDENTIFIERS, mixedCaseQuotedIdentifiers); 744 } 745 746 return mixedCaseQuotedIdentifiers.booleanValue(); 747 } 748 749 public int getMixedCaseQuotedIdentifiers() 750 { 751 return getBoolean(PROP_MIXEDCASE_QUOTED_IDENTIFIERS); 752 } 753 754 public void setMixedCaseQuotedIdentifiers(int value) 755 { 756 setBoolean(PROP_MIXEDCASE_QUOTED_IDENTIFIERS, value); 757 } 758 759 761 public int getQuotedIdentifierStore() 762 { 763 return getInt(PROP_QUOTED_IDENTS); 764 } 765 766 public void setQuotedIdentifierStore(int value) 767 { 768 setInt(PROP_QUOTED_IDENTS, value); 769 } 770 771 777 public boolean storesUpperCaseQuotedIdentifiers() throws SQLException 778 { 779 Integer identQuotedStore = (Integer )properties.get(PROP_QUOTED_IDENTS); 780 if (identQuotedStore != null) return (identQuotedStore.intValue() == STORE_UPPERCASE); 781 if (dmd != null) return dmd.storesUpperCaseQuotedIdentifiers(); 782 throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 784 785 791 public boolean storesLowerCaseQuotedIdentifiers() throws SQLException 792 { 793 Integer identQuotedStore = (Integer )properties.get(PROP_QUOTED_IDENTS); 794 if (identQuotedStore != null) return (identQuotedStore.intValue() == STORE_LOWERCASE); 795 if (dmd != null) return dmd.storesLowerCaseQuotedIdentifiers(); 796 throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 798 799 804 public boolean storesMixedCaseQuotedIdentifiers() throws SQLException 805 { 806 Integer identQuotedStore = (Integer )properties.get(PROP_QUOTED_IDENTS); 807 if (identQuotedStore != null) return (identQuotedStore.intValue() == STORE_MIXEDCASE); 808 if (dmd != null) return dmd.storesMixedCaseQuotedIdentifiers(); 809 throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 811 812 818 public String getIdentifierQuoteString() throws SQLException 819 { 820 String identifierQuoteString = (String )properties.get(PROP_IDENTIFIER_QUOTE); 821 if (identifierQuoteString == null) { 822 if (dmd != null) identifierQuoteString = dmd.getIdentifierQuoteString(); 823 else return NOT_SET_STRING; 824 properties.put(PROP_IDENTIFIER_QUOTE, identifierQuoteString); 825 } 826 827 return identifierQuoteString; 828 } 829 830 public void setIdentifierQuoteString(String value) 831 { 832 setString(PROP_IDENTIFIER_QUOTE, value); 833 } 834 835 841 public String getSQLKeywords() throws SQLException 842 { 843 String sqlKeywords = (String )properties.get(PROP_SQL_KEYWORDS); 844 if (sqlKeywords == null) { 845 if (dmd != null) sqlKeywords = dmd.getSQLKeywords(); 846 else return NOT_SET_STRING; 847 properties.put(PROP_SQL_KEYWORDS, sqlKeywords); 848 } 849 850 return sqlKeywords; 851 } 852 853 public void setSQLKeywords(String value) 854 { 855 setString(PROP_SQL_KEYWORDS, value); 856 } 857 858 865 public String getNumericFunctions() throws SQLException 866 { 867 String numericFunctions = (String )properties.get(PROP_NUMERIC_FUNCTIONS); 868 if (numericFunctions == null) { 869 if (dmd != null) numericFunctions = dmd.getNumericFunctions(); 870 else return NOT_SET_STRING; 871 properties.put(PROP_NUMERIC_FUNCTIONS, numericFunctions); 872 } 873 874 return numericFunctions; 875 } 876 877 public void setNumericFunctions(String value) 878 { 879 setString(PROP_NUMERIC_FUNCTIONS, value); 880 } 881 882 889 public String getStringFunctions() throws SQLException 890 { 891 String stringFunctions = (String )properties.get(PROP_STRING_FUNCTIONS); 892 if (stringFunctions == null) { 893 if (dmd != null) stringFunctions = dmd.getStringFunctions(); 894 else return NOT_SET_STRING; 895 properties.put(PROP_STRING_FUNCTIONS, stringFunctions); 896 } 897 898 return stringFunctions; 899 } 900 901 public void setStringFunctions(String value) 902 { 903 setString(PROP_STRING_FUNCTIONS, value); 904 } 905 906 913 public String getSystemFunctions() throws SQLException 914 { 915 String systemFunctions = (String )properties.get(PROP_SYSTEM_FUNCTIONS); 916 if (systemFunctions == null) { 917 if (dmd != null) systemFunctions = dmd.getSystemFunctions(); 918 else return NOT_SET_STRING; 919 properties.put(PROP_SYSTEM_FUNCTIONS, systemFunctions); 920 } 921 922 return systemFunctions; 923 } 924 925 public void setSystemFunctions(String value) 926 { 927 setString(PROP_SYSTEM_FUNCTIONS, value); 928 } 929 930 935 public String getTimeDateFunctions() throws SQLException 936 { 937 String timeFunctions = (String )properties.get(PROP_TIME_FUNCTIONS); 938 if (timeFunctions == null) { 939 if (dmd != null) timeFunctions = dmd.getTimeDateFunctions(); 940 else return NOT_SET_STRING; 941 properties.put(PROP_TIME_FUNCTIONS, timeFunctions); 942 } 943 944 return timeFunctions; 945 } 946 947 public void setTimeDateFunctions(String value) 948 { 949 setString(PROP_TIME_FUNCTIONS, value); 950 } 951 952 962 public String getSearchStringEscape() throws SQLException 963 { 964 String stringEscape = (String )properties.get(PROP_STRING_ESCAPE); 965 if (stringEscape == null) { 966 if (dmd != null) stringEscape = dmd.getSearchStringEscape(); 967 else return NOT_SET_STRING; 968 properties.put(PROP_STRING_ESCAPE, stringEscape); 969 } 970 971 return stringEscape; 972 } 973 974 public void setSearchStringEscape(String value) 975 { 976 setString(PROP_STRING_ESCAPE, value); 977 } 978 979 985 public String getExtraNameCharacters() throws SQLException 986 { 987 String extraCharacters = (String )properties.get(PROP_EXTRA_CHARACTERS); 988 if (extraCharacters == null) { 989 if (dmd != null) extraCharacters = dmd.getExtraNameCharacters(); 990 else return NOT_SET_STRING; 991 properties.put(PROP_EXTRA_CHARACTERS, extraCharacters); 992 } 993 994 return extraCharacters; 995 } 996 997 public void setExtraNameCharacters(String value) 998 { 999 setString(PROP_EXTRA_CHARACTERS, value); 1000 } 1001 1002 1006 public boolean supportsAlterTableWithAddColumn() throws SQLException 1007 { 1008 Boolean alterAdd = (Boolean )properties.get(PROP_ALTER_ADD); 1009 if (alterAdd == null) { 1010 if (dmd != null) alterAdd = dmd.supportsAlterTableWithAddColumn() ? Boolean.TRUE : Boolean.FALSE; 1011 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_ALTER_ADD, alterAdd); 1013 } 1014 1015 return alterAdd.booleanValue(); 1016 } 1017 1018 public int getAlterTableWithAddColumn() 1019 { 1020 return getBoolean(PROP_ALTER_ADD); 1021 } 1022 1023 public void setAlterTableWithAddColumn(int value) 1024 { 1025 setBoolean(PROP_ALTER_ADD, value); 1026 } 1027 1028 1033 public boolean supportsAlterTableWithDropColumn() throws SQLException 1034 { 1035 Boolean alterDrop = (Boolean )properties.get(PROP_ALTER_DROP); 1036 if (alterDrop == null) { 1037 if (dmd != null) alterDrop = dmd.supportsAlterTableWithDropColumn() ? Boolean.TRUE : Boolean.FALSE; 1038 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_ALTER_DROP, alterDrop); 1040 } 1041 1042 return alterDrop.booleanValue(); 1043 } 1044 1045 public int getAlterTableWithDropColumn() 1046 { 1047 return getBoolean(PROP_ALTER_DROP); 1048 } 1049 1050 public void setAlterTableWithDropColumn(int value) 1051 { 1052 setBoolean(PROP_ALTER_DROP, value); 1053 } 1054 1055 1062 public boolean supportsColumnAliasing() throws SQLException 1063 { 1064 Boolean columnAliasing = (Boolean )properties.get(PROP_COLUMN_ALIASING); 1065 if (columnAliasing == null) { 1066 if (dmd != null) columnAliasing = dmd.supportsColumnAliasing() ? Boolean.TRUE : Boolean.FALSE; 1067 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_COLUMN_ALIASING, columnAliasing); 1069 } 1070 1071 return columnAliasing.booleanValue(); 1072 } 1073 1074 public int getColumnAliasing() 1075 { 1076 return getBoolean(PROP_COLUMN_ALIASING); 1077 } 1078 1079 public void setColumnAliasing(int value) 1080 { 1081 setBoolean(PROP_COLUMN_ALIASING, value); 1082 } 1083 1084 1089 public boolean nullPlusNonNullIsNull() throws SQLException 1090 { 1091 Boolean nullPlusNull = (Boolean )properties.get(PROP_NULL_PLUS_NULL_IS_NULL); 1092 if (nullPlusNull == null) { 1093 if (dmd != null) nullPlusNull = dmd.nullPlusNonNullIsNull() ? Boolean.TRUE : Boolean.FALSE; 1094 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_NULL_PLUS_NULL_IS_NULL, nullPlusNull); 1096 } 1097 1098 return nullPlusNull.booleanValue(); 1099 } 1100 1101 public int getNullPlusNonNullIsNull() 1102 { 1103 return getBoolean(PROP_NULL_PLUS_NULL_IS_NULL); 1104 } 1105 1106 public void setNullPlusNonNullIsNull(int value) 1107 { 1108 setBoolean(PROP_NULL_PLUS_NULL_IS_NULL, value); 1109 } 1110 1111 1116 public boolean supportsConvert() throws SQLException 1117 { 1118 Boolean supportsConvert = (Boolean )properties.get(PROP_CONVERT); 1119 if (supportsConvert == null) { 1120 if (dmd != null) supportsConvert = dmd.supportsConvert() ? Boolean.TRUE : Boolean.FALSE; 1121 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_CONVERT, supportsConvert); 1123 } 1124 1125 return supportsConvert.booleanValue(); 1126 } 1127 1128 public int getConvert() 1129 { 1130 return getBoolean(PROP_CONVERT); 1131 } 1132 1133 public void setConvert(int value) 1134 { 1135 setBoolean(PROP_CONVERT, value); 1136 } 1137 1138 1144 public boolean supportsConvert(int fromType, int toType) throws SQLException 1145 { 1146 if (dmd != null) return dmd.supportsConvert(fromType, toType); 1147 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 1149 1150 1156 public boolean supportsTableCorrelationNames() throws SQLException 1157 { 1158 Boolean nameCorrelation = (Boolean )properties.get(PROP_TABLE_CORRELATION_NAMES); 1159 if (nameCorrelation == null) { 1160 if (dmd != null) nameCorrelation = dmd.supportsTableCorrelationNames() ? Boolean.TRUE : Boolean.FALSE; 1161 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_TABLE_CORRELATION_NAMES, nameCorrelation); 1163 } 1164 1165 return nameCorrelation.booleanValue(); 1166 } 1167 1168 public int getTableCorrelationNames() 1169 { 1170 return getBoolean(PROP_TABLE_CORRELATION_NAMES); 1171 } 1172 1173 public void setTableCorrelationNames(int value) 1174 { 1175 setBoolean(PROP_TABLE_CORRELATION_NAMES, value); 1176 } 1177 1178 1183 public boolean supportsDifferentTableCorrelationNames() throws SQLException 1184 { 1185 Boolean tableCorrelation = (Boolean )properties.get(PROP_DIFF_TABLE_CORRELATION_NAMES); 1186 if (tableCorrelation == null) { 1187 if (dmd != null) tableCorrelation = dmd.supportsDifferentTableCorrelationNames() ? Boolean.TRUE : Boolean.FALSE; 1188 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_DIFF_TABLE_CORRELATION_NAMES, tableCorrelation); 1190 } 1191 1192 return tableCorrelation.booleanValue(); 1193 } 1194 1195 public int getDifferentTableCorrelationNames() 1196 { 1197 return getBoolean(PROP_DIFF_TABLE_CORRELATION_NAMES); 1198 } 1199 1200 public void setDifferentTableCorrelationNames(int value) 1201 { 1202 setBoolean(PROP_DIFF_TABLE_CORRELATION_NAMES, value); 1203 } 1204 1205 1210 public boolean supportsExpressionsInOrderBy() throws SQLException 1211 { 1212 Boolean ordering = (Boolean )properties.get(PROP_EXPRESSIONS_IN_ORDERBY); 1213 if (ordering == null) { 1214 if (dmd != null) ordering = dmd.supportsExpressionsInOrderBy() ? Boolean.TRUE : Boolean.FALSE; 1215 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_EXPRESSIONS_IN_ORDERBY, ordering); 1217 } 1218 1219 return ordering.booleanValue(); 1220 } 1221 1222 public int getExpressionsInOrderBy() 1223 { 1224 return getBoolean(PROP_EXPRESSIONS_IN_ORDERBY); 1225 } 1226 1227 public void setExpressionsInOrderBy(int value) 1228 { 1229 setBoolean(PROP_EXPRESSIONS_IN_ORDERBY, value); 1230 } 1231 1232 1237 public boolean supportsOrderByUnrelated() throws SQLException 1238 { 1239 Boolean unrelatedOrdering = (Boolean )properties.get(PROP_ORDER_BY_UNRELATED); 1240 if (unrelatedOrdering == null) { 1241 if (dmd != null) unrelatedOrdering = dmd.supportsOrderByUnrelated() ? Boolean.TRUE : Boolean.FALSE; 1242 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_ORDER_BY_UNRELATED, unrelatedOrdering); 1244 } 1245 1246 return unrelatedOrdering.booleanValue(); 1247 } 1248 1249 public int getOrderByUnrelated() 1250 { 1251 return getBoolean(PROP_ORDER_BY_UNRELATED); 1252 } 1253 1254 public void setOrderByUnrelated(int value) 1255 { 1256 setBoolean(PROP_ORDER_BY_UNRELATED, value); 1257 } 1258 1259 1263 public boolean supportsGroupBy() throws SQLException 1264 { 1265 Boolean groupBy = (Boolean )properties.get(PROP_GROUP_BY); 1266 if (groupBy == null) { 1267 if (dmd != null) groupBy = dmd.supportsGroupBy() ? Boolean.TRUE : Boolean.FALSE; 1268 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_GROUP_BY, groupBy); 1270 } 1271 1272 return groupBy.booleanValue(); 1273 } 1274 1275 public int getGroupBy() 1276 { 1277 return getBoolean(PROP_GROUP_BY); 1278 } 1279 1280 public void setGroupBy(int value) 1281 { 1282 setBoolean(PROP_GROUP_BY, value); 1283 } 1284 1285 1290 public boolean supportsGroupByUnrelated() throws SQLException 1291 { 1292 Boolean unrelatedGroupBy = (Boolean )properties.get(PROP_UNRELATED_GROUP_BY); 1293 if (unrelatedGroupBy == null) { 1294 if (dmd != null) unrelatedGroupBy = dmd.supportsGroupByUnrelated() ? Boolean.TRUE : Boolean.FALSE; 1295 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_UNRELATED_GROUP_BY, unrelatedGroupBy); 1297 } 1298 1299 return unrelatedGroupBy.booleanValue(); 1300 } 1301 1302 public int getGroupByUnrelated() 1303 { 1304 return getBoolean(PROP_UNRELATED_GROUP_BY); 1305 } 1306 1307 public void setGroupByUnrelated(int value) 1308 { 1309 setBoolean(PROP_UNRELATED_GROUP_BY, value); 1310 } 1311 1312 1317 public boolean supportsGroupByBeyondSelect() throws SQLException 1318 { 1319 Boolean beyondGroupBy = (Boolean )properties.get(PROP_BEYOND_GROUP_BY); 1320 if (beyondGroupBy == null) { 1321 if (dmd != null) beyondGroupBy = dmd.supportsGroupByBeyondSelect() ? Boolean.TRUE : Boolean.FALSE; 1322 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_BEYOND_GROUP_BY, beyondGroupBy); 1324 } 1325 1326 return beyondGroupBy.booleanValue(); 1327 } 1328 1329 public int getGroupByBeyondSelect() 1330 { 1331 return getBoolean(PROP_BEYOND_GROUP_BY); 1332 } 1333 1334 public void setGroupByBeyondSelect(int value) 1335 { 1336 setBoolean(PROP_BEYOND_GROUP_BY, value); 1337 } 1338 1339 1345 public boolean supportsLikeEscapeClause() throws SQLException 1346 { 1347 Boolean escapeLike = (Boolean )properties.get(PROP_ESCAPE_LIKE); 1348 if (escapeLike == null) { 1349 if (dmd != null) escapeLike = dmd.supportsLikeEscapeClause() ? Boolean.TRUE : Boolean.FALSE; 1350 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_ESCAPE_LIKE, escapeLike); 1352 } 1353 1354 return escapeLike.booleanValue(); 1355 } 1356 1357 public int getLikeEscapeClause() 1358 { 1359 return getBoolean(PROP_ESCAPE_LIKE); 1360 } 1361 1362 public void setLikeEscapeClause(int value) 1363 { 1364 setBoolean(PROP_ESCAPE_LIKE, value); 1365 } 1366 1367 1372 public boolean supportsMultipleResultSets() throws SQLException 1373 { 1374 Boolean multipleResultSets = (Boolean )properties.get(PROP_MULTIPLE_RS); 1375 if (multipleResultSets == null) { 1376 if (dmd != null) multipleResultSets = dmd.supportsMultipleResultSets() ? Boolean.TRUE : Boolean.FALSE; 1377 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_MULTIPLE_RS, multipleResultSets); 1379 } 1380 1381 return multipleResultSets.booleanValue(); 1382 } 1383 1384 public int getMultipleResultSets() 1385 { 1386 return getBoolean(PROP_MULTIPLE_RS); 1387 } 1388 1389 public void setMultipleResultSets(int value) 1390 { 1391 setBoolean(PROP_MULTIPLE_RS, value); 1392 } 1393 1394 1400 public boolean supportsMultipleTransactions() throws SQLException 1401 { 1402 Boolean multipleTransactions = (Boolean )properties.get(PROP_MULTIPLE_TRANSACTIONS); 1403 if (multipleTransactions == null) { 1404 if (dmd != null) multipleTransactions = dmd.supportsMultipleTransactions() ? Boolean.TRUE : Boolean.FALSE; 1405 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_MULTIPLE_TRANSACTIONS, multipleTransactions); 1407 } 1408 1409 return multipleTransactions.booleanValue(); 1410 } 1411 1412 public int getMultipleTransactions() 1413 { 1414 return getBoolean(PROP_MULTIPLE_TRANSACTIONS); 1415 } 1416 1417 public void setMultipleTransactions(int value) 1418 { 1419 setBoolean(PROP_MULTIPLE_TRANSACTIONS, value); 1420 } 1421 1422 1427 public boolean supportsNonNullableColumns() throws SQLException 1428 { 1429 Boolean nunNullableColumns = (Boolean )properties.get(PROP_NON_NULL_COLUMNSS); 1430 if (nunNullableColumns == null) { 1431 if (dmd != null) nunNullableColumns = dmd.supportsNonNullableColumns() ? Boolean.TRUE : Boolean.FALSE; 1432 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_NON_NULL_COLUMNSS, nunNullableColumns); 1434 } 1435 1436 return nunNullableColumns.booleanValue(); 1437 } 1438 1439 public int getNonNullableColumns() 1440 { 1441 return getBoolean(PROP_NON_NULL_COLUMNSS); 1442 } 1443 1444 public void setNonNullableColumns(int value) 1445 { 1446 setBoolean(PROP_NON_NULL_COLUMNSS, value); 1447 } 1448 1449 1455 public boolean supportsMinimumSQLGrammar() throws SQLException 1456 { 1457 Boolean minimumSQLGrammar = (Boolean )properties.get(PROP_MINUMUM_SQL_GRAMMAR); 1458 if (minimumSQLGrammar == null) { 1459 if (dmd != null) minimumSQLGrammar = dmd.supportsMinimumSQLGrammar() ? Boolean.TRUE : Boolean.FALSE; 1460 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_MINUMUM_SQL_GRAMMAR, minimumSQLGrammar); 1462 } 1463 1464 return minimumSQLGrammar.booleanValue(); 1465 } 1466 1467 public int getMinimumSQLGrammar() 1468 { 1469 return getBoolean(PROP_MINUMUM_SQL_GRAMMAR); 1470 } 1471 1472 public void setMinimumSQLGrammar(int value) 1473 { 1474 setBoolean(PROP_MINUMUM_SQL_GRAMMAR, value); 1475 } 1476 1477 1482 public boolean supportsCoreSQLGrammar() throws SQLException 1483 { 1484 Boolean coreSQLGrammar = (Boolean )properties.get(PROP_CORE_SQL_GRAMMAR); 1485 if (coreSQLGrammar == null) { 1486 if (dmd != null) coreSQLGrammar = dmd.supportsCoreSQLGrammar() ? Boolean.TRUE : Boolean.FALSE; 1487 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_CORE_SQL_GRAMMAR, coreSQLGrammar); 1489 } 1490 1491 return coreSQLGrammar.booleanValue(); 1492 } 1493 1494 public int getCoreSQLGrammar() 1495 { 1496 return getBoolean(PROP_CORE_SQL_GRAMMAR); 1497 } 1498 1499 public void setCoreSQLGrammar(int value) 1500 { 1501 setBoolean(PROP_CORE_SQL_GRAMMAR, value); 1502 } 1503 1504 1508 public boolean supportsExtendedSQLGrammar() throws SQLException 1509 { 1510 Boolean extendedSQLGrammar = (Boolean )properties.get(PROP_EXTENDED_SQL_GRAMMAR); 1511 if (extendedSQLGrammar == null) { 1512 if (dmd != null) extendedSQLGrammar = dmd.supportsExtendedSQLGrammar() ? Boolean.TRUE : Boolean.FALSE; 1513 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_EXTENDED_SQL_GRAMMAR, extendedSQLGrammar); 1515 } 1516 1517 return extendedSQLGrammar.booleanValue(); 1518 } 1519 1520 public int getExtendedSQLGrammar() 1521 { 1522 return getBoolean(PROP_EXTENDED_SQL_GRAMMAR); 1523 } 1524 1525 public void setExtendedSQLGrammar(int value) 1526 { 1527 setBoolean(PROP_EXTENDED_SQL_GRAMMAR, value); 1528 } 1529 1530 1536 public boolean supportsANSI92EntryLevelSQL() throws SQLException 1537 { 1538 Boolean ansiSQLGrammar = (Boolean )properties.get(PROP_ANSI_SQL_GRAMMAR); 1539 if (ansiSQLGrammar == null) { 1540 if (dmd != null) ansiSQLGrammar = dmd.supportsANSI92EntryLevelSQL() ? Boolean.TRUE : Boolean.FALSE; 1541 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_ANSI_SQL_GRAMMAR, ansiSQLGrammar); 1543 } 1544 1545 return ansiSQLGrammar.booleanValue(); 1546 } 1547 1548 public int getANSI92EntryLevelSQL() 1549 { 1550 return getBoolean(PROP_ANSI_SQL_GRAMMAR); 1551 } 1552 1553 public void setANSI92EntryLevelSQL(int value) 1554 { 1555 setBoolean(PROP_ANSI_SQL_GRAMMAR, value); 1556 } 1557 1558 1562 public boolean supportsANSI92IntermediateSQL() throws SQLException 1563 { 1564 Boolean ansiInterSQLGrammar = (Boolean )properties.get(PROP_INTERMEDIATE_SQL_GRAMMAR); 1565 if (ansiInterSQLGrammar == null) { 1566 if (dmd != null) ansiInterSQLGrammar = dmd.supportsANSI92IntermediateSQL() ? Boolean.TRUE : Boolean.FALSE; 1567 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_INTERMEDIATE_SQL_GRAMMAR, ansiInterSQLGrammar); 1569 } 1570 1571 return ansiInterSQLGrammar.booleanValue(); 1572 } 1573 1574 public int getANSI92IntermediateSQL() 1575 { 1576 return getBoolean(PROP_INTERMEDIATE_SQL_GRAMMAR); 1577 } 1578 1579 public void setANSI92IntermediateSQL(int value) 1580 { 1581 setBoolean(PROP_INTERMEDIATE_SQL_GRAMMAR, value); 1582 } 1583 1584 1588 public boolean supportsANSI92FullSQL() throws SQLException 1589 { 1590 Boolean ansiFullSQLGrammar = (Boolean )properties.get(PROP_FULL_SQL_GRAMMAR); 1591 if (ansiFullSQLGrammar == null) { 1592 if (dmd != null) ansiFullSQLGrammar = dmd.supportsANSI92FullSQL() ? Boolean.TRUE : Boolean.FALSE; 1593 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_FULL_SQL_GRAMMAR, ansiFullSQLGrammar); 1595 } 1596 1597 return ansiFullSQLGrammar.booleanValue(); 1598 } 1599 1600 public int getANSI92FullSQL() 1601 { 1602 return getBoolean(PROP_FULL_SQL_GRAMMAR); 1603 } 1604 1605 public void setANSI92FullSQL(int value) 1606 { 1607 setBoolean(PROP_FULL_SQL_GRAMMAR, value); 1608 } 1609 1610 1615 public boolean supportsIntegrityEnhancementFacility() throws SQLException 1616 { 1617 Boolean integrityEnh = (Boolean )properties.get(PROP_INTEGRITY_ENHANCEMENT); 1618 if (integrityEnh == null) { 1619 if (dmd != null) integrityEnh = dmd.supportsIntegrityEnhancementFacility() ? Boolean.TRUE : Boolean.FALSE; 1620 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_INTEGRITY_ENHANCEMENT, integrityEnh); 1622 } 1623 1624 return integrityEnh.booleanValue(); 1625 } 1626 1627 public int getIntegrityEnhancementFacility() 1628 { 1629 return getBoolean(PROP_INTEGRITY_ENHANCEMENT); 1630 } 1631 1632 public void setIntegrityEnhancementFacility(int value) 1633 { 1634 setBoolean(PROP_INTEGRITY_ENHANCEMENT, value); 1635 } 1636 1637 1642 public boolean supportsOuterJoins() throws SQLException 1643 { 1644 Boolean outerJoins = (Boolean )properties.get(PROP_OUTER_JOINS); 1645 if (outerJoins == null) { 1646 if (dmd != null) outerJoins = dmd.supportsOuterJoins() ? Boolean.TRUE : Boolean.FALSE; 1647 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_OUTER_JOINS, outerJoins); 1649 } 1650 1651 return outerJoins.booleanValue(); 1652 } 1653 1654 public int getOuterJoins() 1655 { 1656 return getBoolean(PROP_OUTER_JOINS); 1657 } 1658 1659 public void setOuterJoins(int value) 1660 { 1661 setBoolean(PROP_OUTER_JOINS, value); 1662 } 1663 1664 1669 public boolean supportsFullOuterJoins() throws SQLException 1670 { 1671 Boolean fullOuterJoins = (Boolean )properties.get(PROP_FULL_OUTER_JOINS); 1672 if (fullOuterJoins == null) { 1673 if (dmd != null) fullOuterJoins = dmd.supportsFullOuterJoins() ? Boolean.TRUE : Boolean.FALSE; 1674 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_FULL_OUTER_JOINS, fullOuterJoins); 1676 } 1677 1678 return fullOuterJoins.booleanValue(); 1679 } 1680 1681 public int getFullOuterJoins() 1682 { 1683 return getBoolean(PROP_FULL_OUTER_JOINS); 1684 } 1685 1686 public void setFullOuterJoins(int value) 1687 { 1688 setBoolean(PROP_FULL_OUTER_JOINS, value); 1689 } 1690 1691 1697 public boolean supportsLimitedOuterJoins() throws SQLException 1698 { 1699 Boolean limiterOuterJoins = (Boolean )properties.get(PROP_LIMITED_OUTER_JOINS); 1700 if (limiterOuterJoins == null) { 1701 if (dmd != null) limiterOuterJoins = dmd.supportsLimitedOuterJoins() ? Boolean.TRUE : Boolean.FALSE; 1702 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_LIMITED_OUTER_JOINS, limiterOuterJoins); 1704 } 1705 1706 return limiterOuterJoins.booleanValue(); 1707 } 1708 1709 public int getLimitedOuterJoins() 1710 { 1711 return getBoolean(PROP_LIMITED_OUTER_JOINS); 1712 } 1713 1714 public void setLimitedOuterJoins(int value) 1715 { 1716 setBoolean(PROP_LIMITED_OUTER_JOINS, value); 1717 } 1718 1719 1725 public String getSchemaTerm() throws SQLException 1726 { 1727 String schemaTerm = (String )properties.get(PROP_SCHEMA_TERM); 1728 if (schemaTerm == null) { 1729 if (dmd != null) schemaTerm = dmd.getSchemaTerm(); 1730 else return NOT_SET_STRING; 1731 properties.put(PROP_SCHEMA_TERM, schemaTerm); 1732 } 1733 1734 return schemaTerm; 1735 } 1736 1737 public void setSchemaTerm(String value) 1738 { 1739 setString(PROP_SCHEMA_TERM, value); 1740 } 1741 1742 1748 public String getProcedureTerm() throws SQLException 1749 { 1750 String procedureTerm = (String )properties.get(PROP_PROCEDURE_TERM); 1751 if (procedureTerm == null) { 1752 if (dmd != null) procedureTerm = dmd.getProcedureTerm(); 1753 else return NOT_SET_STRING; 1754 properties.put(PROP_PROCEDURE_TERM, procedureTerm); 1755 } 1756 1757 return procedureTerm; 1758 } 1759 1760 public void setProcedureTerm(String value) 1761 { 1762 setString(PROP_PROCEDURE_TERM, value); 1763 } 1764 1765 1771 public String getCatalogTerm() throws SQLException 1772 { 1773 String catalogTerm = (String )properties.get(PROP_CATALOG_TERM); 1774 if (catalogTerm == null) { 1775 if (dmd != null) catalogTerm = dmd.getCatalogTerm(); 1776 else return NOT_SET_STRING; 1777 properties.put(PROP_CATALOG_TERM, catalogTerm); 1778 } 1779 1780 return catalogTerm; 1781 } 1782 1783 public void setCatalogTerm(String value) 1784 { 1785 setString(PROP_CATALOG_TERM, value); 1786 } 1787 1788 1794 1795 public boolean isCatalogAtStart() throws SQLException { 1796 Boolean catalogAtStart = (Boolean )properties.get(PROP_CATALOG_AT_START); 1797 if (catalogAtStart == null) { 1798 if (dmd != null) 1799 catalogAtStart = dmd.isCatalogAtStart() ? Boolean.TRUE : Boolean.FALSE; 1800 else 1801 throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_CATALOG_AT_START, catalogAtStart); 1803 } 1804 1805 return catalogAtStart.booleanValue(); 1806 } 1807 1808 public int getcatalogAtStart() { 1810 return getBoolean(PROP_CATALOG_AT_START); 1811 } 1812 1813 public void setcatalogAtStart(int value) { 1815 setBoolean(PROP_CATALOG_AT_START, value); 1816 } 1817 1818 1823 public String getCatalogSeparator() throws SQLException 1824 { 1825 String catalogSeparator = (String )properties.get(PROP_CATALOGS_SEPARATOR); 1826 if (catalogSeparator == null) { 1827 if (dmd != null) catalogSeparator = dmd.getCatalogSeparator(); 1828 else return NOT_SET_STRING; 1829 properties.put(PROP_CATALOGS_SEPARATOR, catalogSeparator); 1830 } 1831 1832 return catalogSeparator; 1833 } 1834 1835 public void setCatalogSeparator(String value) 1836 { 1837 setString(PROP_CATALOGS_SEPARATOR, value); 1838 } 1839 1840 1845 public boolean supportsSchemasInDataManipulation() throws SQLException 1846 { 1847 Boolean schemasInDM = (Boolean )properties.get(PROP_SCHEMAS_IN_DML); 1848 if (schemasInDM == null) { 1849 if (dmd != null) schemasInDM = dmd.supportsSchemasInDataManipulation() ? Boolean.TRUE : Boolean.FALSE; 1850 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_SCHEMAS_IN_DML, schemasInDM); 1852 } 1853 1854 return schemasInDM.booleanValue(); 1855 } 1856 1857 public int getSchemasInDataManipulation() 1858 { 1859 return getBoolean(PROP_SCHEMAS_IN_DML); 1860 } 1861 1862 public void setSchemasInDataManipulation(int value) 1863 { 1864 setBoolean(PROP_SCHEMAS_IN_DML, value); 1865 } 1866 1867 1872 public boolean supportsSchemasInProcedureCalls() throws SQLException 1873 { 1874 Boolean schemasInProcedureCalls = (Boolean )properties.get(PROP_SCHEMAS_IN_PROCEDURE_CALL); 1875 if (schemasInProcedureCalls == null) { 1876 if (dmd != null) schemasInProcedureCalls = dmd.supportsSchemasInProcedureCalls() ? Boolean.TRUE : Boolean.FALSE; 1877 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_SCHEMAS_IN_PROCEDURE_CALL, schemasInProcedureCalls); 1879 } 1880 1881 return schemasInProcedureCalls.booleanValue(); 1882 } 1883 1884 public int getSchemasInProcedureCalls() 1885 { 1886 return getBoolean(PROP_SCHEMAS_IN_PROCEDURE_CALL); 1887 } 1888 1889 public void setSchemasInProcedureCalls(int value) 1890 { 1891 setBoolean(PROP_SCHEMAS_IN_PROCEDURE_CALL, value); 1892 } 1893 1894 1899 public boolean supportsSchemasInTableDefinitions() throws SQLException 1900 { 1901 Boolean schemasInTable = (Boolean )properties.get(PROP_SCHEMAS_IN_TABLE_DEFINITION); 1902 if (schemasInTable == null) { 1903 if (dmd != null) schemasInTable = dmd.supportsSchemasInTableDefinitions() ? Boolean.TRUE : Boolean.FALSE; 1904 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_SCHEMAS_IN_TABLE_DEFINITION, schemasInTable); 1906 } 1907 1908 return schemasInTable.booleanValue(); 1909 } 1910 1911 public int getSchemasInTableDefinitions() 1912 { 1913 return getBoolean(PROP_SCHEMAS_IN_TABLE_DEFINITION); 1914 } 1915 1916 public void setSchemasInTableDefinitions(int value) 1917 { 1918 setBoolean(PROP_SCHEMAS_IN_TABLE_DEFINITION, value); 1919 } 1920 1921 1926 public boolean supportsSchemasInIndexDefinitions() throws SQLException 1927 { 1928 Boolean schemasInIndex = (Boolean )properties.get(PROP_SCHEMAS_IN_INDEX); 1929 if (schemasInIndex == null) { 1930 if (dmd != null) schemasInIndex = dmd.supportsSchemasInIndexDefinitions() ? Boolean.TRUE : Boolean.FALSE; 1931 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_SCHEMAS_IN_INDEX, schemasInIndex); 1933 } 1934 1935 return schemasInIndex.booleanValue(); 1936 } 1937 1938 public int getSchemasInIndexDefinitions() 1939 { 1940 return getBoolean(PROP_SCHEMAS_IN_INDEX); 1941 } 1942 1943 public void setSchemasInIndexDefinitions(int value) 1944 { 1945 setBoolean(PROP_SCHEMAS_IN_INDEX, value); 1946 } 1947 1948 1953 public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException 1954 { 1955 Boolean schemasInPriv = (Boolean )properties.get(PROP_SCHEMAS_IN_PRIVILEGE_DEFINITION); 1956 if (schemasInPriv == null) { 1957 if (dmd != null) schemasInPriv = dmd.supportsSchemasInPrivilegeDefinitions() ? Boolean.TRUE : Boolean.FALSE; 1958 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_SCHEMAS_IN_PRIVILEGE_DEFINITION, schemasInPriv); 1960 } 1961 1962 return schemasInPriv.booleanValue(); 1963 } 1964 1965 public int getSchemasInPrivilegeDefinitions() 1966 { 1967 return getBoolean(PROP_SCHEMAS_IN_PRIVILEGE_DEFINITION); 1968 } 1969 1970 public void setSchemasInPrivilegeDefinitions(int value) 1971 { 1972 setBoolean(PROP_SCHEMAS_IN_PRIVILEGE_DEFINITION, value); 1973 } 1974 1975 1980 public boolean supportsCatalogsInDataManipulation() throws SQLException 1981 { 1982 Boolean catalogInDM = (Boolean )properties.get(PROP_CATALOGS_IN_DML); 1983 if (catalogInDM == null) { 1984 if (dmd != null) catalogInDM = dmd.supportsCatalogsInDataManipulation() ? Boolean.TRUE : Boolean.FALSE; 1985 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_CATALOGS_IN_DML, catalogInDM); 1987 } 1988 1989 return catalogInDM.booleanValue(); 1990 } 1991 1992 public int getCatalogsInDataManipulation() 1993 { 1994 return getBoolean(PROP_CATALOGS_IN_DML); 1995 } 1996 1997 public void setCatalogsInDataManipulation(int value) 1998 { 1999 setBoolean(PROP_CATALOGS_IN_DML, value); 2000 } 2001 2002 2007 public boolean supportsCatalogsInProcedureCalls() throws SQLException 2008 { 2009 Boolean catalogInProc = (Boolean )properties.get(PROP_CATALOGS_IN_PROCEDURE_CALL); 2010 if (catalogInProc == null) { 2011 if (dmd != null) catalogInProc = dmd.supportsCatalogsInProcedureCalls() ? Boolean.TRUE : Boolean.FALSE; 2012 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_CATALOGS_IN_PROCEDURE_CALL, catalogInProc); 2014 } 2015 2016 return catalogInProc.booleanValue(); 2017 } 2018 2019 public int getCatalogsInProcedureCalls() 2020 { 2021 return getBoolean(PROP_CATALOGS_IN_PROCEDURE_CALL); 2022 } 2023 2024 public void setCatalogsInProcedureCalls(int value) 2025 { 2026 setBoolean(PROP_CATALOGS_IN_PROCEDURE_CALL, value); 2027 } 2028 2029 2034 public boolean supportsCatalogsInTableDefinitions() throws SQLException 2035 { 2036 Boolean catalogInTable = (Boolean )properties.get(PROP_CATALOGS_IN_TABLE_DEFINITION); 2037 if (catalogInTable == null) { 2038 if (dmd != null) catalogInTable = dmd.supportsCatalogsInTableDefinitions() ? Boolean.TRUE : Boolean.FALSE; 2039 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_CATALOGS_IN_TABLE_DEFINITION, catalogInTable); 2041 } 2042 2043 return catalogInTable.booleanValue(); 2044 } 2045 2046 public int getCatalogsInTableDefinitions() 2047 { 2048 return getBoolean(PROP_CATALOGS_IN_TABLE_DEFINITION); 2049 } 2050 2051 public void setCatalogsInTableDefinitions(int value) 2052 { 2053 setBoolean(PROP_CATALOGS_IN_TABLE_DEFINITION, value); 2054 } 2055 2056 2061 public boolean supportsCatalogsInIndexDefinitions() throws SQLException 2062 { 2063 Boolean catalogInIndex = (Boolean )properties.get(PROP_CATALOGS_IN_INDEX); 2064 if (catalogInIndex == null) { 2065 if (dmd != null) catalogInIndex = dmd.supportsCatalogsInIndexDefinitions() ? Boolean.TRUE : Boolean.FALSE; 2066 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_CATALOGS_IN_INDEX, catalogInIndex); 2068 } 2069 2070 return catalogInIndex.booleanValue(); 2071 } 2072 2073 public int getCatalogsInIndexDefinitions() 2074 { 2075 return getBoolean(PROP_CATALOGS_IN_INDEX); 2076 } 2077 2078 public void setCatalogsInIndexDefinitions(int value) 2079 { 2080 setBoolean(PROP_CATALOGS_IN_INDEX, value); 2081 } 2082 2083 2088 public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException 2089 { 2090 Boolean catalogInPriv = (Boolean )properties.get(PROP_CATALOGS_IN_PRIVILEGE_DEFINITION); 2091 if (catalogInPriv == null) { 2092 if (dmd != null) catalogInPriv = dmd.supportsCatalogsInPrivilegeDefinitions() ? Boolean.TRUE : Boolean.FALSE; 2093 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_CATALOGS_IN_PRIVILEGE_DEFINITION, catalogInPriv); 2095 } 2096 2097 return catalogInPriv.booleanValue(); 2098 } 2099 2100 public int getCatalogsInPrivilegeDefinitions() 2101 { 2102 return getBoolean(PROP_CATALOGS_IN_PRIVILEGE_DEFINITION); 2103 } 2104 2105 public void setCatalogsInPrivilegeDefinitions(int value) 2106 { 2107 setBoolean(PROP_CATALOGS_IN_PRIVILEGE_DEFINITION, value); 2108 } 2109 2110 2115 public boolean supportsPositionedDelete() throws SQLException 2116 { 2117 Boolean posDelete = (Boolean )properties.get(PROP_POSITIONED_DELETE); 2118 if (posDelete == null) { 2119 if (dmd != null) posDelete = dmd.supportsPositionedDelete() ? Boolean.TRUE : Boolean.FALSE; 2120 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_POSITIONED_DELETE, posDelete); 2122 } 2123 2124 return posDelete.booleanValue(); 2125 } 2126 2127 public int getPositionedDelete() 2128 { 2129 return getBoolean(PROP_POSITIONED_DELETE); 2130 } 2131 2132 public void setPositionedDelete(int value) 2133 { 2134 setBoolean(PROP_POSITIONED_DELETE, value); 2135 } 2136 2137 2142 public boolean supportsPositionedUpdate() throws SQLException 2143 { 2144 Boolean posUpdate = (Boolean )properties.get(PROP_POSITIONED_UPDATE); 2145 if (posUpdate == null) { 2146 if (dmd != null) posUpdate = dmd.supportsPositionedUpdate() ? Boolean.TRUE : Boolean.FALSE; 2147 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_POSITIONED_UPDATE, posUpdate); 2149 } 2150 2151 return posUpdate.booleanValue(); 2152 } 2153 2154 public int getPositionedUpdate() 2155 { 2156 return getBoolean(PROP_POSITIONED_UPDATE); 2157 } 2158 2159 public void setPositionedUpdate(int value) 2160 { 2161 setBoolean(PROP_POSITIONED_UPDATE, value); 2162 } 2163 2164 2169 public boolean supportsSelectForUpdate() throws SQLException 2170 { 2171 Boolean selectForUpdate = (Boolean )properties.get(PROP_SELECT_FOR_UPDATE); 2172 if (selectForUpdate == null) { 2173 if (dmd != null) selectForUpdate = dmd.supportsSelectForUpdate() ? Boolean.TRUE : Boolean.FALSE; 2174 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_SELECT_FOR_UPDATE, selectForUpdate); 2176 } 2177 2178 return selectForUpdate.booleanValue(); 2179 } 2180 2181 public int getSelectForUpdate() 2182 { 2183 return getBoolean(PROP_SELECT_FOR_UPDATE); 2184 } 2185 2186 public void setSelectForUpdate(int value) 2187 { 2188 setBoolean(PROP_SELECT_FOR_UPDATE, value); 2189 } 2190 2191 2197 public boolean supportsStoredProcedures() throws SQLException 2198 { 2199 Boolean storedProcedures = (Boolean )properties.get(PROP_STORED_PROCEDURES); 2200 if (storedProcedures == null) { 2201 if (dmd != null) storedProcedures = dmd.supportsStoredProcedures() ? Boolean.TRUE : Boolean.FALSE; 2202 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_STORED_PROCEDURES, storedProcedures); 2204 } 2205 2206 return storedProcedures.booleanValue(); 2207 } 2208 2209 public int getStoredProcedures() 2210 { 2211 return getBoolean(PROP_STORED_PROCEDURES); 2212 } 2213 2214 public void setStoredProcedures(int value) 2215 { 2216 setBoolean(PROP_STORED_PROCEDURES, value); 2217 } 2218 2219 2225 public boolean supportsSubqueriesInComparisons() throws SQLException 2226 { 2227 Boolean subqueryComp = (Boolean )properties.get(PROP_SUBQUERY_IN_COMPARSIONS); 2228 if (subqueryComp == null) { 2229 if (dmd != null) subqueryComp = dmd.supportsSubqueriesInComparisons() ? Boolean.TRUE : Boolean.FALSE; 2230 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_SUBQUERY_IN_COMPARSIONS, subqueryComp); 2232 } 2233 2234 return subqueryComp.booleanValue(); 2235 } 2236 2237 public int getSubqueriesInComparisons() 2238 { 2239 return getBoolean(PROP_SUBQUERY_IN_COMPARSIONS); 2240 } 2241 2242 public void setSubqueriesInComparisons(int value) 2243 { 2244 setBoolean(PROP_SUBQUERY_IN_COMPARSIONS, value); 2245 } 2246 2247 2253 public boolean supportsSubqueriesInExists() throws SQLException 2254 { 2255 Boolean subqueryExist = (Boolean )properties.get(PROP_SUBQUERY_IN_EXISTS); 2256 if (subqueryExist == null) { 2257 if (dmd != null) subqueryExist = dmd.supportsSubqueriesInExists() ? Boolean.TRUE : Boolean.FALSE; 2258 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_SUBQUERY_IN_EXISTS, subqueryExist); 2260 } 2261 2262 return subqueryExist.booleanValue(); 2263 } 2264 2265 public int getSubqueriesInExists() 2266 { 2267 return getBoolean(PROP_SUBQUERY_IN_EXISTS); 2268 } 2269 2270 public void setSubqueriesInExists(int value) 2271 { 2272 setBoolean(PROP_SUBQUERY_IN_EXISTS, value); 2273 } 2274 2275 2280 public boolean supportsSubqueriesInIns() throws SQLException 2281 { 2282 Boolean subqueryIns = (Boolean )properties.get(PROP_SUBQUERY_IN_INS); 2283 if (subqueryIns == null) { 2284 if (dmd != null) subqueryIns = dmd.supportsSubqueriesInIns() ? Boolean.TRUE : Boolean.FALSE; 2285 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_SUBQUERY_IN_INS, subqueryIns); 2287 } 2288 2289 return subqueryIns.booleanValue(); 2290 } 2291 2292 public int getSubqueriesInIns() 2293 { 2294 return getBoolean(PROP_SUBQUERY_IN_INS); 2295 } 2296 2297 public void setSubqueriesInIns(int value) 2298 { 2299 setBoolean(PROP_SUBQUERY_IN_INS, value); 2300 } 2301 2302 2308 public boolean supportsSubqueriesInQuantifieds() throws SQLException 2309 { 2310 Boolean subqueryQuant = (Boolean )properties.get(PROP_SUBQUERY_IN_QUANTIFIEDS); 2311 if (subqueryQuant == null) { 2312 if (dmd != null) subqueryQuant = dmd.supportsSubqueriesInQuantifieds() ? Boolean.TRUE : Boolean.FALSE; 2313 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_SUBQUERY_IN_QUANTIFIEDS, subqueryQuant); 2315 } 2316 2317 return subqueryQuant.booleanValue(); 2318 } 2319 2320 public int getSubqueriesInQuantifieds() 2321 { 2322 return getBoolean(PROP_SUBQUERY_IN_QUANTIFIEDS); 2323 } 2324 2325 public void setSubqueriesInQuantifieds(int value) 2326 { 2327 setBoolean(PROP_SUBQUERY_IN_QUANTIFIEDS, value); 2328 } 2329 2330 2336 public boolean supportsCorrelatedSubqueries() throws SQLException 2337 { 2338 Boolean subqueryCorr = (Boolean )properties.get(PROP_CORRELATED_SUBQUERIES); 2339 if (subqueryCorr == null) { 2340 if (dmd != null) subqueryCorr = dmd.supportsCorrelatedSubqueries() ? Boolean.TRUE : Boolean.FALSE; 2341 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_CORRELATED_SUBQUERIES, subqueryCorr); 2343 } 2344 2345 return subqueryCorr.booleanValue(); 2346 } 2347 2348 public int getCorrelatedSubqueries() 2349 { 2350 return getBoolean(PROP_CORRELATED_SUBQUERIES); 2351 } 2352 2353 public void setCorrelatedSubqueries(int value) 2354 { 2355 setBoolean(PROP_CORRELATED_SUBQUERIES, value); 2356 } 2357 2358 2363 public boolean supportsUnion() throws SQLException 2364 { 2365 Boolean union = (Boolean )properties.get(PROP_UNION); 2366 if (union == null) { 2367 if (dmd != null) union = dmd.supportsUnion() ? Boolean.TRUE : Boolean.FALSE; 2368 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_UNION, union); 2370 } 2371 2372 return union.booleanValue(); 2373 } 2374 2375 public int getUnion() 2376 { 2377 return getBoolean(PROP_UNION); 2378 } 2379 2380 public void setUnion(int value) 2381 { 2382 setBoolean(PROP_UNION, value); 2383 } 2384 2385 2390 public boolean supportsUnionAll() throws SQLException 2391 { 2392 Boolean unionAll = (Boolean )properties.get(PROP_UNION_ALL); 2393 if (unionAll == null) { 2394 if (dmd != null) unionAll = dmd.supportsUnionAll() ? Boolean.TRUE : Boolean.FALSE; 2395 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_UNION_ALL, unionAll); 2397 } 2398 2399 return unionAll.booleanValue(); 2400 } 2401 2402 public int getUnionAll() 2403 { 2404 return getBoolean(PROP_UNION_ALL); 2405 } 2406 2407 public void setUnionAll(int value) 2408 { 2409 setBoolean(PROP_UNION_ALL, value); 2410 } 2411 2412 2417 public boolean supportsOpenCursorsAcrossCommit() throws SQLException 2418 { 2419 Boolean cursorInCommit = (Boolean )properties.get(PROP_OPEN_CURSORS_ACROSS_COMMIT); 2420 if (cursorInCommit == null) { 2421 if (dmd != null) cursorInCommit = dmd.supportsOpenCursorsAcrossCommit() ? Boolean.TRUE : Boolean.FALSE; 2422 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_OPEN_CURSORS_ACROSS_COMMIT, cursorInCommit); 2424 } 2425 2426 return cursorInCommit.booleanValue(); 2427 } 2428 2429 public int getOpenCursorsAcrossCommit() 2430 { 2431 return getBoolean(PROP_OPEN_CURSORS_ACROSS_COMMIT); 2432 } 2433 2434 public void setOpenCursorsAcrossCommit(int value) 2435 { 2436 setBoolean(PROP_OPEN_CURSORS_ACROSS_COMMIT, value); 2437 } 2438 2439 2444 public boolean supportsOpenCursorsAcrossRollback() throws SQLException 2445 { 2446 Boolean cursorInRollback = (Boolean )properties.get(PROP_OPEN_CURSORS_ACROSS_ROLLBACK); 2447 if (cursorInRollback == null) { 2448 if (dmd != null) cursorInRollback = dmd.supportsOpenCursorsAcrossRollback() ? Boolean.TRUE : Boolean.FALSE; 2449 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_OPEN_CURSORS_ACROSS_ROLLBACK, cursorInRollback); 2451 } 2452 2453 return cursorInRollback.booleanValue(); 2454 } 2455 2456 public int getOpenCursorsAcrossRollback() 2457 { 2458 return getBoolean(PROP_OPEN_CURSORS_ACROSS_ROLLBACK); 2459 } 2460 2461 public void setOpenCursorsAcrossRollback(int value) 2462 { 2463 setBoolean(PROP_OPEN_CURSORS_ACROSS_ROLLBACK, value); 2464 } 2465 2466 2471 public boolean supportsOpenStatementsAcrossCommit() throws SQLException 2472 { 2473 Boolean statementInCommit = (Boolean )properties.get(PROP_OPEN_STATEMENTS_ACROSS_COMMIT); 2474 if (statementInCommit == null) { 2475 if (dmd != null) statementInCommit = dmd.supportsOpenStatementsAcrossCommit() ? Boolean.TRUE : Boolean.FALSE; 2476 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_OPEN_STATEMENTS_ACROSS_COMMIT, statementInCommit); 2478 } 2479 2480 return statementInCommit.booleanValue(); 2481 } 2482 2483 public int getOpenStatementsAcrossCommit() 2484 { 2485 return getBoolean(PROP_OPEN_STATEMENTS_ACROSS_COMMIT); 2486 } 2487 2488 public void setOpenStatementsAcrossCommit(int value) 2489 { 2490 setBoolean(PROP_OPEN_STATEMENTS_ACROSS_COMMIT, value); 2491 } 2492 2493 2498 public boolean supportsOpenStatementsAcrossRollback() throws SQLException 2499 { 2500 Boolean statementInRollback = (Boolean )properties.get(PROP_OPEN_STATEMENTS_ACROSS_ROLLBACK); 2501 if (statementInRollback == null) { 2502 if (dmd != null) statementInRollback = dmd.supportsOpenStatementsAcrossRollback() ? Boolean.TRUE : Boolean.FALSE; 2503 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_OPEN_STATEMENTS_ACROSS_ROLLBACK, statementInRollback); 2505 } 2506 2507 return statementInRollback.booleanValue(); 2508 } 2509 2510 public int getOpenStatementsAcrossRollback() 2511 { 2512 return getBoolean(PROP_OPEN_STATEMENTS_ACROSS_ROLLBACK); 2513 } 2514 2515 public void setOpenStatementsAcrossRollback(int value) 2516 { 2517 setBoolean(PROP_OPEN_STATEMENTS_ACROSS_ROLLBACK, value); 2518 } 2519 2520 2525 public int getMaxBinaryLiteralLength() throws SQLException 2526 { 2527 Integer binaryLiteral = (Integer )properties.get(PROP_MAX_BINARY_LITERAL_LENGTH); 2528 if (binaryLiteral == null && dmd != null) { 2529 binaryLiteral = new Integer (dmd.getMaxBinaryLiteralLength()); 2530 properties.put(PROP_MAX_BINARY_LITERAL_LENGTH, binaryLiteral); 2531 } 2532 2533 if (binaryLiteral != null) return binaryLiteral.intValue(); 2534 return 0; 2535 } 2536 2537 public void setMaxBinaryLiteralLength(int value) 2538 { 2539 setInt(PROP_MAX_BINARY_LITERAL_LENGTH, value); 2540 } 2541 2542 2547 public int getMaxCharLiteralLength() throws SQLException 2548 { 2549 Integer maxCharLiteral = (Integer )properties.get(PROP_MAX_CHAR_LITERAL_LENGTH); 2550 if (maxCharLiteral == null && dmd != null) { 2551 maxCharLiteral = new Integer (dmd.getMaxCharLiteralLength()); 2552 properties.put(PROP_MAX_CHAR_LITERAL_LENGTH, maxCharLiteral); 2553 } 2554 2555 if (maxCharLiteral != null) return maxCharLiteral.intValue(); 2556 return 0; 2557 } 2558 2559 public void setMaxCharLiteralLength(int value) 2560 { 2561 setInt(PROP_MAX_CHAR_LITERAL_LENGTH, value); 2562 } 2563 2564 2569 public int getMaxColumnNameLength() throws SQLException 2570 { 2571 Integer maxColumnName = (Integer )properties.get(PROP_MAX_COLUMN_NAME_LENGTH); 2572 if (maxColumnName == null && dmd != null) { 2573 maxColumnName = new Integer (dmd.getMaxColumnNameLength()); 2574 properties.put(PROP_MAX_COLUMN_NAME_LENGTH, maxColumnName); 2575 } 2576 2577 if (maxColumnName != null) return maxColumnName.intValue(); 2578 return 0; 2579 } 2580 2581 public void setMaxColumnNameLength(int value) 2582 { 2583 setInt(PROP_MAX_COLUMN_NAME_LENGTH, value); 2584 } 2585 2586 2591 public int getMaxColumnsInGroupBy() throws SQLException 2592 { 2593 Integer maxColumnGroup = (Integer )properties.get(PROP_MAX_COLUMNS_IN_GROUPBY); 2594 if (maxColumnGroup == null && dmd != null) { 2595 maxColumnGroup = new Integer (dmd.getMaxColumnsInGroupBy()); 2596 properties.put(PROP_MAX_COLUMNS_IN_GROUPBY, maxColumnGroup); 2597 } 2598 2599 if (maxColumnGroup != null) return maxColumnGroup.intValue(); 2600 return 0; 2601 } 2602 2603 public void setMaxColumnsInGroupBy(int value) 2604 { 2605 setInt(PROP_MAX_COLUMNS_IN_GROUPBY, value); 2606 } 2607 2608 2613 public int getMaxColumnsInIndex() throws SQLException 2614 { 2615 Integer maxColumnIndex = (Integer )properties.get(PROP_MAX_COLUMNS_IN_INDEX); 2616 if (maxColumnIndex == null && dmd != null) { 2617 maxColumnIndex = new Integer (dmd.getMaxColumnsInIndex()); 2618 properties.put(PROP_MAX_COLUMNS_IN_INDEX, maxColumnIndex); 2619 } 2620 2621 if (maxColumnIndex != null) return maxColumnIndex.intValue(); 2622 return 0; 2623 } 2624 2625 public void setMaxColumnsInIndex(int value) 2626 { 2627 setInt(PROP_MAX_COLUMNS_IN_INDEX, value); 2628 } 2629 2630 2635 public int getMaxColumnsInOrderBy() throws SQLException 2636 { 2637 Integer maxColumnOrderBy = (Integer )properties.get(PROP_MAX_COLUMNS_IN_ORDERBY); 2638 if (maxColumnOrderBy == null && dmd != null) { 2639 maxColumnOrderBy = new Integer (dmd.getMaxColumnsInOrderBy()); 2640 properties.put(PROP_MAX_COLUMNS_IN_ORDERBY, maxColumnOrderBy); 2641 } 2642 2643 if (maxColumnOrderBy != null) return maxColumnOrderBy.intValue(); 2644 return 0; 2645 } 2646 2647 public void setMaxColumnsInOrderBy(int value) 2648 { 2649 setInt(PROP_MAX_COLUMNS_IN_ORDERBY, value); 2650 } 2651 2652 2657 public int getMaxColumnsInSelect() throws SQLException 2658 { 2659 Integer maxColumnSelect = (Integer )properties.get(PROP_MAX_COLUMNS_IN_SELECT); 2660 if (maxColumnSelect == null && dmd != null) { 2661 maxColumnSelect = new Integer (dmd.getMaxColumnsInSelect()); 2662 properties.put(PROP_MAX_COLUMNS_IN_SELECT, maxColumnSelect); 2663 } 2664 2665 if (maxColumnSelect != null) return maxColumnSelect.intValue(); 2666 return 0; 2667 } 2668 2669 public void setMaxColumnsInSelect(int value) 2670 { 2671 setInt(PROP_MAX_COLUMNS_IN_SELECT, value); 2672 } 2673 2674 2679 public int getMaxColumnsInTable() throws SQLException 2680 { 2681 Integer maxColumnTable = (Integer )properties.get(PROP_MAX_COLUMNS_IN_TABLE); 2682 if (maxColumnTable == null && dmd != null) { 2683 maxColumnTable = new Integer (dmd.getMaxColumnsInTable()); 2684 properties.put(PROP_MAX_COLUMNS_IN_TABLE, maxColumnTable); 2685 } 2686 2687 if (maxColumnTable != null) return maxColumnTable.intValue(); 2688 return 0; 2689 } 2690 2691 public void setMaxColumnsInTable(int value) 2692 { 2693 setInt(PROP_MAX_COLUMNS_IN_TABLE, value); 2694 } 2695 2696 2701 public int getMaxConnections() throws SQLException 2702 { 2703 Integer maxConnections = (Integer )properties.get(PROP_MAX_CONNECTIONS); 2704 if (maxConnections == null && dmd != null) { 2705 maxConnections = new Integer (dmd.getMaxConnections()); 2706 properties.put(PROP_MAX_CONNECTIONS, maxConnections); 2707 } 2708 2709 if (maxConnections != null) return maxConnections.intValue(); 2710 return 0; 2711 } 2712 2713 public void setMaxConnections(int value) 2714 { 2715 setInt(PROP_MAX_CONNECTIONS, value); 2716 } 2717 2718 2723 public int getMaxCursorNameLength() throws SQLException 2724 { 2725 Integer maxCursorName = (Integer )properties.get(PROP_MAX_CURSORNAME_LENGTH); 2726 if (maxCursorName == null && dmd != null) { 2727 maxCursorName = new Integer (dmd.getMaxCursorNameLength()); 2728 properties.put(PROP_MAX_CURSORNAME_LENGTH, maxCursorName); 2729 } 2730 2731 if (maxCursorName != null) return maxCursorName.intValue(); 2732 return 0; 2733 } 2734 2735 public void setMaxCursorNameLength(int value) 2736 { 2737 setInt(PROP_MAX_CURSORNAME_LENGTH, value); 2738 } 2739 2740 2745 public int getMaxIndexLength() throws SQLException 2746 { 2747 Integer maxIndex = (Integer )properties.get(PROP_MAX_INDEX_LENGTH); 2748 if (maxIndex == null && dmd != null) { 2749 maxIndex = new Integer (dmd.getMaxIndexLength()); 2750 properties.put(PROP_MAX_INDEX_LENGTH, maxIndex); 2751 } 2752 2753 if (maxIndex != null) return maxIndex.intValue(); 2754 return 0; 2755 } 2756 2757 public void setMaxIndexLength(int value) 2758 { 2759 setInt(PROP_MAX_INDEX_LENGTH, value); 2760 } 2761 2762 2767 public int getMaxSchemaNameLength() throws SQLException 2768 { 2769 Integer maxSchemaName = (Integer )properties.get(PROP_MAX_SCHEMA_NAME); 2770 if (maxSchemaName == null && dmd != null) { 2771 maxSchemaName = new Integer (dmd.getMaxSchemaNameLength()); 2772 properties.put(PROP_MAX_SCHEMA_NAME, maxSchemaName); 2773 } 2774 2775 if (maxSchemaName != null) return maxSchemaName.intValue(); 2776 return 0; 2777 } 2778 2779 public void setMaxSchemaNameLength(int value) 2780 { 2781 setInt(PROP_MAX_SCHEMA_NAME, value); 2782 } 2783 2784 2789 public int getMaxProcedureNameLength() throws SQLException 2790 { 2791 Integer maxProcName = (Integer )properties.get(PROP_MAX_PROCEDURE_NAME); 2792 if (maxProcName == null && dmd != null) { 2793 maxProcName = new Integer (dmd.getMaxProcedureNameLength()); 2794 properties.put(PROP_MAX_PROCEDURE_NAME, maxProcName); 2795 } 2796 2797 if (maxProcName != null) return maxProcName.intValue(); 2798 return 0; 2799 } 2800 2801 public void setMaxProcedureNameLength(int value) 2802 { 2803 setInt(PROP_MAX_PROCEDURE_NAME, value); 2804 } 2805 2806 2811 public int getMaxCatalogNameLength() throws SQLException 2812 { 2813 Integer maxCatalogName = (Integer )properties.get(PROP_MAX_CATALOG_NAME); 2814 if (maxCatalogName == null && dmd != null) { 2815 maxCatalogName = new Integer (dmd.getMaxProcedureNameLength()); 2816 properties.put(PROP_MAX_CATALOG_NAME, maxCatalogName); 2817 } 2818 2819 if (maxCatalogName != null) return maxCatalogName.intValue(); 2820 return 0; 2821 } 2822 2823 public void setMaxCatalogNameLength(int value) 2824 { 2825 setInt(PROP_MAX_CATALOG_NAME, value); 2826 } 2827 2828 2833 public int getMaxRowSize() throws SQLException 2834 { 2835 Integer maxRowSize = (Integer )properties.get(PROP_MAX_ROW_SIZE); 2836 if (maxRowSize == null && dmd != null) { 2837 maxRowSize = new Integer (dmd.getMaxProcedureNameLength()); 2838 properties.put(PROP_MAX_ROW_SIZE, maxRowSize); 2839 } 2840 2841 if (maxRowSize != null) return maxRowSize.intValue(); 2842 return 0; 2843 } 2844 2845 public void setMaxRowSize(int value) 2846 { 2847 setInt(PROP_MAX_ROW_SIZE, value); 2848 } 2849 2850 2856 public boolean doesMaxRowSizeIncludeBlobs() throws SQLException 2857 { 2858 Boolean rowSizeBlobs = (Boolean )properties.get(PROP_ROWSIZE_INCLUDING_BLOBS); 2859 if (rowSizeBlobs == null) { 2860 if (dmd != null) rowSizeBlobs = dmd.doesMaxRowSizeIncludeBlobs() ? Boolean.TRUE : Boolean.FALSE; 2861 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_ROWSIZE_INCLUDING_BLOBS, rowSizeBlobs); 2863 } 2864 2865 return rowSizeBlobs.booleanValue(); 2866 } 2867 2868 public int getMaxRowSizeIncludeBlobs() 2869 { 2870 return getBoolean(PROP_ROWSIZE_INCLUDING_BLOBS); 2871 } 2872 2873 public void setMaxRowSizeIncludeBlobs(int value) 2874 { 2875 setBoolean(PROP_ROWSIZE_INCLUDING_BLOBS, value); 2876 } 2877 2878 2883 public int getMaxStatementLength() throws SQLException 2884 { 2885 Integer maxStatement = (Integer )properties.get(PROP_MAX_STATEMENT_LENGTH); 2886 if (maxStatement == null && dmd != null) { 2887 maxStatement = new Integer (dmd.getMaxStatementLength()); 2888 properties.put(PROP_MAX_STATEMENT_LENGTH, maxStatement); 2889 } 2890 2891 if (maxStatement != null) return maxStatement.intValue(); 2892 return 0; 2893 } 2894 2895 public void setMaxStatementLength(int value) 2896 { 2897 setInt(PROP_MAX_STATEMENT_LENGTH, value); 2898 } 2899 2900 2906 public int getMaxStatements() throws SQLException 2907 { 2908 Integer maxStatements = (Integer )properties.get(PROP_MAX_STATEMENTS); 2909 if (maxStatements == null && dmd != null) { 2910 maxStatements = new Integer (dmd.getMaxStatementLength()); 2911 properties.put(PROP_MAX_STATEMENTS, maxStatements); 2912 } 2913 2914 if (maxStatements != null) return maxStatements.intValue(); 2915 return 0; 2916 } 2917 2918 public void setMaxStatements(int value) 2919 { 2920 setInt(PROP_MAX_STATEMENTS, value); 2921 } 2922 2923 2928 public int getMaxTableNameLength() throws SQLException 2929 { 2930 Integer maxTable = (Integer )properties.get(PROP_MAX_TABLENAME_LENGTH); 2931 if (maxTable == null && dmd != null) { 2932 maxTable = new Integer (dmd.getMaxStatementLength()); 2933 properties.put(PROP_MAX_TABLENAME_LENGTH, maxTable); 2934 } 2935 2936 if (maxTable != null) return maxTable.intValue(); 2937 return 0; 2938 } 2939 2940 public void setMaxTableNameLength(int value) 2941 { 2942 setInt(PROP_MAX_TABLENAME_LENGTH, value); 2943 } 2944 2945 2950 public int getMaxTablesInSelect() throws SQLException 2951 { 2952 Integer maxTable = (Integer )properties.get(PROP_MAX_TABLES_IN_SELECT); 2953 if (maxTable == null && dmd != null) { 2954 maxTable = new Integer (dmd.getMaxStatementLength()); 2955 properties.put(PROP_MAX_TABLES_IN_SELECT, maxTable); 2956 } 2957 2958 if (maxTable != null) return maxTable.intValue(); 2959 return 0; 2960 } 2961 2962 public void setMaxTablesInSelect(int value) 2963 { 2964 setInt(PROP_MAX_TABLES_IN_SELECT, value); 2965 } 2966 2967 2972 public int getMaxUserNameLength() throws SQLException 2973 { 2974 Integer maxUserName = (Integer )properties.get(PROP_MAX_USERNAME); 2975 if (maxUserName == null && dmd != null) { 2976 maxUserName = new Integer (dmd.getMaxUserNameLength()); 2977 properties.put(PROP_MAX_USERNAME, maxUserName); 2978 } 2979 2980 if (maxUserName != null) return maxUserName.intValue(); 2981 return 0; 2982 } 2983 2984 public void setMaxUserNameLength(int value) 2985 { 2986 setInt(PROP_MAX_USERNAME, value); 2987 } 2988 2989 2995 public int getDefaultTransactionIsolation() throws SQLException 2996 { 2997 Integer maxTransaction = (Integer )properties.get(PROP_DEFAULT_ISOLATION); 2998 if (maxTransaction == null && dmd != null) { 2999 maxTransaction = new Integer (dmd.getDefaultTransactionIsolation()); 3000 properties.put(PROP_DEFAULT_ISOLATION, maxTransaction); 3001 } 3002 3003 if (maxTransaction != null) return maxTransaction.intValue(); 3004 return 0; 3005 } 3006 3007 public void setDefaultTransactionIsolation(int value) 3008 { 3009 setInt(PROP_DEFAULT_ISOLATION, value); 3010 } 3011 3012 3017 public boolean supportsTransactions() throws SQLException 3018 { 3019 Boolean trans = (Boolean )properties.get(PROP_TRANSACTIONS); 3020 if (trans == null) { 3021 if (dmd != null) trans = dmd.doesMaxRowSizeIncludeBlobs() ? Boolean.TRUE : Boolean.FALSE; 3022 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_TRANSACTIONS, trans); 3024 } 3025 3026 return trans.booleanValue(); 3027 } 3028 3029 public int getTransactions() 3030 { 3031 return getBoolean(PROP_TRANSACTIONS); 3032 } 3033 3034 public void setTransactions(int value) 3035 { 3036 setBoolean(PROP_TRANSACTIONS, value); 3037 } 3038 3039 3045 public boolean supportsTransactionIsolationLevel(int level) throws SQLException 3046 { 3047 if (dmd != null) return dmd.supportsTransactionIsolationLevel(level); 3048 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 3050 3051 3057 public boolean supportsDataDefinitionAndDataManipulationTransactions() throws SQLException 3058 { 3059 Boolean flag = (Boolean )properties.get(PROP_DDL_AND_DML_TRANSACTIONS); 3060 if (flag == null) { 3061 if (dmd != null) flag = dmd.doesMaxRowSizeIncludeBlobs() ? Boolean.TRUE : Boolean.FALSE; 3062 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_DDL_AND_DML_TRANSACTIONS, flag); 3064 } 3065 3066 return flag.booleanValue(); 3067 } 3068 3069 public int getDataDefinitionAndDataManipulationTransactions() 3070 { 3071 return getBoolean(PROP_DDL_AND_DML_TRANSACTIONS); 3072 } 3073 3074 public void setDataDefinitionAndDataManipulationTransactions(int value) 3075 { 3076 setBoolean(PROP_DDL_AND_DML_TRANSACTIONS, value); 3077 } 3078 3079 3085 public boolean supportsDataManipulationTransactionsOnly() throws SQLException 3086 { 3087 Boolean flag = (Boolean )properties.get(PROP_DML_TRANSACTIONS_ONLY); 3088 if (flag == null) { 3089 if (dmd != null) flag = dmd.supportsDataManipulationTransactionsOnly() ? Boolean.TRUE : Boolean.FALSE; 3090 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_DML_TRANSACTIONS_ONLY, flag); 3092 } 3093 3094 return flag.booleanValue(); 3095 } 3096 3097 public int getDataManipulationTransactionsOnly() 3098 { 3099 return getBoolean(PROP_DML_TRANSACTIONS_ONLY); 3100 } 3101 3102 public void setDataManipulationTransactionsOnly(int value) 3103 { 3104 setBoolean(PROP_DML_TRANSACTIONS_ONLY, value); 3105 } 3106 3107 3113 public boolean dataDefinitionCausesTransactionCommit() throws SQLException 3114 { 3115 Boolean flag = (Boolean )properties.get(PROP_DDL_CAUSES_COMMIT); 3116 if (flag == null) { 3117 if (dmd != null) flag = dmd.dataDefinitionCausesTransactionCommit() ? Boolean.TRUE : Boolean.FALSE; 3118 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_DDL_CAUSES_COMMIT, flag); 3120 } 3121 3122 return flag.booleanValue(); 3123 } 3124 3125 public int getDataDefinitionCausesTransactionCommit() 3126 { 3127 return getBoolean(PROP_DDL_CAUSES_COMMIT); 3128 } 3129 3130 public void setDataDefinitionCausesTransactionCommit(int value) 3131 { 3132 setBoolean(PROP_DDL_CAUSES_COMMIT, value); 3133 } 3134 3135 3140 public boolean dataDefinitionIgnoredInTransactions() throws SQLException 3141 { 3142 Boolean flag = (Boolean )properties.get(PROP_DDL_IGNORED_IN_TRANSACTIONS); 3143 if (flag == null) { 3144 if (dmd != null) flag = dmd.dataDefinitionIgnoredInTransactions() ? Boolean.TRUE : Boolean.FALSE; 3145 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_DDL_IGNORED_IN_TRANSACTIONS, flag); 3147 } 3148 3149 return flag.booleanValue(); 3150 } 3151 3152 public int getDataDefinitionIgnoredInTransactions() 3153 { 3154 return getBoolean(PROP_DDL_IGNORED_IN_TRANSACTIONS); 3155 } 3156 3157 public void setDataDefinitionIgnoredInTransactions(int value) 3158 { 3159 setBoolean(PROP_DDL_IGNORED_IN_TRANSACTIONS, value); 3160 } 3161 3162 3166 public ResultSet getProcedures(String catalog, String schemaPattern, String procedureNamePattern) throws SQLException 3167 { 3168 if (getCapitializeUsername() && schemaPattern != null) schemaPattern = schemaPattern.toUpperCase(); 3169 String query = (String )properties.get(PROP_PROCEDURES_QUERY); 3170 if (query != null) { 3171 if (con != null) { 3172 PreparedStatement stmt = con.prepareStatement(query); 3173 stmt.setString(1, catalog); 3174 stmt.setString(2, schemaPattern); 3175 stmt.setString(3, procedureNamePattern); 3176 return stmt.executeQuery(); 3177 } else throw new SQLException (bundle.getString("EXC_NoConnection")); } 3179 3180 if (dmd == null) throw new SQLException (bundle.getString("EXC_NoDBMetadata")); return dmd.getProcedures(catalog, schemaPattern, procedureNamePattern); 3182 } 3183 3184 public String getProceduresQuery() 3185 { 3186 return getString(PROP_PROCEDURES_QUERY); 3187 } 3188 3189 public void setProceduresQuery(String value) 3190 { 3191 setString(PROP_PROCEDURES_QUERY, value); 3192 } 3193 3194 3198 public ResultSet getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern) throws SQLException 3199 { 3200 if (getCapitializeUsername() && schemaPattern != null) schemaPattern = schemaPattern.toUpperCase(); 3201 String query = (String )properties.get(PROP_PROCEDURE_COLUMNS_QUERY); 3202 if (query != null) { 3203 if (con != null) { 3204 PreparedStatement stmt = con.prepareStatement(query); 3205 stmt.setString(1, catalog); 3206 stmt.setString(2, schemaPattern); 3207 stmt.setString(3, procedureNamePattern); 3208 stmt.setString(4, columnNamePattern); 3209 return stmt.executeQuery(); 3210 } else throw new SQLException (bundle.getString("EXC_NoConnection")); } 3212 3213 if (dmd == null) throw new SQLException (bundle.getString("EXC_NoDBMetadata")); return dmd.getProcedureColumns(catalog, schemaPattern, procedureNamePattern, columnNamePattern); 3215 } 3216 3217 public String getProcedureColumnsQuery() 3218 { 3219 return getString(PROP_PROCEDURE_COLUMNS_QUERY); 3220 } 3221 3222 public void setProcedureColumnsQuery(String value) 3223 { 3224 setString(PROP_PROCEDURE_COLUMNS_QUERY, value); 3225 } 3226 3227 3231 public ResultSet getSchemas() throws SQLException 3232 { 3233 String query = (String )properties.get(PROP_PROCEDURE_COLUMNS_QUERY); 3234 if (query != null) { 3235 if (con != null) return con.createStatement().executeQuery(query); 3236 else throw new SQLException (bundle.getString("EXC_NoConnection")); } 3238 3239 if (dmd == null) throw new SQLException (bundle.getString("EXC_NoDBMetadata")); return dmd.getSchemas(); 3241 } 3242 3243 public String getSchemasQuery() 3244 { 3245 return getString(PROP_SCHEMAS_QUERY); 3246 } 3247 3248 public void setSchemasQuery(String value) 3249 { 3250 setString(PROP_SCHEMAS_QUERY, value); 3251 } 3252 3253 3258 public ResultSet getCatalogs() throws SQLException 3259 { 3260 String query = (String )properties.get(PROP_CATALOGS_QUERY); 3261 if (query != null) { 3262 if (con != null) return con.createStatement().executeQuery(query); 3263 else throw new SQLException (bundle.getString("EXC_NoConnection")); } 3265 3266 if (dmd == null) throw new SQLException (bundle.getString("EXC_NoDBMetadata")); return dmd.getCatalogs(); 3268 } 3269 3270 public String getCatalogsQuery() 3271 { 3272 return getString(PROP_CATALOGS_QUERY); 3273 } 3274 3275 public void setCatalogsQuery(String value) 3276 { 3277 setString(PROP_CATALOGS_QUERY, value); 3278 } 3279 3280 3284 public ResultSet getTableTypes() throws SQLException 3285 { 3286 String query = (String )properties.get(PROP_TABLE_TYPES_QUERY); 3287 if (query != null) { 3288 if (con != null) return con.createStatement().executeQuery(query); 3289 else throw new SQLException (bundle.getString("EXC_NoConnection")); } 3291 3292 if (dmd == null) throw new SQLException (bundle.getString("EXC_NoDBMetadata")); return dmd.getCatalogs(); 3294 } 3295 3296 public String getTableTypesQuery() 3297 { 3298 return getString(PROP_TABLE_TYPES_QUERY); 3299 } 3300 3301 public void setTableTypesQuery(String value) 3302 { 3303 setString(PROP_TABLE_TYPES_QUERY, value); 3304 } 3305 3306 3310 public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern) throws SQLException 3311 { 3312 if (getCapitializeUsername() && schemaPattern != null) schemaPattern = schemaPattern.toUpperCase(); 3313 String query = (String )properties.get(PROP_COLUMNS_QUERY); 3314 if (query != null) { 3315 if (con != null) { 3316 PreparedStatement stmt = con.prepareStatement(query); 3317 stmt.setString(1, catalog); 3318 stmt.setString(2, schemaPattern); 3319 stmt.setString(3, tableNamePattern); 3320 stmt.setString(4, columnNamePattern); 3321 return stmt.executeQuery(); 3322 } else throw new SQLException (bundle.getString("EXC_NoConnection")); } 3324 3325 if (dmd == null) throw new SQLException (bundle.getString("EXC_NoDBMetadata")); return dmd.getColumns(catalog, schemaPattern, tableNamePattern, columnNamePattern); 3327 } 3328 3329 public String getColumnsQuery() 3330 { 3331 return getString(PROP_COLUMNS_QUERY); 3332 } 3333 3334 public void setColumnsQuery(String value) 3335 { 3336 setString(PROP_COLUMNS_QUERY, value); 3337 } 3338 3339 3342 public ResultSet getColumnPrivileges(String catalog, String schema, String table, String columnNamePattern) throws SQLException 3343 { 3344 if (getCapitializeUsername() && schema != null) schema = schema.toUpperCase(); 3345 String query = (String )properties.get(PROP_COLUMNS_PRIVILEGES_QUERY); 3346 if (query != null) { 3347 if (con != null) { 3348 PreparedStatement stmt = con.prepareStatement(query); 3349 stmt.setString(1, catalog); 3350 stmt.setString(2, schema); 3351 stmt.setString(3, table); 3352 stmt.setString(4, columnNamePattern); 3353 return stmt.executeQuery(); 3354 } else throw new SQLException (bundle.getString("EXC_NoConnection")); } 3356 3357 if (dmd == null) throw new SQLException (bundle.getString("EXC_NoDBMetadata")); return dmd.getColumnPrivileges(catalog, schema, table, columnNamePattern); 3359 } 3360 3361 public String getColumnPrivilegesQuery() 3362 { 3363 return getString(PROP_COLUMNS_PRIVILEGES_QUERY); 3364 } 3365 3366 public void setColumnPrivilegesQuery(String value) 3367 { 3368 setString(PROP_COLUMNS_PRIVILEGES_QUERY, value); 3369 } 3370 3371 3377 public ResultSet getTables(String catalog, String schemaPattern, String tableNamePattern, String [] types) throws SQLException 3378 { 3379 if (getCapitializeUsername() && schemaPattern!= null) schemaPattern = schemaPattern.toUpperCase(); 3380 String query = (String )properties.get(PROP_TABLES_QUERY); 3381 if (query != null) { 3382 if (con != null) { 3383 StringBuffer typebuff = new StringBuffer (); 3384 PreparedStatement stmt = con.prepareStatement(query); 3385 stmt.setString(1, catalog); 3386 stmt.setString(2, schemaPattern); 3387 stmt.setString(3, tableNamePattern); 3388 3389 for (int i=0; i<types.length; i++) { 3390 if (i > 0) typebuff.append(", "); 3391 typebuff.append("'"); 3392 typebuff.append(types[i]); 3393 typebuff.append("'"); 3394 } 3395 3396 stmt.setString(4, typebuff.toString()); 3397 return stmt.executeQuery(); 3398 } else throw new SQLException (bundle.getString("EXC_NoConnection")); } 3400 3401 if (dmd == null) throw new SQLException (bundle.getString("EXC_NoDBMetadata")); return dmd.getTables(catalog, schemaPattern, tableNamePattern, types); 3403 } 3404 3405 public String getTablesQuery() 3406 { 3407 return getString(PROP_TABLES_QUERY); 3408 } 3409 3410 public void setTablesQuery(String value) 3411 { 3412 setString(PROP_TABLES_QUERY, value); 3413 } 3414 3415 3422 public ResultSet getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern) throws SQLException 3423 { 3424 if (getCapitializeUsername() && schemaPattern!= null) schemaPattern = schemaPattern.toUpperCase(); 3425 String query = (String )properties.get(PROP_TABLE_PRIVILEGES_QUERY); 3426 if (query != null) { 3427 if (con != null) { 3428 PreparedStatement stmt = con.prepareStatement(query); 3429 stmt.setString(1, catalog); 3430 stmt.setString(2, schemaPattern); 3431 stmt.setString(3, tableNamePattern); 3432 return stmt.executeQuery(); 3433 } else throw new SQLException (bundle.getString("EXC_NoConnection")); } 3435 3436 if (dmd == null) throw new SQLException (bundle.getString("EXC_NoDBMetadata")); return dmd.getTablePrivileges(catalog, schemaPattern, tableNamePattern); 3438 } 3439 3440 public String getTablePrivilegesQuery() 3441 { 3442 return getString(PROP_TABLE_PRIVILEGES_QUERY); 3443 } 3444 3445 public void setTablePrivilegesQuery(String value) 3446 { 3447 setString(PROP_TABLE_PRIVILEGES_QUERY, value); 3448 } 3449 3450 3454 public ResultSet getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable) throws SQLException 3455 { 3456 if (getCapitializeUsername() && schema != null) schema = schema.toUpperCase(); 3457 String query = (String )properties.get(PROP_BEST_ROW_IDENTIFIER); 3458 if (query != null) { 3459 if (con != null) { 3460 PreparedStatement stmt = con.prepareStatement(query); 3461 stmt.setString(1, catalog); 3462 stmt.setString(2, schema); 3463 stmt.setString(3, table); 3464 stmt.setInt(4, scope); 3465 stmt.setBoolean(5, nullable); 3466 return stmt.executeQuery(); 3467 } else throw new SQLException (bundle.getString("EXC_NoConnection")); } 3469 3470 if (dmd == null) throw new SQLException (bundle.getString("EXC_NoDBMetadata")); return dmd.getBestRowIdentifier(catalog, schema, table, scope, nullable); 3472 } 3473 3474 public String getBestRowIdentifierQuery() 3475 { 3476 return getString(PROP_BEST_ROW_IDENTIFIER); 3477 } 3478 3479 public void setBestRowIdentifierQuery(String value) 3480 { 3481 setString(PROP_BEST_ROW_IDENTIFIER, value); 3482 } 3483 3484 3489 public ResultSet getVersionColumns(String catalog, String schema, String table) throws SQLException 3490 { 3491 if (getCapitializeUsername() && schema != null) schema = schema.toUpperCase(); 3492 String query = (String )properties.get(PROP_VERSION_COLUMNS); 3493 if (query != null) { 3494 if (con != null) { 3495 PreparedStatement stmt = con.prepareStatement(query); 3496 stmt.setString(1, catalog); 3497 stmt.setString(2, schema); 3498 stmt.setString(3, table); 3499 return stmt.executeQuery(); 3500 } else throw new SQLException (bundle.getString("EXC_NoConnection")); } 3502 3503 if (dmd == null) throw new SQLException (bundle.getString("EXC_NoDBMetadata")); return dmd.getVersionColumns(catalog, schema, table); 3505 } 3506 3507 public String getVersionColumnsQuery() 3508 { 3509 return getString(PROP_VERSION_COLUMNS); 3510 } 3511 3512 public void setVersionColumnsQuery(String value) 3513 { 3514 setString(PROP_VERSION_COLUMNS, value); 3515 } 3516 3517 3521 public ResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException 3522 { 3523 if (getCapitializeUsername() && schema != null) schema = schema.toUpperCase(); 3524 String query = (String )properties.get(PROP_PK_QUERY); 3525 if (query != null) { 3526 if (con != null) { 3527 PreparedStatement stmt = con.prepareStatement(query); 3528 stmt.setString(1, catalog); 3529 stmt.setString(2, schema); 3530 stmt.setString(3, table); 3531 return stmt.executeQuery(); 3532 } else throw new SQLException (bundle.getString("EXC_NoConnection")); } 3534 3535 if (dmd == null) throw new SQLException (bundle.getString("EXC_NoDBMetadata")); return dmd.getPrimaryKeys(catalog, schema, table); 3537 } 3538 3539 public String getPrimaryKeysQuery() 3540 { 3541 return getString(PROP_PK_QUERY); 3542 } 3543 3544 public void setPrimaryKeysQuery(String value) 3545 { 3546 setString(PROP_PK_QUERY, value); 3547 } 3548 3549 3556 public ResultSet getImportedKeys(String catalog, String schema, String table) throws SQLException 3557 { 3558 if (getCapitializeUsername() && schema != null) schema = schema.toUpperCase(); 3559 String query = (String )properties.get(PROP_IK_QUERY); 3560 if (query != null) { 3561 if (con != null) { 3562 PreparedStatement stmt = con.prepareStatement(query); 3563 stmt.setString(1, catalog); 3564 stmt.setString(2, schema); 3565 stmt.setString(3, table); 3566 return stmt.executeQuery(); 3567 } else throw new SQLException (bundle.getString("EXC_NoConnection")); } 3569 3570 if (dmd == null) throw new SQLException (bundle.getString("EXC_NoDBMetadata")); return dmd.getImportedKeys(catalog, schema, table); 3572 } 3573 3574 public String getImportedKeysQuery() 3575 { 3576 return getString(PROP_IK_QUERY); 3577 } 3578 3579 public void setImportedKeysQuery(String value) 3580 { 3581 setString(PROP_IK_QUERY, value); 3582 } 3583 3584 3591 public ResultSet getExportedKeys(String catalog, String schema, String table) throws SQLException 3592 { 3593 if (getCapitializeUsername() && schema != null) schema = schema.toUpperCase(); 3594 String query = (String )properties.get(PROP_EK_QUERY); 3595 if (query != null) { 3596 if (con != null) { 3597 PreparedStatement stmt = con.prepareStatement(query); 3598 stmt.setString(1, catalog); 3599 stmt.setString(2, schema); 3600 stmt.setString(3, table); 3601 return stmt.executeQuery(); 3602 } else throw new SQLException (bundle.getString("EXC_NoConnection")); } 3604 3605 if (dmd == null) throw new SQLException (bundle.getString("EXC_NoDBMetadata")); return dmd.getExportedKeys(catalog, schema, table); 3607 } 3608 3609 public String getExportedKeysQuery() 3610 { 3611 return getString(PROP_EK_QUERY); 3612 } 3613 3614 public void setExportedKeysQuery(String value) 3615 { 3616 setString(PROP_EK_QUERY, value); 3617 } 3618 3619 3628 public ResultSet getCrossReference(String catalog, String schema, String table, String foreignCatalog, String foreignSchema, String foreignTable) throws SQLException 3629 { 3630 if (getCapitializeUsername() && schema != null) schema = schema.toUpperCase(); 3631 String query = (String )properties.get(PROP_CROSSREF_QUERY); 3632 if (query != null) { 3633 if (con != null) { 3634 PreparedStatement stmt = con.prepareStatement(query); 3635 stmt.setString(1, catalog); 3636 stmt.setString(2, schema); 3637 stmt.setString(3, table); 3638 stmt.setString(4, foreignCatalog); 3639 stmt.setString(5, foreignSchema); 3640 stmt.setString(6, foreignTable); 3641 return stmt.executeQuery(); 3642 } else throw new SQLException (bundle.getString("EXC_NoConnection")); } 3644 3645 if (dmd == null) throw new SQLException (bundle.getString("EXC_NoDBMetadata")); return dmd.getCrossReference(catalog, schema, table, foreignCatalog, foreignSchema, foreignTable); 3647 } 3648 3649 public String getCrossReferenceQuery() 3650 { 3651 return getString(PROP_CROSSREF_QUERY); 3652 } 3653 3654 public void setCrossReferenceQuery(String value) 3655 { 3656 setString(PROP_CROSSREF_QUERY, value); 3657 } 3658 3659 3664 public ResultSet getTypeInfo() throws SQLException 3665 { 3666 String query = (String )properties.get(PROP_TYPE_INFO_QUERY); 3667 if (query != null) { 3668 if (con != null) return con.createStatement().executeQuery(query); 3669 else throw new SQLException (bundle.getString("EXC_NoConnection")); } 3671 3672 if (dmd == null) throw new SQLException (bundle.getString("EXC_NoDBMetadata")); return dmd.getTypeInfo(); 3674 } 3675 3676 public String getTypeInfoQuery() 3677 { 3678 return getString(PROP_TYPE_INFO_QUERY); 3679 } 3680 3681 public void setTypeInfoQuery(String value) 3682 { 3683 setString(PROP_TYPE_INFO_QUERY, value); 3684 } 3685 3686 3691 public ResultSet getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate) throws SQLException 3692 { 3693 if (getCapitializeUsername() && schema != null) schema = schema.toUpperCase(); 3694 String query = (String )properties.get(PROP_INDEX_INFO_QUERY); 3695 if (query != null) { 3696 if (con != null) { 3697 PreparedStatement stmt = con.prepareStatement(query); 3698 stmt.setString(1, catalog); 3699 stmt.setString(2, schema); 3700 stmt.setString(3, table); 3701 stmt.setBoolean(4, unique); 3702 stmt.setBoolean(5, approximate); 3703 return stmt.executeQuery(); 3704 } else throw new SQLException (bundle.getString("EXC_NoConnection")); } 3706 3707 if (dmd == null) throw new SQLException (bundle.getString("EXC_NoDBMetadata")); return dmd.getIndexInfo(catalog, schema, table, unique, approximate); 3709 } 3710 3711 public String getIndexInfoQuery() 3712 { 3713 return getString(PROP_INDEX_INFO_QUERY); 3714 } 3715 3716 public void setIndexInfoQuery(String value) 3717 { 3718 setString(PROP_INDEX_INFO_QUERY, value); 3719 } 3720 3721 3728 public boolean supportsResultSetType(int type) throws SQLException 3729 { 3730 if (dmd != null) return dmd.supportsResultSetType(type); 3731 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 3733 3734 3743 public boolean supportsResultSetConcurrency(int type, int concurrency) throws SQLException 3744 { 3745 if (dmd != null) return dmd.supportsResultSetConcurrency(type, concurrency); 3746 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 3748 3749 3754 public boolean ownUpdatesAreVisible(int type) throws SQLException 3755 { 3756 if (dmd != null) return dmd.ownUpdatesAreVisible(type); 3757 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 3759 3760 3766 public boolean ownDeletesAreVisible(int type) throws SQLException 3767 { 3768 if (dmd != null) return dmd.ownDeletesAreVisible(type); 3769 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 3771 3772 3778 public boolean ownInsertsAreVisible(int type) throws SQLException 3779 { 3780 if (dmd != null) return dmd.ownInsertsAreVisible(type); 3781 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 3783 3784 3791 public boolean othersUpdatesAreVisible(int type) throws SQLException 3792 { 3793 if (dmd != null) return dmd.othersUpdatesAreVisible(type); 3794 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 3796 3797 3804 public boolean othersDeletesAreVisible(int type) throws SQLException 3805 { 3806 if (dmd != null) return dmd.othersDeletesAreVisible(type); 3807 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 3809 3810 3818 public boolean othersInsertsAreVisible(int type) throws SQLException 3819 { 3820 if (dmd != null) return dmd.othersInsertsAreVisible(type); 3821 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 3823 3824 3831 public boolean updatesAreDetected(int type) throws SQLException 3832 { 3833 if (dmd != null) return dmd.updatesAreDetected(type); 3834 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 3836 3837 3845 public boolean deletesAreDetected(int type) throws SQLException 3846 { 3847 if (dmd != null) return dmd.deletesAreDetected(type); 3848 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 3850 3851 3858 public boolean insertsAreDetected(int type) throws SQLException 3859 { 3860 if (dmd != null) return dmd.insertsAreDetected(type); 3861 else throw new SQLException (bundle.getString("EXC_NoDBMetadata")); } 3863 3864 3868 public boolean supportsBatchUpdates() throws SQLException { 3869 Boolean flag = (Boolean )properties.get(PROP_BATCH_UPDATES); 3870 if (flag == null) { 3871 if (dmd != null) 3872 try { 3873 flag = dmd.supportsBatchUpdates() ? Boolean.TRUE : Boolean.FALSE; 3874 } catch (AbstractMethodError exc) { 3875 } 3878 else 3879 throw new SQLException (bundle.getString("EXC_NoDBMetadata")); properties.put(PROP_BATCH_UPDATES, flag); 3881 } 3882 3883 return flag.booleanValue(); 3884 } 3885 3886 public int getBatchUpdates() 3887 { 3888 return getBoolean(PROP_BATCH_UPDATES); 3889 } 3890 3891 public void setBatchUpdates(int value) 3892 { 3893 setBoolean(PROP_BATCH_UPDATES, value); 3894 } 3895 3896 3901 public ResultSet getUDTs(String catalog, String schemaPattern, String typeNamePattern, int[] types) throws SQLException 3902 { 3903 if (getCapitializeUsername() && schemaPattern != null) schemaPattern = schemaPattern.toUpperCase(); 3904 String query = (String )properties.get(PROP_UDT_QUERY); 3905 if (query != null) { 3906 if (con != null) { 3907 StringBuffer typebuff = new StringBuffer (); 3908 PreparedStatement stmt = con.prepareStatement(query); 3909 stmt.setString(1, catalog); 3910 stmt.setString(2, schemaPattern); 3911 stmt.setString(3, typeNamePattern); 3912 3913 for (int i=0; i<types.length; i++) { 3914 if (i > 0) typebuff.append(", "); 3915 typebuff.append(types[i]); 3916 } 3917 3918 stmt.setString(4, typebuff.toString()); 3919 return stmt.executeQuery(); 3920 } else throw new SQLException (bundle.getString("EXC_NoConnection")); } 3922 3923 if (dmd == null) throw new SQLException (bundle.getString("EXC_NoDBMetadata")); return dmd.getUDTs(catalog, schemaPattern, typeNamePattern, types); 3925 } 3926 3927 public String getUDTsQuery() 3928 { 3929 return getString(PROP_UDT_QUERY); 3930 } 3931 3932 public void setUDTsQuery(String value) 3933 { 3934 setString(PROP_UDT_QUERY, value); 3935 } 3936 3937 3939 public boolean getCapitializeUsername() { 3940 Boolean flag = (Boolean ) properties.get("capitializeUsername"); 3941 if(flag == null) { 3942 flag = Boolean.FALSE; 3944 properties.put("capitializeUsername", flag); 3945 } 3946 return flag.booleanValue(); 3947 } 3948 3949 public void setCapitializeUsername(boolean value) 3950 { 3951 Boolean newValue, oldValue = (Boolean )properties.get(PROP_CAPITALIZE_USERNAME); 3952 newValue = value ? Boolean.TRUE : Boolean.FALSE; 3953 properties.put(PROP_CAPITALIZE_USERNAME, newValue); 3954 propertySupport.firePropertyChange(PROP_CAPITALIZE_USERNAME, oldValue, newValue); 3955 } 3956 3957 3958 3962 public ResultSet getAttributes(String catalog, String schemaPattern, String typeNamePattern, String attributeNamePattern) throws SQLException { 3963 return null; 3964 } 3965 3966 public int getDatabaseMajorVersion() throws SQLException { 3967 return dmd.getDatabaseMajorVersion(); 3968 } 3969 3970 public int getDatabaseMinorVersion() throws SQLException { 3971 return -1; 3972 } 3973 3974 public int getJDBCMajorVersion() throws SQLException { 3975 return -1; 3976 } 3977 3978 public int getJDBCMinorVersion() throws SQLException { 3979 return -1; 3980 } 3981 3982 public int getResultSetHoldability() throws SQLException { 3983 return -1; 3984 } 3985 3986 public int getSQLStateType() throws SQLException { 3987 return -1; 3988 } 3989 3990 public ResultSet getSuperTables(String catalog, String schemaPattern, String tableNamePattern) throws SQLException { 3991 return null; 3992 } 3993 3994 public ResultSet getSuperTypes(String catalog, String schemaPattern, String typeNamePattern) throws SQLException { 3995 return null; 3996 } 3997 3998 public boolean locatorsUpdateCopy() throws SQLException { 3999 return false; 4000 } 4001 4002 public boolean supportsGetGeneratedKeys() throws SQLException { 4003 return false; 4004 } 4005 4006 public boolean supportsMultipleOpenResults() throws SQLException { 4007 return false; 4008 } 4009 4010 public boolean supportsNamedParameters() throws SQLException { 4011 return false; 4012 } 4013 4014 public boolean supportsResultSetHoldability(int holdability) throws SQLException { 4015 return false; 4016 } 4017 4018 public boolean supportsSavepoints() throws SQLException { 4019 return false; 4020 } 4021 4022 public boolean supportsStatementPooling() throws SQLException { 4023 return false; 4024 } 4025 4026 4028 public boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException { 4029 return false; 4030 } 4031 4032 public boolean isWrapperFor (Class clazz) { 4033 return false; 4034 } 4035 4036 public Object unwrap(java.lang.Class iface) throws java.sql.SQLException { 4037 return null; 4038 } 4039 4040 public java.sql.RowIdLifetime getRowIdLifetime() throws SQLException { 4041 return null; 4042 } 4043 4044 public ResultSet getSchemas(String catalog, String schemaPattern) throws SQLException { 4045 return null; 4046 } 4047 4048 public ResultSet getClientInfoProperties() throws SQLException { 4049 return null; 4050 } 4051 4052 public ResultSet getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern) throws SQLException { 4053 return null; 4054 } 4055 4056 public ResultSet getFunctions(String catalog, String schemaPattern, String functionNamePattern) throws SQLException { 4057 return null; 4058 } 4059 4060 public boolean providesQueryObjectGenerator() throws SQLException { 4061 return false; 4062 } 4063 4064 public boolean autoCommitFailureClosesAllResultSets() throws SQLException { 4065 return false; 4066 } 4067} 4068 | Popular Tags |