1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 package java.sql; 19 20 /** 21 * An interface which provides comprehensive information about the database 22 * management system and its supported features. 23 * <p> 24 * This interface is implemented by JDBC driver vendors in order to provide 25 * information about the underlying database capabilities in association with 26 * the JDBC driver. 27 * <p> 28 * Some of the methods in this interface take string parameters which are 29 * patterns. Within these string patterns, {@code '%'} and {@code '_'} 30 * characters have special meanings. {@code '%'} means 31 * "match any substring of 0 or more characters". {@code '_'} means 32 * "match any character". Only metadata entries that match the pattern are 33 * returned. If such a search pattern string is set to {@code null}, that 34 * argument's criteria are dropped from the search. 35 */ 36 public interface DatabaseMetaData extends Wrapper { 37 38 /** 39 * States that it may not be permitted to store {@code NULL} values. 40 */ 41 public static final short attributeNoNulls = 0; 42 43 /** 44 * States that {@code NULL} values are definitely permitted. 45 */ 46 public static final short attributeNullable = 1; 47 48 /** 49 * States that whether {@code NULL} values are permitted is unknown. 50 */ 51 public static final short attributeNullableUnknown = 2; 52 53 /** 54 * States the best row identifier is <em>NOT</em> a pseudo column. 55 */ 56 public static final int bestRowNotPseudo = 1; 57 58 /** 59 * States that the best row identifier is a pseudo column. 60 */ 61 public static final int bestRowPseudo = 2; 62 63 /** 64 * States that the remainder of the current session is used as the scope for 65 * the best row identifier. 66 */ 67 public static final int bestRowSession = 2; 68 69 /** 70 * States that best row identifier scope lasts only while the row is being 71 * used. 72 */ 73 public static final int bestRowTemporary = 0; 74 75 /** 76 * States that the remainder of the current transaction is used as the scope 77 * for the best row identifier. 78 */ 79 public static final int bestRowTransaction = 1; 80 81 /** 82 * States that the best row identifier may or may not be a pseudo column. 83 */ 84 public static final int bestRowUnknown = 0; 85 86 /** 87 * States that the column must not allow {@code NULL} values. 88 */ 89 public static final int columnNoNulls = 0; 90 91 /** 92 * States that the column definitely allows {@code NULL} values. 93 */ 94 public static final int columnNullable = 1; 95 96 /** 97 * States that it is unknown whether the columns may be nulled. 98 */ 99 public static final int columnNullableUnknown = 2; 100 101 /** 102 * For the column {@code UPDATE_RULE}, states that when the primary key is 103 * updated, the foreign key (imported key) is changed accordingly. 104 */ 105 public static final int importedKeyCascade = 0; 106 107 /** 108 * States that the evaluation of foreign key constraints is deferred (delayed 109 * until commit). 110 */ 111 public static final int importedKeyInitiallyDeferred = 5; 112 113 /** 114 * States that the evaluation of foreign key constraint is {@code IMMEDIATE} 115 * . 116 */ 117 public static final int importedKeyInitiallyImmediate = 6; 118 119 /** 120 * For the columns {@code UPDATE_RULE} and {@code DELETE_RULE}, states that 121 * if the primary key has been imported, it cannot be updated or deleted. 122 */ 123 public static final int importedKeyNoAction = 3; 124 125 /** 126 * States that the evaluation of foreign key constraint must not be {@code 127 * DEFERRED}. 128 */ 129 public static final int importedKeyNotDeferrable = 7; 130 131 /** 132 * States that a primary key must not be updated when imported as a foreign 133 * key by some other table. Used for the column {@code UPDATE_RULE}. 134 */ 135 public static final int importedKeyRestrict = 1; 136 137 /** 138 * States that when the primary key is modified (updated or deleted) the 139 * foreign (imported) key is changed to its default value. Applies to the 140 * {@code UPDATE_RULE} and {@code DELETE_RULE} columns. 141 */ 142 public static final int importedKeySetDefault = 4; 143 144 /** 145 * States that when the primary key is modified (updated or deleted) the 146 * foreign (imported) key is changed to {@code NULL}. Applies to the {@code 147 * UPDATE_RULE} and {@code DELETE_RULE} columns. 148 */ 149 public static final int importedKeySetNull = 2; 150 151 /** 152 * States that the column stores {@code IN} type parameters. 153 */ 154 public static final int procedureColumnIn = 1; 155 156 /** 157 * States that this column stores {@code INOUT} type parameters. 158 */ 159 public static final int procedureColumnInOut = 2; 160 161 /** 162 * States that this column stores {@code OUT} type parameters. 163 */ 164 public static final int procedureColumnOut = 4; 165 166 /** 167 * States that the column stores results. 168 */ 169 public static final int procedureColumnResult = 3; 170 171 /** 172 * States that the column stores return values. 173 */ 174 public static final int procedureColumnReturn = 5; 175 176 /** 177 * States that type of the column is unknown. 178 */ 179 public static final int procedureColumnUnknown = 0; 180 181 /** 182 * States that {@code NULL} values are not permitted. 183 */ 184 public static final int procedureNoNulls = 0; 185 186 /** 187 * States that the procedure does not return a result. 188 */ 189 public static final int procedureNoResult = 1; 190 191 /** 192 * States that {@code NULL} values are permitted. 193 */ 194 public static final int procedureNullable = 1; 195 196 /** 197 * States that it is unknown whether {@code NULL} values are permitted. 198 */ 199 public static final int procedureNullableUnknown = 2; 200 201 /** 202 * States that it is unknown whether or not the procedure returns a result. 203 */ 204 public static final int procedureResultUnknown = 0; 205 206 /** 207 * States that the procedure returns a result. 208 */ 209 public static final int procedureReturnsResult = 2; 210 211 /** 212 * States that the value is an SQL99 {@code SQLSTATE} value. 213 */ 214 public static final int sqlStateSQL99 = 2; 215 216 /** 217 * States that the value is an SQL {@code CLI SQLSTATE} value as defined by 218 * the X/Open standard. 219 */ 220 public static final int sqlStateXOpen = 1; 221 222 /** 223 * States that this table index is a clustered index. 224 */ 225 public static final short tableIndexClustered = 1; 226 227 /** 228 * States that this table index is a hashed index. 229 */ 230 public static final short tableIndexHashed = 2; 231 232 /** 233 * States this table's index is neither a clustered index, not a hashed 234 * index, and not a table statistics index; i.e. it is something else. 235 */ 236 public static final short tableIndexOther = 3; 237 238 /** 239 * States this column has the table's statistics, and that it is returned in 240 * conjunction with the table's index description. 241 */ 242 public static final short tableIndexStatistic = 0; 243 244 /** 245 * States that a {@code NULL} value is <em>NOT</em> permitted for 246 * this data type. 247 */ 248 public static final int typeNoNulls = 0; 249 250 /** 251 * States that a {@code NULL} value is permitted for this data type. 252 */ 253 public static final int typeNullable = 1; 254 255 /** 256 * States that it is unknown if a {@code NULL} value is permitted for 257 * this data type. 258 */ 259 public static final int typeNullableUnknown = 2; 260 261 /** 262 * States that this column shall not be used for {@code WHERE} statements 263 * with a {@code LIKE} clause. 264 */ 265 public static final int typePredBasic = 2; 266 267 /** 268 * States that this column can only be used in a {@code WHERE...LIKE} 269 * statement. 270 */ 271 public static final int typePredChar = 1; 272 273 /** 274 * States that this column does not support searches. 275 */ 276 public static final int typePredNone = 0; 277 278 /** 279 * States that the column is searchable. 280 */ 281 public static final int typeSearchable = 3; 282 283 /** 284 * States that the version column is known to be not a pseudo column. 285 */ 286 public static final int versionColumnNotPseudo = 1; 287 288 /** 289 * States that this version column is known to be a pseudo column. 290 */ 291 public static final int versionColumnPseudo = 2; 292 293 /** 294 * States that the version column may be a pseudo column or not. 295 */ 296 public static final int versionColumnUnknown = 0; 297 298 /** 299 * States that the method DatabaseMetaData.getSQLStateType may returns an 300 * SQLSTATE value or not. 301 */ 302 public static final int sqlStateSQL = 2; 303 304 /** 305 * States that the parameter or column is an IN parameter 306 */ 307 public static final int functionColumnIn = 1; 308 309 /** 310 * States that the parameter or column is an INOUT parameter 311 */ 312 public static final int functionColumnInOut = 2; 313 314 /** 315 * States that the parameter or column is an OUT parameter 316 */ 317 public static final int functionColumnOut = 3; 318 319 /** 320 * States that the parameter or column is a return value 321 */ 322 public static final int functionReturn = 4; 323 324 /** 325 * States that the parameter of function is unknown 326 */ 327 public static final int functionColumnUnknown = 0; 328 329 /** 330 * States that the parameter or column is a column in a result set 331 */ 332 public static final int functionColumnResult = 5; 333 334 /** 335 * States that NULL values are not allowed 336 */ 337 public static final int functionNoNulls = 0; 338 339 /** 340 * States that NULL values are allowed 341 */ 342 public static final int functionNullable = 1; 343 344 /** 345 * States that whether NULL values are allowed is unknown 346 */ 347 public static final int functionNullableUnknown = 2; 348 349 /** 350 * States that it is not known whether the function returns a result or a 351 * table 352 */ 353 public static final int functionResultUnknown = 0; 354 355 /** 356 * States that the function does not return a table 357 */ 358 public static final int functionNoTable = 1; 359 360 /** 361 * States that the function returns a table. 362 */ 363 public static final int functionReturnsTable = 2; 364 365 /** 366 * Returns whether all procedures returned by {@link #getProcedures} can be 367 * called by the current user. 368 * 369 * @return {@code true} if all procedures can be called by the current user, 370 * {@code false} otherwise. 371 * @throws SQLException 372 * if there is a database error. 373 */ allProceduresAreCallable()374 public boolean allProceduresAreCallable() throws SQLException; 375 376 /** 377 * Returns whether all the tables returned by {@code getTables} can be used 378 * by the current user in a {@code SELECT} statement. 379 * 380 * @return {@code true} if all the tables can be used,{@code false} 381 * otherwise. 382 * @throws SQLException 383 * if there is a database error. 384 */ allTablesAreSelectable()385 public boolean allTablesAreSelectable() throws SQLException; 386 387 /** 388 * Returns whether a data definition statement in a transaction forces a {@code 389 * commit} of the transaction. 390 * 391 * @return {@code true} if the statement forces a commit, {@code false} 392 * otherwise. 393 * @throws SQLException 394 * if there is a database error. 395 */ dataDefinitionCausesTransactionCommit()396 public boolean dataDefinitionCausesTransactionCommit() throws SQLException; 397 398 /** 399 * Returns whether the database ignores data definition statements within a 400 * transaction. 401 * 402 * @return {@code true} if the database ignores a data definition statement, 403 * {@code false} otherwise. 404 * @throws SQLException 405 * if there is a database error. 406 */ dataDefinitionIgnoredInTransactions()407 public boolean dataDefinitionIgnoredInTransactions() throws SQLException; 408 409 /** 410 * Returns whether a visible row delete can be detected by calling 411 * {@link ResultSet#rowDeleted}. 412 * 413 * @param type 414 * the type of the {@code ResultSet} involved: {@code 415 * ResultSet.TYPE_FORWARD_ONLY}, {@code 416 * ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code 417 * ResultSet.TYPE_SCROLL_SENSITIVE} 418 * @return {@code true} if the visible row delete can be detected, {@code 419 * false} otherwise. 420 * @throws SQLException 421 * if there is a database error. 422 */ deletesAreDetected(int type)423 public boolean deletesAreDetected(int type) throws SQLException; 424 425 /** 426 * Returns whether the return value of {@code getMaxRowSize} includes the 427 * SQL data types {@code LONGVARCHAR} and {@code LONGVARBINARY}. 428 * 429 * @return {@code true} if the return value includes {@code LONGVARBINARY} 430 * and {@code LONGVARCHAR}, otherwise {@code false}. 431 * @throws SQLException 432 * if there is a database error. 433 */ doesMaxRowSizeIncludeBlobs()434 public boolean doesMaxRowSizeIncludeBlobs() throws SQLException; 435 436 /** 437 * Returns a {@code ResultSet} describing a subset of the attributes of a 438 * specified SQL User Defined Type (UDT) for a specified schema and catalog. 439 * The subset is determined by restricting to those attributes whose 440 * name matches the {@code attributeNamePattern} and whose type name 441 * matches the {@code typeNamePattern}. Each row of the {@code ResultSet} 442 * describes one attribute, and the rows are ordered by the columns {@code TYPE_SCHEM}, 443 * {@code TYPE_NAME} and {@code ORDINAL_POSITION}. Inherited attributes 444 * are not included. 445 * <p> 446 * The columns of the returned {@code ResultSet} object have the following 447 * names and meanings: 448 * <ol> 449 * <li>{@code TYPE_CAT} - String - the type catalog name (possibly {@code 450 * null})</li> 451 * <li>{@code TYPE_SCHEM} - String - the type schema name (possibly {@code 452 * null})</li> 453 * <li>{@code TYPE_NAME} - String - the type name</li> 454 * <li>{@code ATTR_NAME} - String - the attribute name</li> 455 * <li>{@code DATA_TYPE} - int - the attribute type as defined in {@code 456 * java.sql.Types}</li> 457 * <li>{@code ATTR_TYPE_NAME} - String - the attribute type name. This 458 * depends on the data source. For a {@code UDT} the name is fully 459 * qualified. For a {@code REF} it is both fully qualified and represents 460 * the target type of the reference.</li> 461 * <li>{@code ATTR_SIZE} - int - the column size. When referring to char and 462 * date types this value is the maximum number of characters. When referring 463 * to numeric types is is the precision.</li> 464 * <li>{@code DECIMAL_DIGITS} - int - how many fractional digits are 465 * supported</li> 466 * <li>{@code NUM_PREC_RADIX} - int - numeric values radix</li> 467 * <li>{@code NULLABLE} - int - whether {@code NULL} is permitted: 468 * <ul> 469 * <li>DatabaseMetaData.attributeNoNulls - {@code NULL} values not permitted</li> 470 * <li>DatabaseMetaData.attributeNullable - {@code NULL} values definitely 471 * permitted</li> 472 * <li>DatabaseMetaData.attributeNullableUnknown - unknown</li> 473 * </ul> 474 * </li> 475 * <li>{@code REMARKS} - String - a comment describing the attribute 476 * (possibly {@code null})</li> 477 * <li>ATTR_DEF - String - Default value for the attribute (possibly {@code 478 * null})</li> 479 * <li>{@code SQL_DATA_TYPE} - int - not used</li> 480 * <li>SQL_DATETIME_SUB - int - not used</li> 481 * <li>CHAR_OCTET_LENGTH - int - for {@code CHAR} types, the max number of 482 * bytes in the column</li> 483 * <li>ORDINAL_POSITION - int - The index of the column in the table (where 484 * the count starts from 1, not 0)</li> 485 * <li>IS_NULLABLE - String - {@code "NO"} = the column does not allow {@code 486 * NULL}s, {@code "YES"} = the column allows {@code NULL}s, "" = status unknown</li> 487 * <li>{@code SCOPE_CATALOG} - String - if the {@code DATA_TYPE} is {@code REF}, 488 * this gives the catalog of the table corresponding to the attribute's scope. 489 * NULL if the {@code DATA_TYPE} is not REF.</li> 490 * <li>{@code SCOPE_SCHEMA} - String - if the {@code DATA_TYPE} is {@code REF}, 491 * this gives the schema of the table corresponding to the attribute's scope. 492 * NULL if the {@code DATA_TYPE} is not REF.</li> 493 * <li>{@code SCOPE_TABLE} - String - if the {@code DATA_TYPE} is {@code REF}, 494 * this gives the name of the table corresponding to the attribute's scope. 495 * NULL if the {@code DATA_TYPE} is not REF.</li> 496 * <li>{@code SOURCE_DATA_TYPE} - String - The source type for a user 497 * generated REF type or for a Distinct type. ({@code NULL} if {@code 498 * DATA_TYPE} is not DISTINCT or a user generated REF)</li> 499 * </ol> 500 * 501 * @param catalog 502 * a catalog name. {@code null} is used to imply no narrowing of 503 * the search by catalog name. Otherwise, the name must match a 504 * catalog name held in the database, with "" used to retrieve 505 * those without a catalog name. 506 * @param schemaPattern 507 * a schema name pattern. {@code null} is used to imply no 508 * narrowing of the search by a schema name. Otherwise, the name 509 * must match a schema name in the database, with "" used to 510 * retrieve those without a schema name. 511 * @param typeNamePattern 512 * a type name. This pattern must match the type name stored in 513 * the database. 514 * @param attributeNamePattern 515 * an Attribute name. This pattern must match the attribute name as stored in 516 * the database. 517 * @return a {@code ResultSet}, where each row is an attribute description. 518 * @throws SQLException 519 * if there is a database error. 520 */ getAttributes(String catalog, String schemaPattern, String typeNamePattern, String attributeNamePattern)521 public ResultSet getAttributes(String catalog, String schemaPattern, 522 String typeNamePattern, String attributeNamePattern) 523 throws SQLException; 524 525 /** 526 * Returns a list of a table's optimal set of columns that uniquely 527 * identify the rows. The results are ordered by {@code SCOPE} (see below). 528 * <p> 529 * The results are returned as a table, with one entry for each column, as 530 * follows: 531 * <ol> 532 * <li>{@code SCOPE} - short - the {@code SCOPE} of the result, as follows: 533 * <ul> 534 * <li>{@code DatabaseMetaData.bestRowTemporary} - the result is very temporary, 535 * only valid while on the current row</li> 536 * <li>{@code DatabaseMetaData.bestRowTransaction} - the result is good for remainder of 537 * current transaction</li> 538 * <li>{@code DatabaseMetaData.bestRowSession} - the result is good for remainder of 539 * database session</li> 540 * </ul> 541 * </li> 542 * <li>{@code COLUMN_NAME} - String - the column name</li> 543 * <li>{@code DATA_TYPE} - int - the Type of the data, as defined in {@code 544 * java.sql.Types}</li> 545 * <li>{@code TYPE_NAME} - String - the Name of the type - database dependent. 546 * For UDT types the name is fully qualified</li> 547 * <li>{@code COLUMN_SIZE} - int - the precision of the data in the column</li> 548 * <li>{@code BUFFER_LENGTH} - int - not used</li> 549 * <li>{@code DECIMAL_DIGITS} - short - number of fractional digits</li> 550 * <li>{@code PSEUDO_COLUMN} - short - whether this is a pseudo column (e.g. 551 * an Oracle {@code ROWID}): 552 * <ul> 553 * <li>{@code DatabaseMetaData.bestRowUnknown} - it is not known whether this is 554 * a pseudo column</li> 555 * <li>{@code DatabaseMetaData.bestRowNotPseudo} - the column is not pseudo</li> 556 * <li>{@code DatabaseMetaData.bestRowPseudo} - the column is a pseudo column</li> 557 * </ul> 558 * </li> 559 * </ol> 560 * 561 * @param catalog 562 * a catalog name. {@code null} is used to imply no narrowing of 563 * the search by catalog name. Otherwise, the name must match a 564 * catalog name held in the database, with "" used to retrieve 565 * those without a catalog name. 566 * @param schema 567 * a schema name pattern. {@code null} is used to imply no 568 * narrowing of the search by schema name. Otherwise, the name 569 * must match a schema name in the database, with "" used to 570 * retrieve those without a schema name. 571 * @param table 572 * the table name. This must match the name of the table as 573 * declared in the database. 574 * @param scope 575 * the {@code SCOPE} of interest, values as defined above. 576 * @param nullable 577 * {@code true} = include columns that are nullable, {@code 578 * false} = do not include nullable columns. 579 * @return a {@code ResultSet} where each row is a description of a column 580 * and the complete set of rows is the optimal set for this table. 581 * @throws SQLException 582 * if there is a database error. 583 */ getBestRowIdentifier(String catalog, String schema, String table, int scope, boolean nullable)584 public ResultSet getBestRowIdentifier(String catalog, String schema, 585 String table, int scope, boolean nullable) throws SQLException; 586 587 /** 588 * Returns the set of catalog names available in this database. The set is 589 * returned ordered by catalog name. 590 * 591 * @return a {@code ResultSet} containing the catalog names, with each row 592 * containing one catalog name (as a {@code String}) in the 593 * single column named {@code TABLE_CAT}. 594 * @throws SQLException 595 * if there is a database error. 596 */ getCatalogs()597 public ResultSet getCatalogs() throws SQLException; 598 599 /** 600 * Returns the separator that this database uses between a catalog name and 601 * table name. 602 * 603 * @return a String containing the separator. 604 * @throws SQLException 605 * if there is a database error. 606 */ getCatalogSeparator()607 public String getCatalogSeparator() throws SQLException; 608 609 /** 610 * Returns the term that the database vendor prefers term for "catalog". 611 * 612 * @return a String with the vendor's term for "catalog". 613 * @throws SQLException 614 * if there is a database error. 615 */ getCatalogTerm()616 public String getCatalogTerm() throws SQLException; 617 618 /** 619 * Returns a description of access rights for a table's columns. Only access 620 * rights matching the criteria for the column name are returned. 621 * <p> 622 * The description is returned as a {@code ResultSet} with rows of data for 623 * each access right, with columns as follows: 624 * <ol> 625 * <li>{@code TABLE_CAT} - String - the catalog name (possibly {@code null})</li> 626 * <li>{@code TABLE_SCHEM} - String - the schema name (possibly {@code null})</li> 627 * <li>{@code TABLE_NAME} - String - the table name</li> 628 * <li>{@code COLUMN_NAME} - String - the Column name</li> 629 * <li>{@code GRANTOR} - String - the grantor of access (possibly {@code 630 * null})</li> 631 * <li>{@code PRIVILEGE} - String - Access right - one of SELECT, INSERT, 632 * UPDATE, REFERENCES,...</li> 633 * <li>{@code IS_GRANTABLE} - String - {@code "YES"} implies that the 634 * receiver can grant access to others, {@code "NO"} if the receiver cannot 635 * grant access to others, {@code null} if unknown.</li> 636 * </ol> 637 * 638 * @param catalog 639 * a catalog name. {@code null} is used to imply no narrowing of 640 * the search by catalog name. Otherwise, the name must match a 641 * catalog name held in the database, with "" used to retrieve 642 * those without a catalog name. 643 * @param schema 644 * a schema name pattern. {@code null} is used to imply no 645 * narrowing of the search by schema name. Otherwise, the name 646 * must match a schema name in the database, with "" used to 647 * retrieve those without a schema name. 648 * @param table 649 * the table name. This must match the name of the table as 650 * declared in the database. 651 * @param columnNamePattern 652 * the column name. This must match the name of a column in the 653 * table in the database. 654 * @return a {@code ResultSet} containing the access rights, one row for 655 * each privilege description. 656 * @throws SQLException 657 * if there is a database error. 658 */ getColumnPrivileges(String catalog, String schema, String table, String columnNamePattern)659 public ResultSet getColumnPrivileges(String catalog, String schema, 660 String table, String columnNamePattern) throws SQLException; 661 662 /** 663 * Returns a description of table columns available in a specified catalog. 664 * Only descriptions meeting the specified catalog, schema, table, and column 665 * names are returned. 666 * <p> 667 * The descriptions are returned as a {@code ResultSet} conforming to the 668 * following data layout, with one row per table column: 669 * <ol> 670 * <li>{@code TABLE_CAT} - String - the catalog name (possibly {@code null})</li> 671 * <li>{@code TABLE_SCHEM} - String - the schema name (possibly {@code null})</li> 672 * <li>{@code TABLE_NAME} - String - the table name</li> 673 * <li>{@code COLUMN_NAME} - String - the column name</li> 674 * <li>{@code DATA_TYPE} - int - the SQL type as specified in {@code 675 * java.sql.Types}</li> 676 * <li>{@code TYPE_NAME} - String - the name of the data type, (database-dependent, 677 * UDT names are fully qualified)</li> 678 * <li>{@code COLUMN_SIZE} - int - the column size (the precision for numeric 679 * types, max characters for {@code char} and {@code date} types)</li> 680 * <li>{@code BUFFER_LENGTH} - int - Not used</li> 681 * <li>{@code DECIMAL_DIGITS} - int - maximum number of fractional digits</li> 682 * <li>{@code NUM_PREC_RADIX} - int - the radix for numerical types</li> 683 * <li>{@code NULLABLE} - int - whether the column allows {@code null}s: 684 * <ul> 685 * <li>DatabaseMetaData.columnNoNulls = may not allow {@code NULL}s</li> 686 * <li>DatabaseMetaData.columnNullable = does allow {@code NULL}s</li> 687 * <li>DatabaseMetaData.columnNullableUnknown = unknown {@code NULL} status</li> 688 * </ul> 689 * </li> 690 * <li>{@code REMARKS} - String - A description of the column (possibly 691 * {@code null})</li> 692 * <li>{@code COLUMN_DEF} - String - Default value for the column (possibly 693 * {@code null})</li> 694 * <li>{@code SQL_DATA_TYPE} - int - not used</li> 695 * <li>{@code SQL_DATETIME_SUB} - int - not used</li> 696 * <li>{@code CHAR_OCTET_LENGTH} - int - maximum number of bytes in the 697 * {@code char} type columns</li> 698 * <li>{@code ORDINAL_POSITION} - int - the column index in the table (1 based)</li> 699 * <li>{@code IS_NULLABLE} - String - {@code "NO"} = column does not allow 700 * NULLs, {@code "YES"} = column allows NULLs, "" = {@code NULL} status 701 * unknown</li> 702 * <li>{@code SCOPE_CATALOG} - String - if the {@code DATA_TYPE} is {@code REF}, 703 * this gives the catalog of the table corresponding to the attribute's scope. 704 * NULL if the {@code DATA_TYPE} is not REF.</li> 705 * <li>{@code SCOPE_SCHEMA} - String - if the {@code DATA_TYPE} is {@code REF}, 706 * this gives the schema of the table corresponding to the attribute's scope. 707 * NULL if the {@code DATA_TYPE} is not REF.</li> 708 * <li>{@code SCOPE_TABLE} - String - if the {@code DATA_TYPE} is {@code REF}, 709 * this gives the name of the table corresponding to the attribute's scope. 710 * NULL if the {@code DATA_TYPE} is not REF.</li> 711 * <li>{@code SOURCE_DATA_TYPE} - String - The source type for a user 712 * generated REF type or for a Distinct type. ({@code NULL} if {@code 713 * DATA_TYPE} is not DISTINCT or a user generated REF)</li> 714 * </ol> 715 * 716 * @param catalog 717 * a catalog name. {@code null} is used to imply no narrowing of 718 * the search by catalog name. Otherwise, the name must match a 719 * catalog name held in the database, with "" used to retrieve 720 * those without a catalog name. 721 * @param schemaPattern 722 * a schema name pattern. {@code null} is used to imply no 723 * narrowing of the search by schema name. Otherwise, the name 724 * must match a schema name in the database, with "" used to 725 * retrieve those without a schema name. 726 * @param tableNamePattern 727 * the table name. This must match the name of the table as 728 * declared in the database. 729 * @param columnNamePattern 730 * the column name. This must match the name of a column in the 731 * table in the database. 732 * @return the descriptions as a {@code ResultSet} with rows in the form 733 * defined above. 734 * @throws SQLException 735 * if there is a database error. 736 */ getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)737 public ResultSet getColumns(String catalog, String schemaPattern, 738 String tableNamePattern, String columnNamePattern) 739 throws SQLException; 740 741 /** 742 * Returns the database connection that created this metadata. 743 * 744 * @return the connection to the database. 745 * @throws SQLException 746 * if there is a database error. 747 */ getConnection()748 public Connection getConnection() throws SQLException; 749 750 /** 751 * Returns a list of foreign key columns in a given foreign key table that 752 * reference the primary key columns of a supplied primary key table. This 753 * describes how one table imports the key of another table. It would be 754 * expected to return a single foreign key - primary key pair in most cases. 755 * <p> 756 * The descriptions are returned as a {@code ResultSet} with one row for 757 * each foreign key, with the following layout: 758 * <ol> 759 * <li>{@code PKTABLE_CAT} - String - from the primary key table : Catalog 760 * (possibly {@code null})</li> 761 * <li>{@code PKTABLE_SCHEM} - String - from the primary key table : Schema 762 * (possibly {@code null})</li> 763 * <li>{@code PKTABLE_NAME} - String - from the primary key table : name</li> 764 * <li>{@code PKCOLUMN_NAME} - String - from the primary key column : name</li> 765 * <li>{@code FKTABLE_CAT} - String - from the foreign key table : the 766 * catalog name being exported (possibly {@code null})</li> 767 * <li>{@code FKTABLE_SCHEM} - String - from the foreign key table : the schema name 768 * being exported (possibly {@code null})</li> 769 * <li>{@code FKTABLE_NAME} - String - from the foreign key table : the name being 770 * exported</li> 771 * <li>{@code FKCOLUMN_NAME} - String - from the foreign key column : the name being 772 * exported</li> 773 * <li>{@code KEY_SEQ} - short - the sequence number (in the foreign key)</li> 774 * <li>{@code UPDATE_RULE} - short - a value giving the rule for how to treat the corresponding foreign key when a primary 775 * key is updated: 776 * <ul> 777 * <li>{@code DatabaseMetaData.importedKeyNoAction} - don't allow the 778 * primary key to be updated if it is imported as a foreign key</li> 779 * <li>{@code DatabaseMetaData.importedKeyCascade} - change the imported key to 780 * match the updated primary key</li> 781 * <li>{@code DatabaseMetaData.importedKeySetNull} - set the imported key to 782 * {@code null}</li> 783 * <li>{@code DatabaseMetaData.importedKeySetDefault} - set the imported key 784 * to its default value</li> 785 * <li>{@code DatabaseMetaData.importedKeyRestrict} - same as {@code 786 * importedKeyNoAction}</li> 787 * </ul> 788 * </li> 789 * <li>{@code DELETE_RULE} - short - a value giving the rule for how to treat the foreign key when the corresponding primary 790 * key is deleted: 791 * <ul> 792 * <li>{@code DatabaseMetaData.importedKeyNoAction} - don't allow the 793 * primary key to be deleted if it is imported as a foreign key</li> 794 * <li>{@code DatabaseMetaData.importedKeyCascade} - delete those rows that 795 * import a deleted key</li> 796 * <li>{@code DatabaseMetaData.importedKeySetNull} - set the imported key to 797 * {@code null}</li> 798 * <li>{@code DatabaseMetaData.importedKeySetDefault} - set the imported key 799 * to its default value</li> 800 * <li>{@code DatabaseMetaData.importedKeyRestrict} - same as 801 * importedKeyNoAction</li> 802 * </ul> 803 * </li> 804 * <li>{@code FK_NAME} - String - the foreign key name (possibly {@code null})</li> 805 * <li>{@code PK_NAME} - String - the primary key name (possibly {@code null})</li> 806 * <li>{@code DEFERRABILITY} - short - whether foreign key constraints can be 807 * deferred until commit (see the SQL92 specification for definitions): 808 * <ul> 809 * <li>{@code DatabaseMetaData.importedKeyInitiallyDeferred}</li> 810 * <li>{@code DatabaseMetaData.importedKeyInitiallyImmediate}</li> 811 * <li>{@code DatabaseMetaData.importedKeyNotDeferrable}</li> 812 * </ul> 813 * </li> 814 * </ol> 815 * 816 * @param primaryCatalog 817 * a catalog name for the primary key table. {@code null} is used to imply no narrowing of 818 * the search by catalog name. Otherwise, the name must match a 819 * catalog name held in the database, with "" used to retrieve 820 * those without a catalog name. 821 * @param primarySchema 822 * a schema name for the primary key table. {@code null} is used to imply no narrowing of 823 * the search by schema name. Otherwise, the name must match a 824 * schema name in the database, with "" used to retrieve those 825 * without a schema name. 826 * @param primaryTable 827 * the name of the table which exports the key. It must match the 828 * name of the table in the database. 829 * @param foreignCatalog 830 * a catalog name for the foreign key table. {@code null} is used to imply no narrowing of 831 * the search by catalog name. Otherwise, the name must match a 832 * catalog name held in the database, with "" used to retrieve 833 * those without a catalog name. 834 * @param foreignSchema 835 * a schema name for the foreign key table. {@code null} is used to imply no narrowing of 836 * the search by schema name. Otherwise, the name must match a 837 * schema name in the database, with "" used to retrieve those 838 * without a schema name. 839 * @param foreignTable 840 * the name of the table importing the key. It must match the 841 * name of the table in the database. 842 * @return a {@code ResultSet} containing rows with the descriptions of the 843 * foreign keys laid out according to the format defined above. 844 * @throws SQLException 845 * if there is a database error. 846 */ getCrossReference(String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable)847 public ResultSet getCrossReference(String primaryCatalog, 848 String primarySchema, String primaryTable, String foreignCatalog, 849 String foreignSchema, String foreignTable) throws SQLException; 850 851 /** 852 * Returns the major version number of the database software. 853 * 854 * @return the major version number of the database software. 855 * @throws SQLException 856 * a database error occurred. 857 */ getDatabaseMajorVersion()858 public int getDatabaseMajorVersion() throws SQLException; 859 860 /** 861 * Returns the minor version number of the database software. 862 * 863 * @return the minor version number of the database software. 864 * @throws SQLException 865 * a database error occurred. 866 */ getDatabaseMinorVersion()867 public int getDatabaseMinorVersion() throws SQLException; 868 869 /** 870 * Returns the name of the database software. 871 * 872 * @return a {@code String} with the name of the database software. 873 * @throws SQLException 874 * a database error occurred. 875 */ getDatabaseProductName()876 public String getDatabaseProductName() throws SQLException; 877 878 /** 879 * Returns the version number of this database software. 880 * 881 * @return a {@code String} with the version number of the database 882 * software. 883 * @throws SQLException 884 * a database error occurred. 885 */ getDatabaseProductVersion()886 public String getDatabaseProductVersion() throws SQLException; 887 888 /** 889 * Returns the default transaction isolation level for this database. 890 * 891 * @return the default transaction isolation level. One of the following values: 892 * <ul> 893 * <li>{@code TRANSACTION_NONE}</li> 894 * <li>{@code TRANSACTION_READ_COMMITTED}</li> 895 * <li>{@code TRANSACTION_READ_UNCOMMITTED}</li> 896 * <li>{@code TRANSACTION_REPEATABLE_READ}</li> 897 * <li>{@code TRANSACTION_SERIALIZABLE}</li> 898 * </ul> 899 * @throws SQLException 900 * a database error occurred. 901 */ getDefaultTransactionIsolation()902 public int getDefaultTransactionIsolation() throws SQLException; 903 904 /** 905 * Returns the JDBC driver's major version number. 906 * 907 * @return the driver's major version number. 908 */ getDriverMajorVersion()909 public int getDriverMajorVersion(); 910 911 /** 912 * Returns the JDBC driver's minor version number. 913 * 914 * @return the driver's minor version number. 915 */ getDriverMinorVersion()916 public int getDriverMinorVersion(); 917 918 /** 919 * Returns the name of this JDBC driver. 920 * 921 * @return a {@code String} containing the name of the JDBC driver 922 * @throws SQLException 923 * a database error occurred. 924 */ getDriverName()925 public String getDriverName() throws SQLException; 926 927 /** 928 * Returns the version number of this JDBC driver. 929 * 930 * @return a {@code String} containing the complete version number of the 931 * JDBC driver. 932 * @throws SQLException 933 * a database error occurred. 934 */ getDriverVersion()935 public String getDriverVersion() throws SQLException; 936 937 /** 938 * Returns a list of the foreign key columns that reference the primary key 939 * columns of a specified table (the foreign keys exported by a table). 940 * <p> 941 * The list is returned as a {@code ResultSet} with a row for each of the 942 * foreign key columns, ordered by {@code FKTABLE_CAT}, {@code 943 * FKTABLE_SCHEM}, {@code FKTABLE_NAME}, and {@code KEY_SEQ}, with the 944 * format for each row being: 945 * <ol> 946 * <li>{@code PKTABLE_CAT} - String - from the primary key table : the catalog (possibly 947 * {@code null})</li> 948 * <li>{@code PKTABLE_SCHEM} - String - from the primary key table : the schema (possibly 949 * {@code null})</li> 950 * <li>{@code PKTABLE_NAME} - String - from the primary key table : the name</li> 951 * <li>{@code PKCOLUMN_NAME} - String - from the primary key column : the name</li> 952 * <li>{@code FKTABLE_CAT} - String - from the foreign key table : the catalog name being 953 * exported (possibly {@code null})</li> 954 * <li>{@code FKTABLE_SCHEM} - String - from the foreign key table : the schema name 955 * being exported (possibly {@code null})</li> 956 * <li>{@code FKTABLE_NAME} - String - from the foreign key table : the name being 957 * exported</li> 958 * <li>{@code FKCOLUMN_NAME} - String - from the foreign key column : the name being 959 * exported</li> 960 * <li>{@code KEY_SEQ} - short - the sequence number (in the foreign key)</li> 961 * <li>{@code UPDATE_RULE} - short - a value giving the rule for how to treat the foreign key when the corresponding primary 962 * key is updated: 963 * <ul> 964 * <li>{@code DatabaseMetaData.importedKeyNoAction} - don't allow the 965 * primary key to be updated if it is imported as a foreign key</li> 966 * <li>{@code DatabaseMetaData.importedKeyCascade} - change the imported key to 967 * match the primary key update</li> 968 * <li>{@code DatabaseMetaData.importedKeySetNull} - set the imported key to 969 * {@code null}</li> 970 * <li>{@code DatabaseMetaData.importedKeySetDefault} - set the imported key 971 * to its default value</li> 972 * <li>{@code DatabaseMetaData.importedKeyRestrict} - same as 973 * importedKeyNoAction</li> 974 * </ul> 975 * </li> 976 * <li>{@code DELETE_RULE} - short - how to treat the foreign key when the corresponding primary 977 * key is deleted: 978 * <ul> 979 * <li>{@code DatabaseMetaData.importedKeyNoAction} - don't allow the 980 * primary key to be deleted if it is imported as a foreign key</li> 981 * <li>{@code DatabaseMetaData.importedKeyCascade} - the deletion should 982 * also delete rows that import a deleted key</li> 983 * <li>{@code DatabaseMetaData.importedKeySetNull} - the deletion sets the 984 * imported key to {@code null}</li> 985 * <li>{@code DatabaseMetaData.importedKeySetDefault} - the deletion sets the 986 * imported key to its default value</li> 987 * <li>{@code DatabaseMetaData.importedKeyRestrict} - same as 988 * importedKeyNoAction</li> 989 * </ul> 990 * </li> 991 * <li>{@code FK_NAME} - String - the foreign key name (possibly {@code null})</li> 992 * <li>{@code PK_NAME} - String - the primary key name (possibly {@code null})</li> 993 * <li>{@code DEFERRABILITY} - short - defines whether the foreign key 994 * constraints can be deferred until commit (see the SQL92 specification for 995 * definitions): 996 * <ul> 997 * <li>{@code DatabaseMetaData.importedKeyInitiallyDeferred}</li> 998 * <li>{@code DatabaseMetaData.importedKeyInitiallyImmediate}</li> 999 * <li>{@code DatabaseMetaData.importedKeyNotDeferrable}</li> 1000 * </ul> 1001 * </li> 1002 * </ol> 1003 * 1004 * @param catalog 1005 * a catalog name. {@code null} is used to imply no narrowing of 1006 * the search by catalog name. Otherwise, the name must match a 1007 * catalog name held in the database, with "" used to retrieve 1008 * those without a catalog name. 1009 * @param schema 1010 * a schema name. {@code null} is used to imply no narrowing of 1011 * the search by schema name. Otherwise, the name must match a 1012 * schema name in the database, with "" used to retrieve those 1013 * without a schema name. 1014 * @param table 1015 * a table name, which must match the name of a table in the 1016 * database 1017 * @return a {@code ResultSet} containing a row for each of the foreign key 1018 * columns, as defined above 1019 * @throws SQLException 1020 * a database error occurred 1021 */ getExportedKeys(String catalog, String schema, String table)1022 public ResultSet getExportedKeys(String catalog, String schema, String table) 1023 throws SQLException; 1024 1025 /** 1026 * Returns a string of characters that may be used in unquoted identifier 1027 * names. The characters {@code a-z}, {@code A-Z}, {@code 0-9} and {@code _} 1028 * are always permitted. 1029 * 1030 * @return a String containing all the additional permitted characters. 1031 * @throws SQLException 1032 * a database error occurred. 1033 */ getExtraNameCharacters()1034 public String getExtraNameCharacters() throws SQLException; 1035 1036 /** 1037 * Returns the string used to quote SQL identifiers. Returns " " (space) if 1038 * identifier quoting not supported. 1039 * 1040 * @return the String used to quote SQL identifiers. 1041 * @throws SQLException 1042 * a database error occurred. 1043 */ getIdentifierQuoteString()1044 public String getIdentifierQuoteString() throws SQLException; 1045 1046 /** 1047 * Returns a list columns in a table that are both primary keys and 1048 * referenced by the table's foreign key columns (that is, the primary keys 1049 * imported by a table). 1050 * <p> 1051 * The list returned is a {@code ResultSet} with a row entry for each 1052 * primary key column, ordered by {@code PKTABLE_CAT}, {@code PKTABLE_SCHEM}, 1053 * {@code PKTABLE_NAME}, and {@code KEY_SEQ}, with the following format: 1054 * <ol> 1055 * <li>{@code PKTABLE_CAT} - String - primary key catalog name being 1056 * imported (possibly {@code null})</li> 1057 * <li>{@code PKTABLE_SCHEM} - String - primary key schema name being 1058 * imported (possibly {@code null})</li> 1059 * <li>{@code PKTABLE_NAME} - String - primary key table name being imported 1060 * </li> 1061 * <li>{@code PKCOLUMN_NAME} - String - primary key column name being 1062 * imported</li> 1063 * <li>{@code FKTABLE_CAT} - String - foreign key table catalog name 1064 * (possibly {@code null})</li> 1065 * <li>{@code FKTABLE_SCHEM} - String - foreign key table schema name 1066 * (possibly {@code null})</li> 1067 * <li>{@code FKTABLE_NAME} - String - foreign key table name</li> 1068 * <li>{@code FKCOLUMN_NAME} - String - foreign key column name</li> 1069 * <li>{@code KEY_SEQ} - short - sequence number (in the foreign key)</li> 1070 * <li>{@code UPDATE_RULE} - short - how to treat the foreign key when the corresponding primary 1071 * key is updated: 1072 * <ul> 1073 * <li>{@code DatabaseMetaData.importedKeyNoAction} - don't allow any update of 1074 * the primary key if it is imported as a foreign key</li> 1075 * <li>{@code DatabaseMetaData.importedKeyCascade} - change imported key to 1076 * match the primary key update</li> 1077 * <li>{@code DatabaseMetaData.importedKeySetNull} - set the imported key to 1078 * {@code null}</li> 1079 * <li>{@code DatabaseMetaData.importedKeySetDefault} - set the imported key 1080 * to its default value</li> 1081 * <li>{@code DatabaseMetaData.importedKeyRestrict} - same as 1082 * importedKeyNoAction</li> 1083 * </ul> 1084 * </li> 1085 * <li>{@code DELETE_RULE} - short - how to treat the foreign key when the corresponding primary 1086 * key is deleted: 1087 * <ul> 1088 * <li>{@code DatabaseMetaData.importedKeyNoAction} - don't allow the primary key to be deleted 1089 * if it is imported as a foreign key</li> 1090 * <li>{@code DatabaseMetaData.importedKeyCascade} - delete those rows that 1091 * import a deleted key</li> 1092 * <li>{@code DatabaseMetaData.importedKeySetNull} - set the imported key to 1093 * {@code null}</li> 1094 * <li>{@code DatabaseMetaData.importedKeySetDefault} - set the imported key 1095 * to its default value</li> 1096 * <li>{@code DatabaseMetaData.importedKeyRestrict} - same as {@code 1097 * importedKeyNoAction}</li> 1098 * </ul> 1099 * </li> 1100 * <li>{@code FK_NAME} - String - foreign key name (possibly {@code null})</li> 1101 * <li>{@code PK_NAME} - String - primary key name (possibly {@code null})</li> 1102 * <li>{@code DEFERRABILITY} - short - defines whether foreign key 1103 * constraints can be deferred until commit (see SQL92 specification for 1104 * definitions): 1105 * <ul> 1106 * <li>{@code DatabaseMetaData.importedKeyInitiallyDeferred}</li> 1107 * <li>{@code DatabaseMetaData.importedKeyInitiallyImmediate}</li> 1108 * <li>{@code DatabaseMetaData.importedKeyNotDeferrable}</li> 1109 * </ul> 1110 * </li> 1111 * </ol> 1112 * 1113 * @param catalog 1114 * a catalog name. {@code null} is used to imply no narrowing of 1115 * the search by catalog name. Otherwise, the name must match a 1116 * catalog name held in the database, with "" used to retrieve 1117 * those without a catalog name. 1118 * @param schema 1119 * a schema name. {@code null} is used to imply no narrowing of 1120 * the search by schema name. Otherwise, the name must match a 1121 * schema name in the database, with "" used to retrieve those 1122 * without a schema name. 1123 * @param table 1124 * a table name, which must match the name of a table in the 1125 * database. 1126 * @return a {@code ResultSet} containing the list of primary key columns as 1127 * rows in the format defined above. 1128 * @throws SQLException 1129 * a database error occurred. 1130 */ getImportedKeys(String catalog, String schema, String table)1131 public ResultSet getImportedKeys(String catalog, String schema, String table) 1132 throws SQLException; 1133 1134 /** 1135 * Returns a list of indices and statistics for a specified table. 1136 * <p> 1137 * The list is returned as a {@code ResultSet}, with one row for each index 1138 * or statistic. The list is ordered by {@code NON_UNIQUE}, {@code TYPE}, 1139 * {@code INDEX_NAME}, and {@code ORDINAL_POSITION}. Each row has the 1140 * following format: 1141 * <ol> 1142 * <li>{@code TABLE_CAT} - String - table catalog name (possibly {@code 1143 * null})</li> 1144 * <li>{@code TABLE_SCHEM} - String - table schema name (possibly {@code 1145 * null})</li> 1146 * <li>{@code TABLE_NAME} - String - The table name</li> 1147 * <li>{@code NON_UNIQUE} - boolean - {@code true} when index values can be 1148 * non-unique. Must be {@code false} when the TYPE is tableIndexStatistic</li> 1149 * <li>{@code INDEX_QUALIFIER} - String : index catalog name. {@code null} 1150 * when the TYPE is 'tableIndexStatistic'</li> 1151 * <li>{@code INDEX_NAME} - String : index name. {@code null} when TYPE is 1152 * 'tableIndexStatistic'</li> 1153 * <li>{@code TYPE} - short - the index type. One of: 1154 * <ul> 1155 * <li>{@code DatabaseMetaData.tableIndexStatistic} - table statistics 1156 * returned with Index descriptions</li> 1157 * <li>{@code DatabaseMetaData.tableIndexClustered} - a clustered Index</li> 1158 * <li>{@code DatabaseMetaData.tableIndexHashed} - a hashed Index</li> 1159 * <li>{@code DatabaseMetaData.tableIndexOther} - other style of Index</li> 1160 * </ul> 1161 * </li> 1162 * <li>{@code ORDINAL_POSITION} - short - column sequence within Index. 0 1163 * when TYPE is tableIndexStatistic</li> 1164 * <li>{@code COLUMN_NAME} - String - the column name. {@code null} when 1165 * TYPE is tableIndexStatistic</li> 1166 * <li>{@code ASC_OR_DESC} - String - column sort sequence. {@code null} if 1167 * sequencing not supported or TYPE is tableIndexStatistic; otherwise "A" 1168 * means sort ascending and "D" means sort descending.</li> 1169 * <li>{@code CARDINALITY} - int - Number of unique values in the Index. If 1170 * TYPE is tableIndexStatistic, this is number of rows in the table.</li> 1171 * <li>{@code PAGES} - int - Number of pages for current Index. If TYPE is 1172 * tableIndexStatistic, this is number of pages used for the table.</li> 1173 * <li>{@code FILTER_CONDITION} - String - Filter condition. (possibly null) 1174 * </li> 1175 * </ol> 1176 * 1177 * @param catalog 1178 * a catalog name. {@code null} is used to imply no narrowing of 1179 * the search by catalog name. Otherwise, the name must match a 1180 * catalog name held in the database, with "" used to retrieve 1181 * those without a catalog name. 1182 * @param schema 1183 * a schema name. {@code null} is used to imply no narrowing of 1184 * the search by schema name. Otherwise, the name must match a 1185 * schema name in the database, with "" used to retrieve those 1186 * without a schema name. 1187 * @param table 1188 * a table name, which must match the name of a table in the 1189 * database. 1190 * @param unique 1191 * {@code true} means only return indices for unique values, 1192 * {@code false} implies that they can be returned even if not 1193 * unique. 1194 * @param approximate 1195 * {@code true} implies that the list can contain approximate or 1196 * "out of data" values, {@code false} implies that all values 1197 * must be precisely accurate 1198 * @return a {@code ResultSet} containing the list of indices and statistics 1199 * for the table, in the format defined above. 1200 * @throws SQLException 1201 * a database error occurred. 1202 */ getIndexInfo(String catalog, String schema, String table, boolean unique, boolean approximate)1203 public ResultSet getIndexInfo(String catalog, String schema, String table, 1204 boolean unique, boolean approximate) throws SQLException; 1205 1206 /** 1207 * Returns this driver's major JDBC version number. 1208 * 1209 * @return the major JDBC version number. 1210 * @throws SQLException 1211 * a database error occurred. 1212 */ getJDBCMajorVersion()1213 public int getJDBCMajorVersion() throws SQLException; 1214 1215 /** 1216 * Returns the minor JDBC version number for this driver. 1217 * 1218 * @return the Minor JDBC Version Number. 1219 * @throws SQLException 1220 * a database error occurred. 1221 */ getJDBCMinorVersion()1222 public int getJDBCMinorVersion() throws SQLException; 1223 1224 /** 1225 * Get the maximum number of hex characters in an in-line binary literal for 1226 * this database. 1227 * 1228 * @return the maximum number of hex characters in an in-line binary 1229 * literal. If the number is unlimited then the result is zero. 1230 * @throws SQLException 1231 * a database error occurred. 1232 */ getMaxBinaryLiteralLength()1233 public int getMaxBinaryLiteralLength() throws SQLException; 1234 1235 /** 1236 * Returns the maximum size of a catalog name in this database. 1237 * 1238 * @return the maximum size in characters for a catalog name. If the limit 1239 * is unknown, or the value is unlimited, then the result is zero. 1240 * @throws SQLException 1241 * a database error occurred. 1242 */ getMaxCatalogNameLength()1243 public int getMaxCatalogNameLength() throws SQLException; 1244 1245 /** 1246 * Returns the maximum size for a character literal in this database. 1247 * 1248 * @return the maximum size in characters for a character literal. If the 1249 * limit is unknown, or the value is unlimited, then the result is 1250 * zero. 1251 * @throws SQLException 1252 * a database error occurred. 1253 */ getMaxCharLiteralLength()1254 public int getMaxCharLiteralLength() throws SQLException; 1255 1256 /** 1257 * Returns the maximum size for a Column name for this database. 1258 * 1259 * @return the maximum number of characters for a Column name. If the limit 1260 * is unknown, or the value is unlimited, then the result is zero. 1261 * @throws SQLException 1262 * a database error occurred. 1263 */ getMaxColumnNameLength()1264 public int getMaxColumnNameLength() throws SQLException; 1265 1266 /** 1267 * Get the maximum number of columns in a {@code GROUP BY} clause for this 1268 * database. 1269 * 1270 * @return the maximum number of columns in a {@code GROUP BY} clause. If 1271 * the limit is unknown, or the value is unlimited, then the result 1272 * is zero. 1273 * @throws SQLException 1274 * a database error occurred. 1275 */ getMaxColumnsInGroupBy()1276 public int getMaxColumnsInGroupBy() throws SQLException; 1277 1278 /** 1279 * Returns the maximum number of columns in an Index for this database. 1280 * 1281 * @return the maximum number of columns in an Index. If the limit is 1282 * unknown, or the value is unlimited, then the result is zero. 1283 * @throws SQLException 1284 * a database error occurred. 1285 */ getMaxColumnsInIndex()1286 public int getMaxColumnsInIndex() throws SQLException; 1287 1288 /** 1289 * Returns the maximum number of columns in an {@code ORDER BY} clause for 1290 * this database. 1291 * 1292 * @return the maximum number of columns in an {@code ORDER BY} clause. If 1293 * the limit is unknown, or the value is unlimited, then the result 1294 * is zero. 1295 * @throws SQLException 1296 * a database error occurred. 1297 */ getMaxColumnsInOrderBy()1298 public int getMaxColumnsInOrderBy() throws SQLException; 1299 1300 /** 1301 * Returns the maximum number of columns in a {@code SELECT} list for this 1302 * database. 1303 * 1304 * @return the maximum number of columns in a {@code SELECT} list. If the 1305 * limit is unknown, or the value is unlimited, then the result is 1306 * zero. 1307 * @throws SQLException 1308 * a database error occurred. 1309 */ getMaxColumnsInSelect()1310 public int getMaxColumnsInSelect() throws SQLException; 1311 1312 /** 1313 * Returns the maximum number of columns in a table for this database. 1314 * 1315 * @return the maximum number of columns in a table. If the limit is 1316 * unknown, or the value is unlimited, then the result is zero. 1317 * @throws SQLException 1318 * a database error occurred. 1319 */ getMaxColumnsInTable()1320 public int getMaxColumnsInTable() throws SQLException; 1321 1322 /** 1323 * Returns the database's maximum number of concurrent connections. 1324 * 1325 * @return the maximum number of connections. If the limit is unknown, or 1326 * the value is unlimited, then the result is zero. 1327 * @throws SQLException 1328 * a database error occurred. 1329 */ getMaxConnections()1330 public int getMaxConnections() throws SQLException; 1331 1332 /** 1333 * Returns the maximum length of a cursor name for this database. 1334 * 1335 * @return the maximum number of characters in a cursor name. If the limit 1336 * is unknown, or the value is unlimited, then the result is zero. 1337 * @throws SQLException 1338 * a database error occurred. 1339 */ getMaxCursorNameLength()1340 public int getMaxCursorNameLength() throws SQLException; 1341 1342 /** 1343 * Returns the maximum length in bytes for an Index for this database. This 1344 * covers all the parts of a composite index. 1345 * 1346 * @return the maximum length in bytes for an Index. If the limit is 1347 * unknown, or the value is unlimited, then the result is zero. 1348 * @throws SQLException 1349 * a database error occurred. 1350 */ getMaxIndexLength()1351 public int getMaxIndexLength() throws SQLException; 1352 1353 /** 1354 * Returns the maximum number of characters for a procedure name in this 1355 * database. 1356 * 1357 * @return the maximum number of character for a procedure name. If the 1358 * limit is unknown, or the value is unlimited, then the result is 1359 * zero. 1360 * @throws SQLException 1361 * a database error occurred. 1362 */ getMaxProcedureNameLength()1363 public int getMaxProcedureNameLength() throws SQLException; 1364 1365 /** 1366 * Returns the maximum number of bytes within a single row for this 1367 * database. 1368 * 1369 * @return the maximum number of bytes for a single row. If the limit is 1370 * unknown, or the value is unlimited, then the result is zero. 1371 * @throws SQLException 1372 * a database error occurred. 1373 */ getMaxRowSize()1374 public int getMaxRowSize() throws SQLException; 1375 1376 /** 1377 * Returns the maximum number of characters in a schema name for this 1378 * database. 1379 * 1380 * @return the maximum number of characters in a schema name. If the limit 1381 * is unknown, or the value is unlimited, then the result is zero. 1382 * @throws SQLException 1383 * a database error occurred. 1384 */ getMaxSchemaNameLength()1385 public int getMaxSchemaNameLength() throws SQLException; 1386 1387 /** 1388 * Returns the maximum number of characters in an SQL statement for this 1389 * database. 1390 * 1391 * @return the maximum number of characters in an SQL statement. If the 1392 * limit is unknown, or the value is unlimited, then the result is 1393 * zero. 1394 * @throws SQLException 1395 * a database error occurred. 1396 */ getMaxStatementLength()1397 public int getMaxStatementLength() throws SQLException; 1398 1399 /** 1400 * Get the maximum number of simultaneously open active statements for this 1401 * database. 1402 * 1403 * @return the maximum number of open active statements. If the limit is 1404 * unknown, or the value is unlimited, then the result is zero. 1405 * @throws SQLException 1406 * a database error occurred. 1407 */ getMaxStatements()1408 public int getMaxStatements() throws SQLException; 1409 1410 /** 1411 * Returns the maximum size for a table name in the database. 1412 * 1413 * @return the maximum size in characters for a table name. If the limit is 1414 * unknown, or the value is unlimited, then the result is zero. 1415 * @throws SQLException 1416 * a database error occurred. 1417 */ getMaxTableNameLength()1418 public int getMaxTableNameLength() throws SQLException; 1419 1420 /** 1421 * Returns the maximum number of tables permitted in a {@code SELECT} 1422 * statement for the database. 1423 * 1424 * @return the maximum number of tables permitted in a {@code SELECT} 1425 * statement. If the limit is unknown, or the value is unlimited, 1426 * then the result is zero. 1427 * @throws SQLException 1428 * a database error occurred. 1429 */ getMaxTablesInSelect()1430 public int getMaxTablesInSelect() throws SQLException; 1431 1432 /** 1433 * Returns the maximum number of characters in a user name for the database. 1434 * 1435 * @return the maximum number of characters in a user name. If the limit is 1436 * unknown, or the value is unlimited, then the result is zero. 1437 * @throws SQLException 1438 * a database error occurred. 1439 */ getMaxUserNameLength()1440 public int getMaxUserNameLength() throws SQLException; 1441 1442 /** 1443 * Returns a list of the math functions available with this database. These 1444 * are used in the JDBC function escape clause and are the Open Group CLI 1445 * math function names. 1446 * 1447 * @return a String which contains the list of math functions as a comma 1448 * separated list. 1449 * @throws SQLException 1450 * a database error occurred. 1451 */ getNumericFunctions()1452 public String getNumericFunctions() throws SQLException; 1453 1454 /** 1455 * Returns a list of the primary key columns of a specified table. 1456 * <p> 1457 * The list is returned as a {@code ResultSet} with one row for each primary 1458 * key column, ordered by {@code COLUMN_NAME}, with each row having the 1459 * structure as follows: 1460 * <ol> 1461 * <li>{@code TABLE_CAT} - String - table catalog name (possibly null)</li> 1462 * <li>{@code TABLE_SCHEM} - String - table schema name (possibly null)</li> 1463 * <li>{@code TABLE_NAME} - String - The table name</li> 1464 * <li>{@code COLUMN_NAME} - String - The column name</li> 1465 * <li>{@code KEY_SEQ} - short - the sequence number for this column in the 1466 * primary key</li> 1467 * <li>{@code PK_NAME} - String - the primary key name (possibly null)</li> 1468 * </ol> 1469 * 1470 * @param catalog 1471 * a catalog name. {@code null} is used to imply no narrowing of 1472 * the search by catalog name. Otherwise, the name must match a 1473 * catalog name held in the database, with the empty string used 1474 * to retrieve those without a catalog name. 1475 * @param schema 1476 * a schema name. {@code null} is used to imply no narrowing of 1477 * the search by schema name. Otherwise, the name must match a 1478 * schema name in the database, with the empty string used to 1479 * retrieve those without a schema name. 1480 * @param table 1481 * the name of a table, which must match the name of a table in 1482 * the database. 1483 * @return a {@code ResultSet} containing the list of keys in the format 1484 * defined above. 1485 * @throws SQLException 1486 * a database error occurred. 1487 */ getPrimaryKeys(String catalog, String schema, String table)1488 public ResultSet getPrimaryKeys(String catalog, String schema, String table) 1489 throws SQLException; 1490 1491 /** 1492 * Returns a list of parameter and result columns for the stored procedures 1493 * belonging to a specified catalog. 1494 * <p> 1495 * The list is returned as a {@code ResultSet} with one row for each 1496 * parameter or result column. The data is ordered by {@code 1497 * PROCEDURE_SCHEM} and {@code PROCEDURE_NAME}, while for each procedure, 1498 * the return value (if any) is first, followed by the parameters in the 1499 * order they appear in the stored procedure call, followed by {@code 1500 * ResultSet} columns in column number order. Each row has the following 1501 * structure: 1502 * <ol> 1503 * <li>{@code PROCEDURE_CAT} - String - the procedure catalog name</li> 1504 * <li>{@code PROCEDURE_SCHEM} - String - the procedure schema name 1505 * (possibly null)</li> 1506 * <li>{@code PROCEDURE_NAME} - String - the procedure name</li> 1507 * <li>{@code COLUMN_NAME} - String - the name of the column</li> 1508 * <li>{@code COLUMN_TYPE} - short - the kind of column or parameter, as 1509 * follows: 1510 * <ul> 1511 * <li>{@code DatabaseMetaData.procedureColumnUnknown} - type unknown</li> 1512 * <li>{@code DatabaseMetaData.procedureColumnIn} - an {@code IN} parameter</li> 1513 * <li>{@code DatabaseMetaData.procedureColumnInOut} - an {@code INOUT} 1514 * parameter</li> 1515 * <li>{@code DatabaseMetaData.procedureColumnOut} - an {@code OUT} 1516 * parameter</li> 1517 * <li>{@code DatabaseMetaData.procedureColumnReturn} - a return value</li> 1518 * <li>{@code DatabaseMetaData.procedureReturnsResult} - a result column in 1519 * a result set</li> 1520 * </ul> 1521 * </li> 1522 * <li>{@code DATA_TYPE} - int - the SQL type of the data, as in {@code 1523 * java.sql.Types}</li> 1524 * <li>{@code TYPE_NAME} - String - the SQL type name, for a UDT it is fully 1525 * qualified</li> 1526 * <li>{@code PRECISION} - int - the precision</li> 1527 * <li>{@code LENGTH} - int - the length of the data in bytes</li> 1528 * <li>{@code SCALE} - short - the scale for numeric types</li> 1529 * <li>{@code RADIX} - short - the Radix for numeric data (typically 2 or 1530 * 10)</li> 1531 * <li>{@code NULLABLE} - short - can the data contain {@code null}: 1532 * <ul> 1533 * <li>{@code DatabaseMetaData.procedureNoNulls} - {@code NULL}s not 1534 * permitted</li> 1535 * <li>{@code DatabaseMetaData.procedureNullable} - {@code NULL}s are 1536 * permitted</li> 1537 * <li>{@code DatabaseMetaData.procedureNullableUnknown} - {@code NULL} 1538 * status unknown</li> 1539 * </ul> 1540 * </li> 1541 * <li>{@code REMARKS} - String - an explanatory comment about the data item 1542 * </li> 1543 * </ol> 1544 * 1545 * @param catalog 1546 * a catalog name. {@code null} is used to imply no narrowing of 1547 * the search by catalog name. Otherwise, the name must match a 1548 * catalog name held in the database, with "" used to retrieve 1549 * those without a catalog name. 1550 * @param schemaPattern 1551 * a schema name pattern. {@code null} is used to imply no 1552 * narrowing of the search by schema name. Otherwise, the name 1553 * must match a schema name in the database, with "" used to 1554 * retrieve those without a schema name. 1555 * @param procedureNamePattern 1556 * a pattern that must match the name of the procedure stored in 1557 * the database. 1558 * @param columnNamePattern 1559 * a column name pattern. The name must match the column name 1560 * stored in the database. 1561 * @return a {@code ResultSet} with the list of parameter and result columns 1562 * in the format defined above. 1563 * @throws SQLException 1564 * a database error occurred. 1565 */ getProcedureColumns(String catalog, String schemaPattern, String procedureNamePattern, String columnNamePattern)1566 public ResultSet getProcedureColumns(String catalog, String schemaPattern, 1567 String procedureNamePattern, String columnNamePattern) 1568 throws SQLException; 1569 1570 /** 1571 * Returns a list of the stored procedures available in a specified catalog. 1572 * <p> 1573 * The list is returned as a {@code ResultSet} with one row for each stored 1574 * procedure, ordered by PROCEDURE_SCHEM and PROCEDURE_NAME, with the data 1575 * in each row as follows: 1576 * <ol> 1577 * <li>{@code PROCEDURE_CAT} - String : the procedure catalog name</li> 1578 * <li>{@code PROCEDURE_SCHEM} - String : the procedure schema name 1579 * (possibly {@code null})</li> 1580 * <li>{@code PROCEDURE_NAME} - String : the procedure name</li> 1581 * <li>{@code Reserved}</li> 1582 * <li>{@code Reserved}</li> 1583 * <li>{@code Reserved}</li> 1584 * <li>{@code REMARKS} - String - information about the procedure</li> 1585 * <li>{@code PROCEDURE_TYPE} - short : one of: 1586 * <ul> 1587 * <li>{@code DatabaseMetaData.procedureResultUnknown} - procedure may 1588 * return a result</li> 1589 * <li>{@code DatabaseMetaData.procedureNoResult} - procedure does not 1590 * return a result</li> 1591 * <li>{@code DatabaseMetaData.procedureReturnsResult} - procedure 1592 * definitely returns a result</li> 1593 * </ul> 1594 * </li> 1595 * </ol> 1596 * 1597 * @param catalog 1598 * a catalog name. {@code null} is used to imply no narrowing of 1599 * the search by catalog name. Otherwise, the name must match a 1600 * catalog name held in the database, with "" used to retrieve 1601 * those without a catalog name. 1602 * @param schemaPattern 1603 * a schema name pattern. {@code null} is used to imply no 1604 * narrowing of the search by schema name. Otherwise, the name 1605 * must match a schema name in the database, with "" used to 1606 * retrieve those without a schema name. 1607 * @param procedureNamePattern 1608 * a procedure name pattern, which must match the procedure name 1609 * stored in the database. 1610 * @return a {@code ResultSet} where each row is a description of a stored 1611 * procedure in the format defined above. 1612 * @throws SQLException 1613 * a database error occurred. 1614 */ getProcedures(String catalog, String schemaPattern, String procedureNamePattern)1615 public ResultSet getProcedures(String catalog, String schemaPattern, 1616 String procedureNamePattern) throws SQLException; 1617 1618 /** 1619 * Returns the database vendor's preferred name for "procedure". 1620 * 1621 * @return a String with the vendor's preferred name for "procedure". 1622 * @throws SQLException 1623 * a database error occurred. 1624 */ getProcedureTerm()1625 public String getProcedureTerm() throws SQLException; 1626 1627 /** 1628 * Returns the result set's default holdability. 1629 * 1630 * @return one of {@code ResultSet.HOLD_CURSORS_OVER_COMMIT} or {@code 1631 * ResultSet.CLOSE_CURSORS_AT_COMMIT}. 1632 * @throws SQLException 1633 * a database error occurred. 1634 */ getResultSetHoldability()1635 public int getResultSetHoldability() throws SQLException; 1636 1637 /** 1638 * Returns a list of the schema names in the database. The list is returned 1639 * as a {@code ResultSet}, ordered by the schema name, with one row per 1640 * schema in the following format: 1641 * <ol> 1642 * <li>{@code TABLE_SCHEM} - String - the schema name</li> <li>{@code 1643 * TABLE_CATALOG} - String - the catalog name (possibly {@code null}) </li> 1644 * </ol> 1645 * 1646 * @return a {@code ResultSet} with one row for each schema in the format 1647 * defined above. 1648 * @throws SQLException 1649 * a database error occurred. 1650 */ getSchemas()1651 public ResultSet getSchemas() throws SQLException; 1652 1653 /** 1654 * Returns the database vendor's preferred term for "schema". 1655 * 1656 * @return a String which is the vendor's preferred term for schema. 1657 * @throws SQLException 1658 * a database error occurred. 1659 */ getSchemaTerm()1660 public String getSchemaTerm() throws SQLException; 1661 1662 /** 1663 * Returns the string that is used to escape wildcard characters. This 1664 * string is used to escape the {@code '_'} and {@code '%'} wildcard 1665 * characters in catalog search pattern strings. {@code '_'} is used to represent any single 1666 * character while {@code '%'} is used for a sequence of zero or more 1667 * characters. 1668 * 1669 * @return a String used to escape the wildcard characters. 1670 * @throws SQLException 1671 * a database error occurred. 1672 */ getSearchStringEscape()1673 public String getSearchStringEscape() throws SQLException; 1674 1675 /** 1676 * Returns a list of all the SQL keywords that are NOT also SQL92 keywords 1677 * for the database. 1678 * 1679 * @return a String containing the list of SQL keywords in a comma separated 1680 * format. 1681 * @throws SQLException 1682 * a database error occurred. 1683 */ getSQLKeywords()1684 public String getSQLKeywords() throws SQLException; 1685 1686 /** 1687 * States the type of {@code SQLState} value returned by {@code 1688 * SQLException.getSQLState}. This can either be the X/Open (now known as 1689 * Open Group) SQL CLI form or the SQL99 form. 1690 * 1691 * @return an integer, which is either {@code 1692 * DatabaseMetaData.sqlStateSQL99} or {@code 1693 * DatabaseMetaData.sqlStateXOpen}. 1694 * @throws SQLException 1695 * a database error occurred. 1696 */ getSQLStateType()1697 public int getSQLStateType() throws SQLException; 1698 1699 /** 1700 * Returns a list of string functions available with the database. These 1701 * functions are used in JDBC function escape clause and follow the Open 1702 * Group CLI string function names definition. 1703 * 1704 * @return a String containing the list of string functions in comma 1705 * separated format. 1706 * @throws SQLException 1707 * a database error occurred. 1708 */ getStringFunctions()1709 public String getStringFunctions() throws SQLException; 1710 1711 /** 1712 * Returns a listing of the hierarchies of tables in a specified schema in 1713 * the database. 1714 * <p> 1715 * The listing only contains entries for tables that have a super table. 1716 * Super tables and corresponding subtables must be defined in the same catalog and schema. The 1717 * list is returned as a {@code ResultSet}, with one row for each table that 1718 * has a super table, in the following format: 1719 * <ol> 1720 * <li>{@code TABLE_CAT} - String - table catalog name (possibly {@code 1721 * null})</li> 1722 * <li>{@code TABLE_SCHEM} - String - Table schema name (possibly {@code 1723 * null})</li> 1724 * <li>{@code TABLE_NAME} - String - The table name</li> 1725 * <li>SUPER{@code TABLE_NAME} - String - The super table name</li> 1726 * </ol> 1727 * 1728 * @param catalog 1729 * a catalog name. {@code null} is used to imply no narrowing of 1730 * the search by catalog name. Otherwise, the name must match a 1731 * catalog name held in the database, with "" used to retrieve 1732 * those without a catalog name. 1733 * @param schemaPattern 1734 * a schema name pattern. {@code null} is used to imply no 1735 * narrowing of the search by schema name. Otherwise, the name 1736 * must match a schema name in the database, with "" used to 1737 * retrieve those without a schema name. 1738 * @param tableNamePattern 1739 * a table name, which should match the table name as stored in 1740 * the database. it may be a fully qualified name. If it is fully 1741 * qualified the catalog name and schema name parameters are 1742 * ignored. 1743 * @return a {@code ResultSet} with one row for each table which has a super 1744 * table, in the format defined above. An empty {@code ResultSet} is 1745 * returned if the database does not support table hierarchies. 1746 * @throws SQLException 1747 * a database error occurred. 1748 */ getSuperTables(String catalog, String schemaPattern, String tableNamePattern)1749 public ResultSet getSuperTables(String catalog, String schemaPattern, 1750 String tableNamePattern) throws SQLException; 1751 1752 /** 1753 * Returns the User Defined Type (UDT) hierarchies for a given schema. Only 1754 * the immediate parent/child relationship is described. If a UDT does not 1755 * have a direct supertype, it is not listed. 1756 * <p> 1757 * The listing is returned as a {@code ResultSet} where there is one row for 1758 * a specific UDT which describes its supertype, with the data organized in 1759 * columns as follows: 1760 * <ol> 1761 * <li>{@code TYPE_CAT} - String - the UDT catalog name (possibly {@code 1762 * null})</li> 1763 * <li>{@code TYPE_SCHEM} - String - the UDT schema name (possibly {@code 1764 * null})</li> 1765 * <li>{@code TYPE_NAME} - String - the UDT type name</li> 1766 * <li>SUPER{@code TYPE_CAT} - String - direct supertype's catalog name 1767 * (possibly {@code null})</li> 1768 * <li>SUPER{@code TYPE_SCHEM} - String - direct supertype's schema name 1769 * (possibly {@code null})</li> 1770 * <li>SUPER{@code TYPE_NAME} - String - direct supertype's name</li> 1771 * </ol> 1772 * 1773 * @param catalog 1774 * the catalog name. "" means get the UDTs without a catalog. 1775 * {@code null} means don't use the catalog name to restrict the 1776 * search. 1777 * @param schemaPattern 1778 * the Schema pattern name. "" means get the UDT's without a 1779 * schema. 1780 * @param typeNamePattern 1781 * the UDT name pattern. This may be a fully qualified name. When 1782 * a fully qualified name is specified, the catalog name and 1783 * schema name parameters are ignored. 1784 * @return a {@code ResultSet} in which each row gives information about a 1785 * particular UDT in the format defined above. An empty ResultSet is 1786 * returned for a database that does not support type hierarchies. 1787 * @throws SQLException 1788 * a database error occurred. 1789 */ getSuperTypes(String catalog, String schemaPattern, String typeNamePattern)1790 public ResultSet getSuperTypes(String catalog, String schemaPattern, 1791 String typeNamePattern) throws SQLException; 1792 1793 /** 1794 * Returns a list of system functions available with the database. These are 1795 * names used in the JDBC function escape clause and are Open Group CLI 1796 * function names. 1797 * 1798 * @return a String containing the list of system functions in a comma 1799 * separated format. 1800 * @throws SQLException 1801 * a database error occurred. 1802 */ getSystemFunctions()1803 public String getSystemFunctions() throws SQLException; 1804 1805 /** 1806 * Returns a description of access rights for each table present in a 1807 * catalog. Table privileges can apply to one or more columns in the table - 1808 * but are not guaranteed to apply to all columns. 1809 * <p> 1810 * The privileges are returned as a {@code ResultSet}, with one row for each 1811 * privilege, ordered by {@code TABLE_SCHEM}, {@code TABLE_NAME}, {@code 1812 * PRIVILEGE}, and each row has data as defined in the following column 1813 * definitions: 1814 * <ol> 1815 * <li>{@code TABLE_CAT} - String - table catalog name (possibly {@code 1816 * null})</li> 1817 * <li>{@code TABLE_SCHEM} - String - Table schema name (possibly {@code 1818 * null})</li> 1819 * <li>{@code TABLE_NAME} - String - The table name</li> 1820 * <li>GRANTOR - String - who granted the access</li> 1821 * <li>GRANTEE - String - who received the access grant</li> 1822 * <li>PRIVILEGE - String - the type of access granted - one of SELECT, 1823 * INSERT, UPDATE, REFERENCES,...</li> 1824 * <li>IS_GRANTABLE - String - {@code "YES"} implies the grantee can grant 1825 * access to others, {@code "NO"} implies guarantee cannot grant access to 1826 * others, {@code null} means this status is unknown</li> 1827 * </ol> 1828 * 1829 * @param catalog 1830 * a catalog name. {@code null} is used to imply no narrowing of 1831 * the search by catalog name. Otherwise, the name must match a 1832 * catalog name held in the database, with "" used to retrieve 1833 * those without a catalog name. 1834 * @param schemaPattern 1835 * a schema name pattern. {@code null} is used to imply no 1836 * narrowing of the search by schema name. Otherwise, the name 1837 * must match a schema name in the database, with "" used to 1838 * retrieve those without a schema name. 1839 * @param tableNamePattern 1840 * a Table Name, which should match the table name as stored in 1841 * the database. 1842 * @return a {@code ResultSet} containing a list with one row for each table 1843 * in the format defined above. 1844 * @throws SQLException 1845 * a database error occurred. 1846 */ getTablePrivileges(String catalog, String schemaPattern, String tableNamePattern)1847 public ResultSet getTablePrivileges(String catalog, String schemaPattern, 1848 String tableNamePattern) throws SQLException; 1849 1850 /** 1851 * Returns a description of the tables in a specified catalog. 1852 * <p> 1853 * The descriptions are returned as rows in a {@code ResultSet}, one row for 1854 * each Table. The ResultSet is ordered by {@code TABLE_TYPE}, {@code 1855 * TABLE_SCHEM} and {@code TABLE_NAME}. Each row in the ResultSet consists 1856 * of a series of columns as follows: 1857 * <ol> 1858 * <li>{@code TABLE_CAT} - String - table catalog name (possibly {@code 1859 * null})</li> 1860 * <li>{@code TABLE_SCHEM} - String - Table schema name (possibly {@code 1861 * null})</li> 1862 * <li>{@code TABLE_NAME} - String - The table name</li> 1863 * <li>{@code TABLE_TYPE} - String - Typical names include "TABLE", "VIEW", 1864 * "SYSTEM TABLE", "ALIAS", "SYNONYM", "GLOBAL TEMPORARY"</li> 1865 * <li>{@code REMARKS} - String - A comment describing the table</li> 1866 * <li>{@code TYPE_CAT} - String - the 'Types' catalog(possibly {@code null} 1867 * )</li> 1868 * <li>{@code TYPE_SCHEM} - String - the 'Types' schema(possibly {@code 1869 * null})</li> 1870 * <li>{@code TYPE_NAME} - String - the 'Types' name (possibly {@code null}) 1871 * </li> 1872 * <li>{@code SELF_REFERENCING_COL_NAME} - String - the name of a designated 1873 * identifier column in a typed table (possibly {@code null})</li> 1874 * <li>REF_GENERATION - String - one of the following values : "SYSTEM" | 1875 * "USER" | "DERIVED" - specifies how values in the {@code 1876 * SELF_REFERENCING_COL_NAME} are created (possibly {@code null})</li> 1877 * </ol> 1878 * 1879 * @param catalog 1880 * a catalog name. {@code null} is used to imply no narrowing of 1881 * the search by catalog name. Otherwise, the name must match a 1882 * catalog name held in the database, with "" used to retrieve 1883 * those without a catalog name. 1884 * @param schemaPattern 1885 * a schema name pattern. {@code null} is used to imply no 1886 * narrowing of the search by schema name. Otherwise, the name 1887 * must match a schema name in the database, with "" used to 1888 * retrieve those without a schema name. 1889 * @param tableNamePattern 1890 * a table name, which should match the table name as stored in 1891 * the database. 1892 * @param types 1893 * a list of table types to include in the list. {@code null} 1894 * implies list all types. 1895 * @return a {@code ResultSet} with one row per table in the format defined 1896 * above. 1897 * @throws SQLException 1898 * a database error occurred. 1899 */ getTables(String catalog, String schemaPattern, String tableNamePattern, String[] types)1900 public ResultSet getTables(String catalog, String schemaPattern, 1901 String tableNamePattern, String[] types) throws SQLException; 1902 1903 /** 1904 * Returns a list of table types supported by the database. 1905 * <p> 1906 * The list is returned as a {@code ResultSet} with one row per table type, 1907 * ordered by the table type. The information in the {@code ResultSet} is 1908 * structured into a single column per row, as follows: 1909 * <ol> 1910 * <li>{@code TABLE_TYPE} - String - the table type. Typical names include 1911 * {@code "TABLE"}, {@code "VIEW"}, "{@code SYSTEM TABLE"}, {@code "ALIAS"}, 1912 * {@code "SYNONYM"}, {@code "GLOBAL TEMPORARY"}</li> 1913 * </ol> 1914 * 1915 * @return a {@code ResultSet} with one row per table type in the format 1916 * defined above. 1917 * @throws SQLException 1918 * a database error occurred. 1919 */ getTableTypes()1920 public ResultSet getTableTypes() throws SQLException; 1921 1922 /** 1923 * Returns a list of time and date functions available for the database. 1924 * 1925 * @return a string containing a comma separated list of the time and date 1926 * functions. 1927 * @throws SQLException 1928 * a database error occurred. 1929 */ getTimeDateFunctions()1930 public String getTimeDateFunctions() throws SQLException; 1931 1932 /** 1933 * Get a list of the standard SQL types supported by this database. The list 1934 * is returned as a {@code ResultSet}, with one row for each type, ordered 1935 * by the {@code DATA_TYPE} value, where the data in each row is structured 1936 * into the following columns: 1937 * <ol> 1938 * <li>{@code TYPE_NAME} - String : the type name</li> 1939 * <li>{@code DATA_TYPE} - int : the SQL data type value as defined in 1940 * {@code java.sql.Types}</li> 1941 * <li>{@code PRECISION} - int - the maximum precision of the type</li> 1942 * <li>{@code LITERAL_PREFIX} - String : the prefix to be used when quoting 1943 * a literal value (possibly {@code null})</li> 1944 * <li>{@code LITERAL_SUFFIX} - String : the suffix to be used when quoting 1945 * a literal value (possibly {@code null})</li> 1946 * <li>{@code CREATE_PARAMS} - String : params used when creating the type 1947 * (possibly {@code null})</li> 1948 * <li>{@code NULLABLE} - short : shows if the value is nullable: 1949 * <ul> 1950 * <li>{@code DatabaseMetaData.typeNoNulls} : {@code NULL}s not permitted</li> 1951 * <li>{@code DatabaseMetaData.typeNullable} : {@code NULL}s are permitted</li> 1952 * <li>{@code DatabaseMetaData.typeNullableUnknown} : {@code NULL} status 1953 * unknown</li> 1954 * </ul> 1955 * </li> 1956 * <li>{@code CASE_SENSITIVE} - boolean : true if the type is case sensitive 1957 * </li> 1958 * <li>{@code SEARCHABLE} - short : how this type can be used with {@code WHERE} 1959 * clauses: 1960 * <ul> 1961 * <li>{@code DatabaseMetaData.typePredNone} - {@code WHERE} clauses cannot be used</li> 1962 * <li>{@code DatabaseMetaData.typePredChar} - support for {@code 1963 * WHERE...LIKE} only</li> 1964 * <li>{@code DatabaseMetaData.typePredBasic} - support except for {@code 1965 * WHERE...LIKE}</li> 1966 * <li>{@code DatabaseMetaData.typeSearchable} - support for all {@code 1967 * WHERE} clauses</li> 1968 * </ul> 1969 * </li> 1970 * <li>{@code UNSIGNED_ATTRIBUTE} - boolean - the type is unsigned or not</li> 1971 * <li>{@code FIXED_PREC_SCALE} - boolean - fixed precision = it can be used 1972 * as a money value</li> 1973 * <li>{@code AUTO_INCREMENT} - boolean - can be used as an auto-increment 1974 * value</li> 1975 * <li>{@code LOCAL_TYPE_NAME} - String - a localized version of the type 1976 * name (possibly {@code null})</li> 1977 * <li>{@code MINIMUM_SCALE} - short - the minimum scale supported</li> 1978 * <li>{@code MAXIMUM_SCALE} - short - the maximum scale supported</li> 1979 * <li>{@code SQL_DATA_TYPE} - int - not used</li> 1980 * <li>{@code SQL_DATETIME_SUB} - int - not used</li> 1981 * <li>{@code NUM_PREC_RADIX} - int - number radix (typically 2 or 10)</li> 1982 * </ol> 1983 * 1984 * @return a {@code ResultSet} which is structured as described above. 1985 * @throws SQLException 1986 * a database error occurred. 1987 */ getTypeInfo()1988 public ResultSet getTypeInfo() throws SQLException; 1989 1990 /** 1991 * Returns a description of the User Defined Types (UDTs) defined in a given 1992 * schema, which includes the types {@code DISTINCT}, {@code STRUCT} and 1993 * {@code JAVA_OBJECT}. 1994 * <p> 1995 * The types matching the supplied the specified catalog, schema, type name 1996 * and type are returned as rows in a {@code ResultSet} with columns of 1997 * information as follows: 1998 * <ol> 1999 * <li>{@code TABLE_CAT} - String - catalog name (possibly {@code null})</li> 2000 * <li>{@code TABLE_SCHEM} - String - schema name (possibly {@code null})</li> 2001 * <li>{@code TABLE_NAME} - String - The table name</li> 2002 * <li>{@code CLASS_NAME} - String - The Java class name</li> 2003 * <li>{@code DATA_TYPE} - int - The SQL type as specified in {@code 2004 * java.sql.Types}. One of DISTINCT, STRUCT, and JAVA_OBJECT</li> 2005 * <li>{@code REMARKS} - String - A comment which describes the type</li> 2006 * <li>{@code BASE_TYPE} - short - A type code. For a DISTINCT type, the 2007 * source type. For a structured type this is the type that implements the 2008 * user generated reference type of the {@code SELF_REFERENCING_COLUMN}. 2009 * This is defined in {@code java.sql.Types}, and will be {@code null} if 2010 * the {@code DATA_TYPE} does not match these criteria.</li> 2011 * </ol> 2012 * <p> 2013 * If the driver does not support UDTs, the {@code ResultSet} is empty. 2014 * 2015 * @param catalog 2016 * a catalog name. {@code null} is used to imply no narrowing of 2017 * the search by catalog name. Otherwise, the name must match a 2018 * catalog name held in the database, with "" used to retrieve 2019 * those without a catalog name. 2020 * @param schemaPattern 2021 * a schema name pattern. {@code null} is used to imply no 2022 * narrowing of the search using schema name. Otherwise, the name 2023 * must match a schema name in the database, with "" used to 2024 * retrieve those without a schema name. 2025 * @param typeNamePattern 2026 * a type name pattern, which should match a type name as stored in the 2027 * database. It may be fully qualified. 2028 * @param types 2029 * a list of the UDT types to include in the list - one of 2030 * {@code DISTINCT}, {@code STRUCT} or {@code JAVA_OBJECT}. 2031 * @return a {@code ResultSet} in the format described above. 2032 * @throws SQLException 2033 * a database error occurred. 2034 */ getUDTs(String catalog, String schemaPattern, String typeNamePattern, int[] types)2035 public ResultSet getUDTs(String catalog, String schemaPattern, 2036 String typeNamePattern, int[] types) throws SQLException; 2037 2038 /** 2039 * Returns the URL for this database. 2040 * 2041 * @return the URL for the database. {@code null} if it cannot be generated. 2042 * @throws SQLException 2043 * a database error occurred. 2044 */ getURL()2045 public String getURL() throws SQLException; 2046 2047 /** 2048 * Determine the user name as known by the database. 2049 * 2050 * @return the user name. 2051 * @throws SQLException 2052 * a database error occurred. 2053 */ getUserName()2054 public String getUserName() throws SQLException; 2055 2056 /** 2057 * Returns which of a table's columns are automatically updated when any 2058 * value in a row is updated. 2059 * <p> 2060 * The result is laid-out in the following columns: 2061 * <ol> 2062 * <li>{@code SCOPE} - short - not used</li> 2063 * <li>{@code COLUMN_NAME} - String - Column name</li> 2064 * <li>{@code DATA_TYPE} - int - The SQL data type, as defined in {@code 2065 * java.sql.Types}</li> 2066 * <li>{@code TYPE_NAME} - String - The SQL type name, data source dependent 2067 * </li> 2068 * <li>{@code COLUMN_SIZE} - int - Precision for numeric types</li> 2069 * <li>{@code BUFFER_LENGTH} - int - Length of a column value in bytes</li> 2070 * <li>{@code DECIMAL_DIGITS} - short - Number of digits after the decimal 2071 * point</li> 2072 * <li>{@code PSEUDO_COLUMN} - short - If this is a pseudo-column (for 2073 * example, an Oracle {@code ROWID}): 2074 * <ul> 2075 * <li>{@code DatabaseMetaData.bestRowUnknown} - don't know whether this is 2076 * a pseudo column</li> 2077 * <li>{@code DatabaseMetaData.bestRowNotPseudo} - column is not pseudo</li> 2078 * <li>{@code DatabaseMetaData.bestRowPseudo} - column is a pseudo column</li> 2079 * </ul> 2080 * </li> 2081 * </ol> 2082 * 2083 * @param catalog 2084 * a catalog name. {@code null} is used to imply no narrowing of 2085 * the search using catalog name. Otherwise, the name must match 2086 * a catalog name held in the database, with "" used to retrieve 2087 * those without a catalog name. 2088 * @param schema 2089 * a schema name pattern. {@code null} is used to imply no 2090 * narrowing of the search using schema names. Otherwise, the 2091 * name must match a schema name in the database, with "" used to 2092 * retrieve those without a schema name. 2093 * @param table 2094 * a table name. It must match the name of a table in the 2095 * database. 2096 * @return a {@code ResultSet} containing the descriptions, one row for each 2097 * column, in the format defined above. 2098 * @throws SQLException 2099 * a database error occurred. 2100 */ getVersionColumns(String catalog, String schema, String table)2101 public ResultSet getVersionColumns(String catalog, String schema, 2102 String table) throws SQLException; 2103 2104 /** 2105 * Determines whether a visible row insert can be detected by calling {@code 2106 * ResultSet.rowInserted}. 2107 * 2108 * @param type 2109 * the {@code ResultSet} type. This may be one of {@code 2110 * ResultSet.TYPE_SCROLL_SENSITIVE} or {@code 2111 * ResultSet.TYPE_SCROLL_INSENSITIVE} or {@code 2112 * ResultSet.TYPE_FORWARD_ONLY}, 2113 * @return {@code true} if {@code ResultSet.rowInserted} detects a visible 2114 * row insert otherwise {@code false}. 2115 * @throws SQLException 2116 * a database error occurred. 2117 * @see ResultSet#rowInserted() 2118 */ insertsAreDetected(int type)2119 public boolean insertsAreDetected(int type) throws SQLException; 2120 2121 /** 2122 * Determine whether a fully qualified table name is prefixed or suffixed to 2123 * a fully qualified table name. 2124 * 2125 * @return {@code true} if the catalog appears at the start of a fully 2126 * qualified table name, {@code false} otherwise. 2127 * @throws SQLException 2128 * a database error occurred. 2129 */ isCatalogAtStart()2130 public boolean isCatalogAtStart() throws SQLException; 2131 2132 /** 2133 * Determines whether the database is in read-only mode. 2134 * 2135 * @return {@code true} if the database is in read-only mode, {@code false} 2136 * otherwise. 2137 * @throws SQLException 2138 * a database error occurred. 2139 */ isReadOnly()2140 public boolean isReadOnly() throws SQLException; 2141 2142 /** 2143 * Determines whether updates are made to a copy of, or directly on, Large Objects 2144 * ({@code LOB}s). 2145 * 2146 * @return {@code true} if updates are made to a copy of the Large Object, 2147 * {@code false} otherwise. 2148 * @throws SQLException 2149 * a database error occurred. 2150 */ locatorsUpdateCopy()2151 public boolean locatorsUpdateCopy() throws SQLException; 2152 2153 /** 2154 * Determines whether the database handles concatenations between {@code NULL} and 2155 * non-{@code NULL} values by producing a {@code NULL} output. 2156 * 2157 * @return {@code true} if {@code NULL} to non-{@code NULL} concatenations 2158 * produce a {@code NULL} result, {@code false} otherwise. 2159 * @throws SQLException 2160 * a database error occurred. 2161 */ nullPlusNonNullIsNull()2162 public boolean nullPlusNonNullIsNull() throws SQLException; 2163 2164 /** 2165 * Determines whether {@code NULL} values are always sorted to the end of sorted 2166 * results regardless of requested sort order. This means that they will 2167 * appear at the end of sorted lists whatever other non-{@code NULL} values 2168 * may be present. 2169 * 2170 * @return {@code true} if {@code NULL} values are sorted at the end, 2171 * {@code false} otherwise. 2172 * @throws SQLException 2173 * a database error occurred. 2174 */ nullsAreSortedAtEnd()2175 public boolean nullsAreSortedAtEnd() throws SQLException; 2176 2177 /** 2178 * Determines whether {@code NULL} values are always sorted at the start of the 2179 * sorted list, irrespective of the sort order. This means that they appear 2180 * at the start of sorted lists, whatever other values may be present. 2181 * 2182 * @return {@code true} if {@code NULL} values are sorted at the start, 2183 * {@code false} otherwise. 2184 * @throws SQLException 2185 * a database error occurred. 2186 */ nullsAreSortedAtStart()2187 public boolean nullsAreSortedAtStart() throws SQLException; 2188 2189 /** 2190 * Determines whether {@code NULL} values are sorted high - i.e. they are sorted 2191 * as if they are higher than any other values. 2192 * 2193 * @return {@code true} if {@code NULL} values are sorted high, {@code 2194 * false} otherwise. 2195 * @throws SQLException 2196 * a database error occurred. 2197 */ nullsAreSortedHigh()2198 public boolean nullsAreSortedHigh() throws SQLException; 2199 2200 /** 2201 * Determines whether {@code NULL} values are sorted low - i.e. they are sorted as 2202 * if they are lower than any other values. 2203 * 2204 * @return {@code true} if {@code NULL} values are sorted low, {@code false} 2205 * otherwise. 2206 * @throws SQLException 2207 * a database error occurred. 2208 */ nullsAreSortedLow()2209 public boolean nullsAreSortedLow() throws SQLException; 2210 2211 /** 2212 * Determines whether deletes made by others are visible, for a specified {@code 2213 * ResultSet} type. 2214 * 2215 * @param type 2216 * the type of the {@code ResultSet}. It may be either {@code 2217 * ResultSet.TYPE_FORWARD_ONLY} or {@code 2218 * ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code 2219 * ResultSet.TYPE_SCROLL_SENSITIVE}) 2220 * @return {@code true} if others' deletes are visible, {@code false} 2221 * otherwise. 2222 * @throws SQLException 2223 * a database error occurred. 2224 */ othersDeletesAreVisible(int type)2225 public boolean othersDeletesAreVisible(int type) throws SQLException; 2226 2227 /** 2228 * Determines whether inserts made by others are visible, for a specified {@code 2229 * ResultSet} type. 2230 * 2231 * @param type 2232 * the type of the {@code ResultSet}. May be {@code 2233 * ResultSet.TYPE_FORWARD_ONLY}, or {@code 2234 * ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code 2235 * ResultSet.TYPE_SCROLL_SENSITIVE} 2236 * @return {@code true} if others' inserts are visible, otherwise {@code 2237 * false}. 2238 * @throws SQLException 2239 * a database error occurred. 2240 */ othersInsertsAreVisible(int type)2241 public boolean othersInsertsAreVisible(int type) throws SQLException; 2242 2243 /** 2244 * Determines whether updates made by others are visible, for a specified {@code 2245 * ResultSet} type. 2246 * 2247 * @param type 2248 * the type of the {@code ResultSet}. May be {@code 2249 * ResultSet.TYPE_FORWARD_ONLY}, or {@code 2250 * ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code 2251 * ResultSet.TYPE_SCROLL_SENSITIVE} 2252 * @return {@code true} if others' inserts are visible, otherwise {@code 2253 * false}. 2254 * @throws SQLException 2255 * a database error occurred. 2256 */ othersUpdatesAreVisible(int type)2257 public boolean othersUpdatesAreVisible(int type) throws SQLException; 2258 2259 /** 2260 * Determines whether a {@code ResultSet} can see its own deletes, for a 2261 * specified {@code ResultSet} type. 2262 * 2263 * @param type 2264 * the type of the {@code ResultSet}: {@code 2265 * ResultSet.TYPE_FORWARD_ONLY}, {@code 2266 * ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code 2267 * ResultSet.TYPE_SCROLL_SENSITIVE} 2268 * @return {@code true} if the deletes are seen by the {@code 2269 * ResultSet} itself, otherwise {@code false}. 2270 * @throws SQLException 2271 * a database error occurred. 2272 */ ownDeletesAreVisible(int type)2273 public boolean ownDeletesAreVisible(int type) throws SQLException; 2274 2275 /** 2276 * Determines whether a {@code ResultSet} can see its own inserts, for a 2277 * specified {@code ResultSet} type. 2278 * 2279 * @param type 2280 * the type of the {@code ResultSet}: {@code 2281 * ResultSet.TYPE_FORWARD_ONLY}, {@code 2282 * ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code 2283 * ResultSet.TYPE_SCROLL_SENSITIVE} 2284 * @return {@code true} if the inserts are seen by the {@code 2285 * ResultSet} itself, otherwise {@code false}. 2286 * @throws SQLException 2287 * a database error occurred. 2288 */ ownInsertsAreVisible(int type)2289 public boolean ownInsertsAreVisible(int type) throws SQLException; 2290 2291 /** 2292 * Determines whether a {@code ResultSet} can see its own updates, for a 2293 * specified {@code ResultSet} type. 2294 * 2295 * @param type 2296 * the type of the {@code ResultSet}: {@code 2297 * ResultSet.TYPE_FORWARD_ONLY}, {@code 2298 * ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code 2299 * ResultSet.TYPE_SCROLL_SENSITIVE} 2300 * @return {@code true} if the updates are seen by the {@code 2301 * ResultSet} itself, otherwise {@code false}. 2302 * @throws SQLException 2303 * a database error occurred. 2304 */ ownUpdatesAreVisible(int type)2305 public boolean ownUpdatesAreVisible(int type) throws SQLException; 2306 2307 /** 2308 * Determines whether the database treats SQL identifiers that are in mixed 2309 * case (and unquoted) as case insensitive. If {@code true} then the 2310 * database stores them in lower case. 2311 * 2312 * @return {@code true} if unquoted SQL identifiers are stored in lower 2313 * case, {@code false} otherwise. 2314 * @throws SQLException 2315 * a database error occurred. 2316 */ storesLowerCaseIdentifiers()2317 public boolean storesLowerCaseIdentifiers() throws SQLException; 2318 2319 /** 2320 * Determines whether the database considers mixed case quoted SQL 2321 * identifiers as case insensitive and stores them in lower case. 2322 * 2323 * @return {@code true} if quoted SQL identifiers are stored in lower case, 2324 * {@code false} otherwise. 2325 * @throws SQLException 2326 * a database error occurred. 2327 */ storesLowerCaseQuotedIdentifiers()2328 public boolean storesLowerCaseQuotedIdentifiers() throws SQLException; 2329 2330 /** 2331 * Determines whether the database considers mixed case unquoted SQL 2332 * identifiers as case insensitive and stores them in mixed case. 2333 * 2334 * @return {@code true} if unquoted SQL identifiers as stored in mixed case, 2335 * {@code false} otherwise. 2336 * @throws SQLException 2337 * a database error occurred. 2338 */ storesMixedCaseIdentifiers()2339 public boolean storesMixedCaseIdentifiers() throws SQLException; 2340 2341 /** 2342 * Determines whether the database considers identifiers as case insensitive 2343 * if they are mixed case quoted SQL. The database stores them in mixed 2344 * case. 2345 * 2346 * @return {@code true} if quoted SQL identifiers are stored in mixed case, 2347 * {@code false} otherwise. 2348 * @throws SQLException 2349 * a database error occurred. 2350 */ storesMixedCaseQuotedIdentifiers()2351 public boolean storesMixedCaseQuotedIdentifiers() throws SQLException; 2352 2353 /** 2354 * Determines whether the database considers mixed case unquoted SQL 2355 * identifiers as case insensitive and stores them in upper case. 2356 * 2357 * @return {@code true} if unquoted SQL identifiers are stored in upper 2358 * case, {@code false} otherwise. 2359 * @throws SQLException 2360 * a database error occurred. 2361 */ storesUpperCaseIdentifiers()2362 public boolean storesUpperCaseIdentifiers() throws SQLException; 2363 2364 /** 2365 * Determines whether the database considers mixed case quoted SQL 2366 * identifiers as case insensitive and stores them in upper case. 2367 * 2368 * @return {@code true} if quoted SQL identifiers are stored in upper case, 2369 * {@code false} otherwise. 2370 * @throws SQLException 2371 * a database error occurred. 2372 */ storesUpperCaseQuotedIdentifiers()2373 public boolean storesUpperCaseQuotedIdentifiers() throws SQLException; 2374 2375 /** 2376 * Determines whether the database supports {@code ALTER TABLE} operation with 2377 * {@code ADD COLUMN}. 2378 * 2379 * @return {@code true} if {@code ALTER TABLE} with {@code ADD COLUMN} is 2380 * supported, {@code false} otherwise. 2381 * @throws SQLException 2382 * a database error occurred. 2383 */ supportsAlterTableWithAddColumn()2384 public boolean supportsAlterTableWithAddColumn() throws SQLException; 2385 2386 /** 2387 * Determines whether the database supports {@code ALTER TABLE} operation with 2388 * {@code DROP COLUMN}. 2389 * 2390 * @return {@code true} if {@code ALTER TABLE} with {@code DROP COLUMN} is 2391 * supported, {@code false} otherwise. 2392 * @throws SQLException 2393 * a database error occurred. 2394 */ supportsAlterTableWithDropColumn()2395 public boolean supportsAlterTableWithDropColumn() throws SQLException; 2396 2397 /** 2398 * Determines whether the database supports the ANSI92 entry level SQL grammar. 2399 * 2400 * @return {@code true} if the ANSI92 entry level SQL grammar is supported, 2401 * {@code false} otherwise. 2402 * @throws SQLException 2403 * a database error occurred. 2404 */ supportsANSI92EntryLevelSQL()2405 public boolean supportsANSI92EntryLevelSQL() throws SQLException; 2406 2407 /** 2408 * Determines whether the database supports the ANSI92 full SQL grammar. 2409 * 2410 * @return {@code true} if the ANSI92 full SQL grammar is supported, {@code 2411 * false} otherwise. 2412 * @throws SQLException 2413 * a database error occurred. 2414 */ supportsANSI92FullSQL()2415 public boolean supportsANSI92FullSQL() throws SQLException; 2416 2417 /** 2418 * Determines whether the database supports the ANSI92 intermediate SQL Grammar. 2419 * 2420 * @return {@code true} if the ANSI92 intermediate SQL grammar is supported, 2421 * {@code false} otherwise. 2422 * @throws SQLException 2423 * a database error occurred. 2424 */ supportsANSI92IntermediateSQL()2425 public boolean supportsANSI92IntermediateSQL() throws SQLException; 2426 2427 /** 2428 * Determines whether the database supports batch updates. 2429 * 2430 * @return {@code true} if batch updates are supported, {@code false} 2431 * otherwise. 2432 * @throws SQLException 2433 * a database error occurred. 2434 */ supportsBatchUpdates()2435 public boolean supportsBatchUpdates() throws SQLException; 2436 2437 /** 2438 * Determines whether catalog names may be used in data manipulation 2439 * statements. 2440 * 2441 * @return {@code true} if catalog names can be used in data manipulation 2442 * statements, {@code false} otherwise. 2443 * @throws SQLException 2444 * a database error occurred. 2445 */ supportsCatalogsInDataManipulation()2446 public boolean supportsCatalogsInDataManipulation() throws SQLException; 2447 2448 /** 2449 * Determines whether catalog names can be used in index definition statements. 2450 * 2451 * @return {@code true} if catalog names can be used in index definition 2452 * statements, {@code false} otherwise. 2453 * @throws SQLException 2454 * a database error occurred. 2455 */ supportsCatalogsInIndexDefinitions()2456 public boolean supportsCatalogsInIndexDefinitions() throws SQLException; 2457 2458 /** 2459 * Determines whether catalog names can be used in privilege definition 2460 * statements. 2461 * 2462 * @return {@code true} if catalog names can be used in privilege definition 2463 * statements, {@code false} otherwise. 2464 * @throws SQLException 2465 * a database error occurred. 2466 */ supportsCatalogsInPrivilegeDefinitions()2467 public boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException; 2468 2469 /** 2470 * Determines whether catalog names can be used in procedure call statements. 2471 * 2472 * @return {@code true} if catalog names can be used in procedure call 2473 * statements. 2474 * @throws SQLException 2475 * a database error occurred. 2476 */ supportsCatalogsInProcedureCalls()2477 public boolean supportsCatalogsInProcedureCalls() throws SQLException; 2478 2479 /** 2480 * Determines whether catalog names may be used in table definition statements. 2481 * 2482 * @return {@code true} if catalog names can be used in definition 2483 * statements, {@code false} otherwise. 2484 * @throws SQLException 2485 * a database error occurred. 2486 */ supportsCatalogsInTableDefinitions()2487 public boolean supportsCatalogsInTableDefinitions() throws SQLException; 2488 2489 /** 2490 * Determines whether the database supports column aliasing. 2491 * <p> 2492 * If aliasing is supported, then the SQL AS clause is used to provide names 2493 * for computed columns and provide alias names for columns. 2494 * 2495 * @return {@code true} if column aliasing is supported, {@code false} 2496 * otherwise. 2497 * @throws SQLException 2498 * a database error occurred. 2499 */ supportsColumnAliasing()2500 public boolean supportsColumnAliasing() throws SQLException; 2501 2502 /** 2503 * Determines whether the database supports the {@code CONVERT} operation between 2504 * SQL types. 2505 * 2506 * @return {@code true} if the {@code CONVERT} operation is supported, 2507 * {@code false} otherwise. 2508 * @throws SQLException 2509 * a database error occurred. 2510 */ supportsConvert()2511 public boolean supportsConvert() throws SQLException; 2512 2513 /** 2514 * Determines whether the database supports {@code CONVERT} operation for two 2515 * supplied SQL types. 2516 * 2517 * @param fromType 2518 * the Type to convert from, as defined by {@code java.sql.Types} 2519 * @param toType 2520 * the Type to convert to, as defined by {@code java.sql.Types} 2521 * @return {@code true} if the {@code CONVERT} operation is supported for 2522 * these types, {@code false} otherwise. 2523 * @throws SQLException 2524 * a database error occurred. 2525 */ supportsConvert(int fromType, int toType)2526 public boolean supportsConvert(int fromType, int toType) 2527 throws SQLException; 2528 2529 /** 2530 * Determines whether the database supports the Core SQL Grammar for ODBC. 2531 * 2532 * @return {@code true} if the Core SQL Grammar is supported, {@code false} 2533 * otherwise. 2534 * @throws SQLException 2535 * a database error occurred. 2536 */ supportsCoreSQLGrammar()2537 public boolean supportsCoreSQLGrammar() throws SQLException; 2538 2539 /** 2540 * Determines whether the database supports correlated sub-queries. 2541 * 2542 * @return {@code true} if the database does support correlated sub-queries 2543 * and {@code false} otherwise. 2544 * @throws SQLException 2545 * a database error occurred. 2546 */ supportsCorrelatedSubqueries()2547 public boolean supportsCorrelatedSubqueries() throws SQLException; 2548 2549 /** 2550 * Determines whether the database allows both data definition and data 2551 * manipulation statements inside a transaction. 2552 * 2553 * @return {@code true} if both types of statement are permitted, {@code 2554 * false} otherwise. 2555 * @throws SQLException 2556 * a database error occurred. 2557 */ supportsDataDefinitionAndDataManipulationTransactions()2558 public boolean supportsDataDefinitionAndDataManipulationTransactions() 2559 throws SQLException; 2560 2561 /** 2562 * Determines whether the database only allows data manipulation statements inside 2563 * a transaction. 2564 * 2565 * @return {@code true} if data manipulation statements are permitted only within a transaction, 2566 * {@code false} otherwise. 2567 * @throws SQLException 2568 * a database error occurred. 2569 */ supportsDataManipulationTransactionsOnly()2570 public boolean supportsDataManipulationTransactionsOnly() 2571 throws SQLException; 2572 2573 /** 2574 * Determines whether table correlation names are required to be different from 2575 * the names of the tables, when they are supported. 2576 * 2577 * @return {@code true} if correlation names must be different from table 2578 * names, {@code false} otherwise. 2579 * @throws SQLException 2580 * a database error occurred. 2581 */ supportsDifferentTableCorrelationNames()2582 public boolean supportsDifferentTableCorrelationNames() throws SQLException; 2583 2584 /** 2585 * Determines whether expressions in {@code ORDER BY} lists are supported. 2586 * 2587 * @return {@code true} if expressions in {@code ORDER BY} lists are 2588 * supported. 2589 * @throws SQLException 2590 * a database error occurred. 2591 */ supportsExpressionsInOrderBy()2592 public boolean supportsExpressionsInOrderBy() throws SQLException; 2593 2594 /** 2595 * Determines whether the Extended SQL Grammar for ODBC is supported. 2596 * 2597 * @return {@code true} if the Extended SQL Grammar is supported, {@code 2598 * false} otherwise. 2599 * @throws SQLException 2600 * a database error occurred. 2601 */ supportsExtendedSQLGrammar()2602 public boolean supportsExtendedSQLGrammar() throws SQLException; 2603 2604 /** 2605 * Determines whether the database supports full nested outer joins. 2606 * 2607 * @return {@code true} if full nested outer joins are supported, {@code 2608 * false} otherwise. 2609 * @throws SQLException 2610 * a database error occurred. 2611 */ supportsFullOuterJoins()2612 public boolean supportsFullOuterJoins() throws SQLException; 2613 2614 /** 2615 * Determines whether auto generated keys can be returned when a statement 2616 * executes. 2617 * 2618 * @return {@code true} if auto generated keys can be returned, {@code 2619 * false} otherwise. 2620 * @throws SQLException 2621 * a database error occurred. 2622 */ supportsGetGeneratedKeys()2623 public boolean supportsGetGeneratedKeys() throws SQLException; 2624 2625 /** 2626 * Determines whether the database supports {@code GROUP BY} clauses. 2627 * 2628 * @return {@code true} if the {@code GROUP BY} clause is supported, {@code 2629 * false} otherwise. 2630 * @throws SQLException 2631 * a database error occurred. 2632 */ supportsGroupBy()2633 public boolean supportsGroupBy() throws SQLException; 2634 2635 /** 2636 * Determines whether the database supports using a column name in a {@code GROUP 2637 * BY} clause not included in the {@code SELECT} statement as long as all of 2638 * the columns in the {@code SELECT} statement are used in the {@code GROUP 2639 * BY} clause. 2640 * 2641 * @return {@code true} if {@code GROUP BY} clauses can use column names in 2642 * this way, {@code false} otherwise. 2643 * @throws SQLException 2644 * a database error occurred. 2645 */ supportsGroupByBeyondSelect()2646 public boolean supportsGroupByBeyondSelect() throws SQLException; 2647 2648 /** 2649 * Determines whether the database supports using a column name in a {@code GROUP 2650 * BY} clause that is not in the {@code SELECT} statement. 2651 * 2652 * @return {@code true} if {@code GROUP BY} clause can use a column name not 2653 * in the {@code SELECT} statement, {@code false} otherwise. 2654 * @throws SQLException 2655 * a database error occurred. 2656 */ supportsGroupByUnrelated()2657 public boolean supportsGroupByUnrelated() throws SQLException; 2658 2659 /** 2660 * Determines whether the database supports SQL Integrity Enhancement 2661 * Facility. 2662 * 2663 * @return {@code true} if the Integrity Enhancement Facility is supported, 2664 * {@code false} otherwise. 2665 * @throws SQLException 2666 * a database error occurred. 2667 */ supportsIntegrityEnhancementFacility()2668 public boolean supportsIntegrityEnhancementFacility() throws SQLException; 2669 2670 /** 2671 * Determines whether the database supports a {@code LIKE} escape clause. 2672 * 2673 * @return {@code true} if LIKE escape clause is supported, {@code false} 2674 * otherwise. 2675 * @throws SQLException 2676 * a database error occurred. 2677 */ supportsLikeEscapeClause()2678 public boolean supportsLikeEscapeClause() throws SQLException; 2679 2680 /** 2681 * Determines whether the database provides limited support for outer join 2682 * operations. 2683 * 2684 * @return {@code true} if there is limited support for outer join 2685 * operations, {@code false} otherwise. This will be {@code true} if 2686 * {@code supportsFullOuterJoins} returns {@code true}. 2687 * @throws SQLException 2688 * a database error occurred. 2689 */ supportsLimitedOuterJoins()2690 public boolean supportsLimitedOuterJoins() throws SQLException; 2691 2692 /** 2693 * Determines whether the database supports Minimum SQL Grammar for ODBC. 2694 * 2695 * @return {@code true} if the Minimum SQL Grammar is supported, {@code 2696 * false} otherwise. 2697 * @throws SQLException 2698 * a database error occurred. 2699 */ supportsMinimumSQLGrammar()2700 public boolean supportsMinimumSQLGrammar() throws SQLException; 2701 2702 /** 2703 * Determines whether the database treats mixed case unquoted SQL identifiers as 2704 * case sensitive storing them in mixed case. 2705 * 2706 * @return {@code true} if unquoted SQL identifiers are stored in mixed 2707 * case, {@code false} otherwise. 2708 * @throws SQLException 2709 * a database error occurred. 2710 */ supportsMixedCaseIdentifiers()2711 public boolean supportsMixedCaseIdentifiers() throws SQLException; 2712 2713 /** 2714 * Determines whether the database considers mixed case quoted SQL 2715 * identifiers as case sensitive, storing them in mixed case. 2716 * 2717 * @return {@code true} if quoted SQL identifiers are stored in mixed case, 2718 * {@code false} otherwise. 2719 * @throws SQLException 2720 * a database error occurred. 2721 */ supportsMixedCaseQuotedIdentifiers()2722 public boolean supportsMixedCaseQuotedIdentifiers() throws SQLException; 2723 2724 /** 2725 * Determines whether it is possible for a single {@code CallableStatement} to 2726 * return multiple {@code ResultSet}s simultaneously. 2727 * 2728 * @return {@code true} if a single {@code CallableStatement} can return 2729 * multiple {@code ResultSet}s simultaneously, {@code false} 2730 * otherwise. 2731 * @throws SQLException 2732 * a database error occurred. 2733 */ supportsMultipleOpenResults()2734 public boolean supportsMultipleOpenResults() throws SQLException; 2735 2736 /** 2737 * Determines whether retrieving multiple {@code ResultSet}s from a single 2738 * call to the {@code execute} method is supported. 2739 * 2740 * @return {@code true} if multiple {@code ResultSet}s can be retrieved, 2741 * {@code false} otherwise. 2742 * @throws SQLException 2743 * a database error occurred. 2744 */ supportsMultipleResultSets()2745 public boolean supportsMultipleResultSets() throws SQLException; 2746 2747 /** 2748 * Determines whether multiple simultaneous transactions on 2749 * different connections are supported. 2750 * 2751 * @return {@code true} if multiple open transactions are supported, {@code 2752 * false} otherwise. 2753 * @throws SQLException 2754 * a database error occurred. 2755 */ supportsMultipleTransactions()2756 public boolean supportsMultipleTransactions() throws SQLException; 2757 2758 /** 2759 * Determines whether callable statements with named parameters is supported. 2760 * 2761 * @return {@code true} if named parameters can be used with callable 2762 * statements, {@code false} otherwise. 2763 * @throws SQLException 2764 * a database error occurred. 2765 */ supportsNamedParameters()2766 public boolean supportsNamedParameters() throws SQLException; 2767 2768 /** 2769 * Determines whether columns in the database can be defined as non-nullable. 2770 * 2771 * @return {@code true} if columns can be defined non-nullable, {@code 2772 * false} otherwise. 2773 * @throws SQLException 2774 * a database error occurred. 2775 */ supportsNonNullableColumns()2776 public boolean supportsNonNullableColumns() throws SQLException; 2777 2778 /** 2779 * Determines whether keeping cursors open across commit operations is 2780 * supported. 2781 * 2782 * @return {@code true} if cursors can be kept open across commit 2783 * operations, {@code false} if they might get closed. 2784 * @throws SQLException 2785 * a database error occurred. 2786 */ supportsOpenCursorsAcrossCommit()2787 public boolean supportsOpenCursorsAcrossCommit() throws SQLException; 2788 2789 /** 2790 * Determines whether the database can keep cursors open across rollback 2791 * operations. 2792 * 2793 * @return {@code true} if cursors can be kept open across rollback 2794 * operations, {@code false} if they might get closed. 2795 * @throws SQLException 2796 * a database error occurred. 2797 */ supportsOpenCursorsAcrossRollback()2798 public boolean supportsOpenCursorsAcrossRollback() throws SQLException; 2799 2800 /** 2801 * Determines whether keeping statements open across commit operations is 2802 * supported. 2803 * 2804 * @return {@code true} if statements can be kept open, {@code false} if 2805 * they might not. 2806 * @throws SQLException 2807 * a database error occurred. 2808 */ supportsOpenStatementsAcrossCommit()2809 public boolean supportsOpenStatementsAcrossCommit() throws SQLException; 2810 2811 /** 2812 * Determines whether keeping statements open across rollback operations is 2813 * supported. 2814 * 2815 * @return {@code true} if statements can be kept open, {@code false} if 2816 * they might not. 2817 * @throws SQLException 2818 * a database error occurred. 2819 */ supportsOpenStatementsAcrossRollback()2820 public boolean supportsOpenStatementsAcrossRollback() throws SQLException; 2821 2822 /** 2823 * Determines whether using a column in an {@code ORDER BY} clause that is 2824 * not in the {@code SELECT} statement is supported. 2825 * 2826 * @return {@code true} if it is possible to {@code ORDER} using a column 2827 * not in the {@code SELECT}, {@code false} otherwise. 2828 * @throws SQLException 2829 * a database error occurred. 2830 */ supportsOrderByUnrelated()2831 public boolean supportsOrderByUnrelated() throws SQLException; 2832 2833 /** 2834 * Determines whether outer join operations are supported. 2835 * 2836 * @return {@code true} if outer join operations are supported, {@code 2837 * false} otherwise. 2838 * @throws SQLException 2839 * a database error occurred. 2840 */ supportsOuterJoins()2841 public boolean supportsOuterJoins() throws SQLException; 2842 2843 /** 2844 * Determines whether positioned {@code DELETE} statements are supported. 2845 * 2846 * @return {@code true} if the database supports positioned {@code DELETE} 2847 * statements. 2848 * @throws SQLException 2849 * a database error occurred. 2850 */ supportsPositionedDelete()2851 public boolean supportsPositionedDelete() throws SQLException; 2852 2853 /** 2854 * Determines whether positioned {@code UPDATE} statements are supported. 2855 * 2856 * @return {@code true} if the database supports positioned {@code UPDATE} 2857 * statements, {@code false} otherwise. 2858 * @throws SQLException 2859 * a database error occurred. 2860 */ supportsPositionedUpdate()2861 public boolean supportsPositionedUpdate() throws SQLException; 2862 2863 /** 2864 * Determines whether there is support for a given concurrency style for the 2865 * given {@code ResultSet}. 2866 * 2867 * @param type 2868 * the {@code ResultSet} type, as defined in {@code 2869 * java.sql.ResultSet}: 2870 * <ul> 2871 * <li>{@code ResultSet.TYPE_FORWARD_ONLY}</li> 2872 * <li>{@code ResultSet.TYPE_SCROLL_INSENSITIVE}</li> 2873 * <li>{@code ResultSet.TYPE_SCROLL_SENSITIVE}</li> 2874 * </ul> 2875 * @param concurrency 2876 * a concurrency type, which may be one of {@code 2877 * ResultSet.CONCUR_READ_ONLY} or {@code 2878 * ResultSet.CONCUR_UPDATABLE}. 2879 * @return {@code true} if that concurrency and {@code ResultSet} type 2880 * pairing is supported otherwise {@code false}. 2881 * @throws SQLException 2882 * a database error occurred. 2883 */ supportsResultSetConcurrency(int type, int concurrency)2884 public boolean supportsResultSetConcurrency(int type, int concurrency) 2885 throws SQLException; 2886 2887 /** 2888 * Determines whether the supplied {@code ResultSet} holdability mode is 2889 * supported. 2890 * 2891 * @param holdability 2892 * as specified in {@code java.sql.ResultSet}: {@code 2893 * ResultSet.HOLD_CURSORS_OVER_COMMIT} or {@code 2894 * ResultSet.CLOSE_CURSORS_AT_COMMIT} 2895 * @return {@code true} if the given ResultSet holdability is supported and 2896 * if it isn't then {@code false}. 2897 * @throws SQLException 2898 * a database error occurred. 2899 */ supportsResultSetHoldability(int holdability)2900 public boolean supportsResultSetHoldability(int holdability) 2901 throws SQLException; 2902 2903 /** 2904 * Determines whether the supplied {@code ResultSet} type is supported. 2905 * 2906 * @param type 2907 * the {@code ResultSet} type as defined in {@code 2908 * java.sql.ResultSet}: {@code ResultSet.TYPE_FORWARD_ONLY}, 2909 * {@code ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code 2910 * ResultSet.TYPE_SCROLL_SENSITIVE} 2911 * @return {@code true} if the {@code ResultSet} type is supported, {@code 2912 * false} otherwise. 2913 * @throws SQLException 2914 * a database error occurred. 2915 */ supportsResultSetType(int type)2916 public boolean supportsResultSetType(int type) throws SQLException; 2917 2918 /** 2919 * Determines whether savepoints for transactions are supported. 2920 * 2921 * @return {@code true} if savepoints are supported, {@code false} 2922 * otherwise. 2923 * @throws SQLException 2924 * a database error occurred. 2925 */ supportsSavepoints()2926 public boolean supportsSavepoints() throws SQLException; 2927 2928 /** 2929 * Determines whether a schema name may be used in a data manipulation 2930 * statement. 2931 * 2932 * @return {@code true} if a schema name can be used in a data manipulation, 2933 * otherwise {@code false}. 2934 * @throws SQLException 2935 * a database error occurred. 2936 */ supportsSchemasInDataManipulation()2937 public boolean supportsSchemasInDataManipulation() throws SQLException; 2938 2939 /** 2940 * Determines whether a schema name may be used in an index definition 2941 * statement. 2942 * 2943 * @return {@code true} if a schema name can be used in an index definition, 2944 * otherwise {@code false}. 2945 * @throws SQLException 2946 * a database error occurred. 2947 */ supportsSchemasInIndexDefinitions()2948 public boolean supportsSchemasInIndexDefinitions() throws SQLException; 2949 2950 /** 2951 * Determines whether a database schema name can be used in a privilege 2952 * definition statement. 2953 * 2954 * @return {@code true} if a database schema name may be used in a privilege 2955 * definition, otherwise {@code false} 2956 * @throws SQLException 2957 * a database error occurred. 2958 */ supportsSchemasInPrivilegeDefinitions()2959 public boolean supportsSchemasInPrivilegeDefinitions() throws SQLException; 2960 2961 /** 2962 * Determines whether a procedure call statement may be contain in a schema name. 2963 * 2964 * @return {@code true} if a schema name can be used in a procedure call, 2965 * otherwise {@code false}. 2966 * @throws SQLException 2967 * a database error occurred. 2968 */ supportsSchemasInProcedureCalls()2969 public boolean supportsSchemasInProcedureCalls() throws SQLException; 2970 2971 /** 2972 * Determines whether a schema name can be used in a table definition statement. 2973 * 2974 * @return {@code true} if a schema name can be used in a table definition, 2975 * otherwise {@code false}. 2976 * @throws SQLException 2977 * a database error occurred. 2978 */ supportsSchemasInTableDefinitions()2979 public boolean supportsSchemasInTableDefinitions() throws SQLException; 2980 2981 /** 2982 * Determines whether the {@code SELECT FOR UPDATE} statement is supported. 2983 * 2984 * @return {@code true} if {@code SELECT FOR UPDATE} statements are 2985 * supported, otherwise {@code false}. 2986 * @throws SQLException 2987 * a database error occurred. 2988 */ supportsSelectForUpdate()2989 public boolean supportsSelectForUpdate() throws SQLException; 2990 2991 /** 2992 * Determines whether statement pooling is supported. 2993 * 2994 * @return {@code true} of the database does support statement pooling, 2995 * otherwise {@code false}. 2996 * @throws SQLException 2997 * a database error occurred. 2998 */ supportsStatementPooling()2999 public boolean supportsStatementPooling() throws SQLException; 3000 3001 /** 3002 * Determines whether stored procedure calls using the stored procedure 3003 * escape syntax is supported. 3004 * 3005 * @return {@code true} if stored procedure calls using the stored procedure 3006 * escape syntax are supported, otherwise {@code false}. 3007 * @throws SQLException 3008 * a database error occurred. 3009 */ supportsStoredProcedures()3010 public boolean supportsStoredProcedures() throws SQLException; 3011 3012 /** 3013 * Determines whether subqueries in comparison expressions are supported. 3014 * 3015 * @return {@code true} if subqueries are supported in comparison 3016 * expressions. 3017 * @throws SQLException 3018 * a database error occurred. 3019 */ supportsSubqueriesInComparisons()3020 public boolean supportsSubqueriesInComparisons() throws SQLException; 3021 3022 /** 3023 * Determines whether subqueries in {@code EXISTS} expressions are supported. 3024 * 3025 * @return {@code true} if subqueries are supported in {@code EXISTS} 3026 * expressions, otherwise {@code false}. 3027 * @throws SQLException 3028 * a database error occurred. 3029 */ supportsSubqueriesInExists()3030 public boolean supportsSubqueriesInExists() throws SQLException; 3031 3032 /** 3033 * Determines whether subqueries in {@code IN} statements are supported. 3034 * 3035 * @return {@code true} if subqueries are supported in {@code IN} statements, 3036 * otherwise {@code false}. 3037 * @throws SQLException 3038 * a database error occurred. 3039 */ supportsSubqueriesInIns()3040 public boolean supportsSubqueriesInIns() throws SQLException; 3041 3042 /** 3043 * Determines whether subqueries in quantified expressions are supported. 3044 * 3045 * @return {@code true} if subqueries are supported, otherwise {@code false}. 3046 * @throws SQLException 3047 * a database error occurred. 3048 */ supportsSubqueriesInQuantifieds()3049 public boolean supportsSubqueriesInQuantifieds() throws SQLException; 3050 3051 /** 3052 * Determines whether the database has table correlation names support. 3053 * 3054 * @return {@code true} if table correlation names are supported, otherwise 3055 * {@code false}. 3056 * @throws SQLException 3057 * a database error occurred. 3058 */ supportsTableCorrelationNames()3059 public boolean supportsTableCorrelationNames() throws SQLException; 3060 3061 /** 3062 * Determines whether a specified transaction isolation level is supported. 3063 * 3064 * @param level 3065 * the transaction isolation level, as specified in {@code 3066 * java.sql.Connection}: {@code TRANSACTION_NONE}, {@code 3067 * TRANSACTION_READ_COMMITTED}, {@code 3068 * TRANSACTION_READ_UNCOMMITTED}, {@code 3069 * TRANSACTION_REPEATABLE_READ}, {@code TRANSACTION_SERIALIZABLE} 3070 * @return {@code true} if the specific isolation level is supported, 3071 * otherwise {@code false}. 3072 * @throws SQLException 3073 * a database error occurred. 3074 */ supportsTransactionIsolationLevel(int level)3075 public boolean supportsTransactionIsolationLevel(int level) 3076 throws SQLException; 3077 3078 /** 3079 * Determines whether transactions are supported. 3080 * <p> 3081 * If transactions are not supported, then the {@code commit} method does 3082 * nothing and the transaction isolation level is always {@code 3083 * TRANSACTION_NONE}. 3084 * 3085 * @return {@code true} if transactions are supported, otherwise {@code 3086 * false}. 3087 * @throws SQLException 3088 * a database error occurred. 3089 */ supportsTransactions()3090 public boolean supportsTransactions() throws SQLException; 3091 3092 /** 3093 * Determines whether the {@code SQL UNION} operation is supported. 3094 * 3095 * @return {@code true} of the database does support {@code UNION}, otherwise 3096 * {@code false}. 3097 * @throws SQLException 3098 * a database error occurred. 3099 */ supportsUnion()3100 public boolean supportsUnion() throws SQLException; 3101 3102 /** 3103 * Determines whether the {@code SQL UNION ALL} operation is supported. 3104 * 3105 * @return {@code true} if the database does support {@code UNION ALL}, 3106 * otherwise {@code false}. 3107 * @throws SQLException 3108 * a database error occurred. 3109 */ supportsUnionAll()3110 public boolean supportsUnionAll() throws SQLException; 3111 3112 /** 3113 * Determines whether the method {@code ResultSet.rowUpdated} can detect a visible 3114 * row update for the specified {@code ResultSet} type. 3115 * 3116 * @param type 3117 * {@code ResultSet} type: {@code ResultSet.TYPE_FORWARD_ONLY}, 3118 * {@code ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code 3119 * ResultSet.TYPE_SCROLL_SENSITIVE} 3120 * @return {@code true} detecting changes is possible, otherwise {@code 3121 * false}. 3122 * @throws SQLException 3123 * a database error occurred. 3124 */ updatesAreDetected(int type)3125 public boolean updatesAreDetected(int type) throws SQLException; 3126 3127 /** 3128 * Determines whether this database uses a file for each table. 3129 * 3130 * @return {@code true} if the database uses one file for each table, 3131 * otherwise {@code false}. 3132 * @throws SQLException 3133 * a database error occurred. 3134 */ usesLocalFilePerTable()3135 public boolean usesLocalFilePerTable() throws SQLException; 3136 3137 /** 3138 * Determines whether this database uses a local file to store tables. 3139 * 3140 * @return {@code true} if the database stores tables in a local file, 3141 * otherwise {@code false}. 3142 * @throws SQLException 3143 * a database error occurred. 3144 */ usesLocalFiles()3145 public boolean usesLocalFiles() throws SQLException; 3146 3147 /** 3148 * Determine if a SQLException while autoCommit is true indicates that all 3149 * open ResultSets are closed, even ones that are holdable 3150 * 3151 * @return true if all open ResultSets are closed 3152 * @throws SQLException 3153 * if any error occurs 3154 */ autoCommitFailureClosesAllResultSets()3155 boolean autoCommitFailureClosesAllResultSets() throws SQLException; 3156 3157 /** 3158 * Returns a list of the client info properties of the driver. 3159 * 3160 * @return a list of the client info 3161 * @throws SQLException 3162 * if any error occurs 3163 */ getClientInfoProperties()3164 ResultSet getClientInfoProperties() throws SQLException; 3165 3166 /** 3167 * Returns a description according to the given catalog's system or user 3168 * function parameters and return type. 3169 * 3170 * @param catalog 3171 * the given catalong 3172 * @param schemaPattern 3173 * the schema pattern 3174 * @param functionNamePattern 3175 * the function name pattern 3176 * @param columnNamePattern 3177 * the column name pattern 3178 * @return a description of user functions 3179 * @throws SQLException 3180 * if any error occurs 3181 */ getFunctionColumns(String catalog, String schemaPattern, String functionNamePattern, String columnNamePattern)3182 ResultSet getFunctionColumns(String catalog, String schemaPattern, 3183 String functionNamePattern, String columnNamePattern) 3184 throws SQLException; 3185 3186 /** 3187 * Returns a description of the system and user functions available 3188 * according to the given catalog. 3189 * 3190 * @param catalog 3191 * the given catalog 3192 * @param schemaPattern 3193 * the schema pattern 3194 * @param functionNamePattern 3195 * the function name pattern 3196 * @return user functions 3197 * @throws SQLException 3198 * if any error occurs 3199 */ getFunctions(String catalog, String schemaPattern, String functionNamePattern)3200 ResultSet getFunctions(String catalog, String schemaPattern, 3201 String functionNamePattern) throws SQLException; 3202 3203 /** 3204 * Returns the lifetime for which a RowId object remains valid if this data 3205 * source supports the SQL ROWID type 3206 * 3207 * @return the time of a RowId object that remains valid. 3208 * @throws SQLException 3209 * if any error occurs 3210 */ getRowIdLifetime()3211 RowIdLifetime getRowIdLifetime() throws SQLException; 3212 3213 /** 3214 * Returns the schema names ordered by TABLE_CATALOG and TABLE_SCHEMA. 3215 * 3216 * @param catalog 3217 * the catalog 3218 * @param schemaPattern 3219 * the schema pattern 3220 * @return the schema names 3221 * @throws SQLException 3222 * if any error occurs 3223 */ getSchemas(String catalog, String schemaPattern)3224 ResultSet getSchemas(String catalog, String schemaPattern) 3225 throws SQLException; 3226 3227 /** 3228 * Determine if this database supports invoking user-defined or vendor 3229 * functions using the stored procedure escape syntax. 3230 * 3231 * @return true if this database supports invoking user-defined or vendor 3232 * functions using the stored procedure escape syntax. 3233 * @throws SQLException 3234 * if any error occurs 3235 */ supportsStoredFunctionsUsingCallSyntax()3236 boolean supportsStoredFunctionsUsingCallSyntax() throws SQLException; 3237 } 3238