DatabaseMetaData.java 79.8 KB
Newer Older
1
/* DatabaseMetaData.java -- Information about the database itself.
2
   Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

This file is part of GNU Classpath.

GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
 
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING.  If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA.

21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
Linking this library statically or dynamically with other modules is
making a combined work based on this library.  Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.

As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module.  An independent module is a module which is not derived from
or based on this library.  If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so.  If you do not wish to do so, delete this
exception statement from your version. */
37 38 39

package java.sql;

40
public interface DatabaseMetaData 
41
{
42 43 44
  /**
   * It is unknown whether or not the procedure returns a result.
   */
45
  int procedureResultUnknown = 0;
46 47 48 49

  /**
   * The procedure does not return a result.
   */
50
  int procedureNoResult = 1;
51 52 53 54

  /**
   * The procedure returns a result.
   */
55
  int procedureReturnsResult = 2;
56 57 58 59

  /**
   * The column type is unknown.
   */
60
  int procedureColumnUnknown = 0;
61 62 63 64

  /**
   * The column type is input.
   */
65
  int procedureColumnIn = 1;
66 67 68 69

  /**
   * The column type is input/output.
   */
70
  int procedureColumnInOut = 2;
71 72 73 74

  /**
   * The column type is output
   */
75
  int procedureColumnOut = 4;
76 77 78 79

  /**
   * The column is used for return values.
   */
80
  int procedureColumnReturn = 5;
81 82 83 84

  /**
   * The column is used for storing results
   */
85
  int procedureColumnResult = 3;
86 87 88 89

  /**
   * NULL values are not allowed.
   */
90
  int procedureNoNulls = 0;
91 92 93 94

  /**
   * NULL values are allowed.
   */
95
  int procedureNullable = 1;
96 97 98 99

  /**
   * It is unknown whether or not NULL values are allowed.
   */
100
  int procedureNullableUnknown = 2;
101 102 103 104

  /**
   * The column does not allow NULL
   */
105
  int columnNoNulls = 0;
106 107 108 109

  /**
   * The column does allow NULL
   */
110
  int columnNullable = 1;
111 112 113 114

  /**
   * It is unknown whether or not the column allows NULL
   */
115
  int columnNullableUnknown = 2;
116 117 118 119 120

  /**
   * The best row's scope is only guaranteed to be valid so long as the
   * row is actually being used.
   */
121
  int bestRowTemporary = 0;
122 123 124 125

  /**
   * The best row identifier is valid to the end of the transaction.
   */
126
  int bestRowTransaction = 1;
127 128 129 130

  /**
   * The best row identifier is valid to the end of the session.
   */
131
  int bestRowSession = 2;
132 133 134 135

  /**
   * The best row may or may not be a pseudo-column.
   */
136
  int bestRowUnknown = 0;
137 138 139 140

  /**
   * The best row identifier is not a pseudo-column.
   */
141
  int bestRowNotPseudo = 1;
142 143 144 145

  /**
   * The best row identifier is a pseudo-column.
   */
146
  int bestRowPseudo = 2;
147 148 149 150

  /**
   * It is unknown whether or not the version column is a pseudo-column.
   */
151
  int versionColumnUnknown = 0;
152 153 154 155

  /**
   * The version column is not a pseudo-column
   */
156
  int versionColumnNotPseudo = 1;
157 158 159 160

  /**
   * The version column is a pseudo-column
   */
161
  int versionColumnPseudo = 2;
162 163 164 165

  /**
   * Foreign key changes are cascaded in updates or deletes.
   */
166
  int importedKeyCascade = 0;
167 168 169 170

  /**
   * Column may not be updated or deleted in use as a foreign key.
   */
171
  int importedKeyRestrict = 1;
172 173 174 175

  /**
   * When primary key is updated or deleted, the foreign key is set to NULL.
   */
176
  int importedKeySetNull = 2;
177 178 179 180

  /**
   * If the primary key is a foreign key, it cannot be udpated or deleted.
   */
181
  int importedKeyNoAction = 3;
182 183 184 185 186

  /**
   * If the primary key is updated or deleted, the foreign key is set to
   * a default value.
   */
187
  int importedKeySetDefault = 4;
188 189 190 191

  /**
   * Wish I knew what this meant.
   */
192
  int importedKeyInitiallyDeferred = 5;
193 194 195 196

  /**
   * Wish I knew what this meant.
   */
197
  int importedKeyInitiallyImmediate = 6;
198 199 200 201

  /**
   * Wish I knew what this meant.
   */
202
  int importedKeyNotDeferrable = 7;
203 204 205 206

  /**
   * A NULL value is not allowed for this data type.
   */
207
  int typeNoNulls = 0;
208 209 210 211

  /**
   * A NULL value is allowed for this data type.
   */
212
  int typeNullable = 1;
213 214 215 216

  /**
   * It is unknown whether or not NULL values are allowed for this data type.
   */
217
  int typeNullableUnknown = 2;
218 219 220 221

  /**
   * Where clauses are not supported for this type.
   */
222
  int typePredNone = 0;
223 224 225 226

  /**
   * Only "WHERE..LIKE" style WHERE clauses are allowed on this data type.
   */
227
  int typePredChar = 1;
228 229 230 231

  /**
   * All WHERE clauses except "WHERE..LIKE" style are allowed on this data type.
   */
232
  int typePredBasic = 2;
233 234 235 236

  /**
   * Any type of WHERE clause is allowed for this data type.
   */
237
  int typeSearchable = 3;
238 239 240 241

  /**
   * This column contains table statistics.
   */
242
  short tableIndexStatistic = 0;
243 244 245 246

  /**
   * This table index is clustered.
   */
247
  short tableIndexClustered = 1;
248 249 250 251

  /**
   * This table index is hashed.
   */
252
  short tableIndexHashed = 2;
253 254 255 256

  /**
   * This table index is of another type.
   */
257
  short tableIndexOther = 3;
258

259
  short attributeNoNulls = 0;
260

261
  short attributeNullable = 1;
262

263
  short attributeNullableUnknown = 2;
264

265
  int sqlStateXOpen = 1;
266

267
  int sqlStateSQL99 = 2;
268 269 270 271 272 273 274 275 276

  /**
   * This method tests whether or not all the procedures returned by
   * the <code>getProcedures</code> method can be called by this user.
   *
   * @return <code>true</code> if all the procedures can be called,
   * <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
277
  boolean allProceduresAreCallable() throws SQLException;
278 279 280 281 282 283 284 285 286 287

  /**
   * This method tests whether or not all the table returned by the
   * <code>getTables</code> method can be selected by this user.
   *
   * @return <code>true</code> if all the procedures can be called,
   * <code>false</code> otherwise.
   *
   * @exception SQLException If an error occurs.
   */
288
  boolean allTablesAreSelectable() throws SQLException;
289 290 291 292 293 294 295 296

  /**
   * This method returns the URL for this database.
   *
   * @return The URL string for this database, or <code>null</code> if it
   *         is not known.
   * @exception SQLException If an error occurs.
   */
297
  String getURL() throws SQLException;
298 299 300 301 302 303 304

  /**
   * This method returns the database username for this connection.
   *
   * @return The database username.
   * @exception SQLException If an error occurs.
   */
305
  String getUserName() throws SQLException;
306 307 308 309 310 311 312 313

  /**
   * This method tests whether or not the database is in read only mode.
   *
   * @return <code>true</code> if the database is in read only mode,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
314
  boolean isReadOnly() throws SQLException;
315 316 317 318 319 320 321 322

  /**
   * This method tests whether or not NULL's sort as high values.
   *
   * @return <code>true</code> if NULL's sort as high values, <code>false</code>
   *         otherwise.
   * @exception SQLException If an error occurs.
   */
323
  boolean nullsAreSortedHigh() throws SQLException;
324 325 326 327 328 329 330 331

  /**
   * This method tests whether or not NULL's sort as low values.
   *
   * @return <code>true</code> if NULL's sort as low values, <code>false</code>
   * otherwise.
   * @exception SQLException If an error occurs.
   */
332
  boolean nullsAreSortedLow() throws SQLException;
333 334 335 336 337 338 339 340

  /**
   * This method tests whether or not NULL's sort as high values.
   *
   * @return <code>true</code> if NULL's sort as high values, <code>false</code>
   * otherwise.
   * @exception SQLException If an error occurs.
   */
341
  boolean nullsAreSortedAtStart() throws SQLException;
342 343 344 345 346 347 348 349 350

  /**
   * This method test whether or not NULL's are sorted to the end
   * of the list regardless of ascending or descending sort order.
   *
   * @return <code>true</code> if NULL's always sort to the end,
   * <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
351
  boolean nullsAreSortedAtEnd() throws SQLException;
352 353 354 355 356 357 358

  /**
   * This method returns the name of the database product.
   *
   * @return The database product.
   * @exception SQLException If an error occurs.
   */
359
  String getDatabaseProductName() throws SQLException;
360 361 362 363 364 365 366

  /**
   * This method returns the version of the database product.
   *
   * @return The version of the database product.
   * @exception SQLException If an error occurs.
   */
367
  String getDatabaseProductVersion() throws SQLException;
368 369 370 371 372 373 374

  /**
   * This method returns the name of the JDBC driver.
   *
   * @return The name of the JDBC driver.
   * @exception SQLException If an error occurs.
   */
375
  String getDriverName() throws SQLException;
376 377 378 379 380 381 382

  /**
   * This method returns the version of the JDBC driver.
   *
   * @return The version of the JDBC driver.
   * @exception SQLException If an error occurs.
   */
383
  String getDriverVersion() throws SQLException;
384 385 386 387 388 389

  /**
   * This method returns the major version number of the JDBC driver.
   *
   * @return The major version number of the JDBC driver.
   */
390
  int getDriverMajorVersion();
391 392 393 394 395 396

  /**
   * This method returns the minor version number of the JDBC driver.
   *
   * @return The minor version number of the JDBC driver.
   */
397
  int getDriverMinorVersion();
398 399 400 401 402 403 404 405 406 407

  /**
   * This method tests whether or not the database uses local files to
   * store tables.
   *
   * @return <code>true</code> if the database uses local files, 
   * <code>false</code> otherwise.
   *
   * @exception SQLException If an error occurs.
   */
408
  boolean usesLocalFiles() throws SQLException;
409 410 411 412 413 414

  /**
   * This method tests whether or not the database uses a separate file for
   * each table.
   *
   * @return <code>true</code> if the database uses a separate file for each
415
   * table <code>false</code> otherwise.
416 417 418
   *
   * @exception SQLException If an error occurs.
   */
419
  boolean usesLocalFilePerTable() throws SQLException;
420 421 422 423 424 425 426 427 428 429

  /**
   * This method tests whether or not the database supports identifiers
   * with mixed case.
   *
   * @return <code>true</code> if the database supports mixed case identifiers,
   * <code>false</code> otherwise.
   *
   * @exception SQLException If an error occurs.
   */
430
  boolean supportsMixedCaseIdentifiers() throws SQLException;
431 432 433 434 435

  /**
   * This method tests whether or not the database treats mixed case
   * identifiers as all upper case.
   *
436 437
   * @return <code>true</code> if the database treats all identifiers as
   *         upper case, <code>false</code> otherwise.
438 439
   * @exception SQLException If an error occurs.
   */
440
  boolean storesUpperCaseIdentifiers() throws SQLException;
441 442 443 444 445

  /**
   * This method tests whether or not the database treats mixed case
   * identifiers as all lower case.
   *
446 447
   * @return <code>true</code> if the database treats all identifiers as
   *         lower case, <code>false</code> otherwise.
448 449
   * @exception SQLException If an error occurs.
   */
450
  boolean storesLowerCaseIdentifiers() throws SQLException;
451 452 453 454 455 456 457 458 459

  /**
   * This method tests whether or not the database stores mixed case 
   * identifers even if it treats them as case insensitive.
   *
   * @return <code>true</code> if the database stores mixed case identifiers,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
460
  boolean storesMixedCaseIdentifiers() throws SQLException;
461 462 463 464 465 466 467 468 469

  /**
   * This method tests whether or not the database supports quoted identifiers
   * with mixed case.
   *
   * @return <code>true</code> if the database supports mixed case quoted
   *         identifiers, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
470
  boolean supportsMixedCaseQuotedIdentifiers() throws SQLException;
471 472 473 474 475

  /**
   * This method tests whether or not the database treats mixed case
   * quoted identifiers as all upper case.
   *
476 477
   * @return <code>true</code> if the database treats all quoted identifiers 
   *         as upper case, <code>false</code> otherwise.
478 479
   * @exception SQLException If an error occurs.
   */
480
  boolean storesUpperCaseQuotedIdentifiers() throws SQLException;
481 482 483 484 485

  /**
   * This method tests whether or not the database treats mixed case
   * quoted identifiers as all lower case.
   *
486 487
   * @return <code>true</code> if the database treats all quoted identifiers 
   *         as lower case, <code>false</code> otherwise.
488 489
   * @exception SQLException If an error occurs.
   */
490
  boolean storesLowerCaseQuotedIdentifiers() throws SQLException;
491 492 493 494 495 496 497 498 499

  /**
   * This method tests whether or not the database stores mixed case 
   * quoted identifers even if it treats them as case insensitive.
   *
   * @return <code>true</code> if the database stores mixed case quoted 
   *         identifiers, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
500
  boolean storesMixedCaseQuotedIdentifiers() throws SQLException;
501 502 503 504 505 506 507 508

  /**
   * This metohd returns the quote string for SQL identifiers.
   *
   * @return The quote string for SQL identifers, or a space if quoting
   *         is not supported.
   * @exception SQLException If an error occurs.
   */
509
  String getIdentifierQuoteString() throws SQLException;
510 511 512 513 514 515 516 517

  /**
   * This method returns a comma separated list of all the SQL keywords in
   * the database that are not in SQL92.
   *
   * @return The list of SQL keywords not in SQL92.
   * @exception SQLException If an error occurs.
   */
518
  String getSQLKeywords() throws SQLException;
519 520 521 522 523 524 525

  /**
   * This method returns a comma separated list of math functions.
   *
   * @return The list of math functions.
   * @exception SQLException If an error occurs.
   */
526
  String getNumericFunctions() throws SQLException;
527 528 529 530 531 532 533

  /**
   * This method returns a comma separated list of string functions.
   *
   * @return The list of string functions.
   * @exception SQLException If an error occurs.
   */
534
  String getStringFunctions() throws SQLException;
535 536 537 538 539 540 541

  /**
   * This method returns a comma separated list of of system functions.
   *
   * @return A comma separated list of system functions.
   * @exception SQLException If an error occurs.
   */
542
  String getSystemFunctions() throws SQLException;
543 544 545 546 547 548 549

  /**
   * This method returns comma separated list of time/date functions.
   * 
   * @return The list of time/date functions.
   * @exception SQLException If an error occurs.
   */
550
  String getTimeDateFunctions() throws SQLException;
551 552 553 554 555 556 557

  /**
   * This method returns the string used to escape wildcards in search strings.
   *
   * @return The string used to escape wildcards in search strings.
   * @exception SQLException If an error occurs.
   */
558
  String getSearchStringEscape() throws SQLException;
559 560 561 562 563 564 565 566

  /**
   * This methods returns non-standard characters that can appear in 
   * unquoted identifiers.
   *
   * @return Non-standard characters that can appear in unquoted identifiers.
   * @exception SQLException If an error occurs.
   */
567
  String getExtraNameCharacters() throws SQLException;
568 569 570 571 572 573 574 575 576

  /**
   * This method tests whether or not the database supports
   * "ALTER TABLE ADD COLUMN"
   *
   * @return <code>true</code> if column add supported, <code>false</code>
   *         otherwise.
   * @exception SQLException If an error occurs.
   */
577
  boolean supportsAlterTableWithAddColumn() throws SQLException;
578 579 580 581 582 583 584 585 586

  /**
   * This method tests whether or not the database supports
   * "ALTER TABLE DROP COLUMN"
   *
   * @return <code>true</code> if column drop supported, <code>false</code>
   *         otherwise.
   * @exception SQLException If an error occurs.
   */
587
  boolean supportsAlterTableWithDropColumn() throws SQLException;
588 589 590 591 592 593 594 595

  /**
   * This method tests whether or not column aliasing is supported.
   *
   * @return <code>true</code> if column aliasing is supported,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
596
  boolean supportsColumnAliasing() throws SQLException;
597 598 599 600 601 602 603 604 605 606

  /**
   * This method tests whether the concatenation of a NULL and non-NULL
   * value results in a NULL.  This will always be true in fully JDBC compliant
   * drivers.
   *
   * @return <code>true</code> if concatenating NULL and a non-NULL value
   *         returns a NULL, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
607
  boolean nullPlusNonNullIsNull() throws SQLException;
608 609 610 611 612 613 614 615

  /**
   * Tests whether or not CONVERT is supported.
   *
   * @return <code>true</code> if CONVERT is supported, <code>false</code>
   *         otherwise.
   * @exception SQLException If an error occurs.
   */
616
  boolean supportsConvert() throws SQLException;
617 618 619 620 621 622 623 624 625 626 627

  /**
   * This method tests whether or not CONVERT can be performed between the
   * specified types.  The types are contants from <code>Types</code>.
   *
   * @param fromType The SQL type to convert from.
   * @param toType The SQL type to convert to.
   * @return <code>true</code> if the conversion can be performed,
   *         <code>false</code> otherwise.
   * @see Types
   */
628
  boolean supportsConvert(int fromType, int toType) throws
629 630 631 632 633 634 635 636 637 638 639
      SQLException;

  /**
   * This method tests whether or not table correlation names are 
   * supported.  This will be always be <code>true</code> in a fully JDBC
   * compliant driver.
   *
   * @return <code>true</code> if table correlation names are supported,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
640
  boolean supportsTableCorrelationNames() throws SQLException;
641 642 643 644 645 646 647 648 649

  /**
   * This method tests whether correlation names must be different from the
   * name of the table.
   *
   * @return <code>true</code> if the correlation name must be different from
   *         the table name, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
650
  boolean supportsDifferentTableCorrelationNames() throws SQLException;
651 652 653 654 655 656 657 658 659

  /**
   * This method tests whether or not expressions are allowed in an
   * ORDER BY lists.
   *
   * @return <code>true</code> if expressions are allowed in ORDER BY
   *         lists, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
660
  boolean supportsExpressionsInOrderBy() throws SQLException;
661 662 663 664 665 666 667 668 669

  /**
   * This method tests whether or ORDER BY on a non-selected column is
   * allowed.
   *
   * @return <code>true</code> if a non-selected column can be used in an
   *         ORDER BY, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
670
  boolean supportsOrderByUnrelated() throws SQLException;
671 672 673 674 675 676 677 678

  /**
   * This method tests whether or not GROUP BY is supported.
   *
   * @return <code>true</code> if GROUP BY is supported, <code>false</code>
   *         otherwise.
   * @exception SQLException If an error occurs.
   */
679
  boolean supportsGroupBy() throws SQLException;
680 681 682 683 684 685 686 687 688

  /**
   * This method tests whether GROUP BY on a non-selected column is
   * allowed.
   *
   * @return <code>true</code> if a non-selected column can be used in a
   *         GROUP BY, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
689
  boolean supportsGroupByUnrelated() throws SQLException;
690 691 692 693 694 695 696 697 698

  /**
   * This method tests whether or not a GROUP BY can add columns not in the
   * select if it includes all the columns in the select.
   *
   * @return <code>true</code> if GROUP BY an add columns provided it includes
   *         all columns in the select, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
699
  boolean supportsGroupByBeyondSelect() throws SQLException;
700 701 702 703 704 705 706 707 708 709

  /**
   * This method tests whether or not the escape character is supported in
   * LIKE expressions.  A fully JDBC compliant driver will always return
   * <code>true</code>.
   *
   * @return <code>true</code> if escapes are supported in LIKE expressions,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
710
  boolean supportsLikeEscapeClause() throws SQLException;
711 712 713 714 715 716 717 718 719

  /**
   * This method tests whether multiple result sets for a single statement are
   * supported.
   *
   * @return <code>true</code> if multiple result sets are supported for a 
   *         single statement, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
720
  boolean supportsMultipleResultSets() throws SQLException;
721 722 723 724 725 726 727 728 729

  /**
   * This method test whether or not multiple transactions may be open
   * at once, as long as they are on different connections.
   *
   * @return <code>true</code> if multiple transactions on different
   *         connections are supported, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
730
  boolean supportsMultipleTransactions() throws SQLException;
731 732 733 734 735 736 737 738 739

  /**
   * This method tests whether or not columns can be defined as NOT NULL.  A
   * fully JDBC compliant driver always returns <code>true</code>.
   *
   * @return <code>true</code> if NOT NULL columns are supported,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
740
  boolean supportsNonNullableColumns() throws SQLException;
741 742 743 744 745 746 747 748 749

  /**
   * This method tests whether or not the minimum grammer for ODBC is supported.
   * A fully JDBC compliant driver will always return <code>true</code>.
   *
   * @return <code>true</code> if the ODBC minimum grammar is supported,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
750
  boolean supportsMinimumSQLGrammar() throws SQLException;
751 752 753 754 755 756 757 758

  /**
   * This method tests whether or not the core grammer for ODBC is supported.
   *
   * @return <code>true</code> if the ODBC core grammar is supported,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
759
  boolean supportsCoreSQLGrammar() throws SQLException;
760 761 762 763 764 765 766 767

  /**
   * This method tests whether or not the extended grammer for ODBC is supported.
   *
   * @return <code>true</code> if the ODBC extended grammar is supported,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
768
  boolean supportsExtendedSQLGrammar() throws SQLException;
769 770 771 772 773 774 775 776 777 778

  /**
   * This method tests whether or not the ANSI92 entry level SQL
   * grammar is supported.  A fully JDBC compliant drivers must return
   * <code>true</code>.
   *
   * @return <code>true</code> if the ANSI92 entry level SQL grammar is
   *         supported, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
779
  boolean supportsANSI92EntryLevelSQL() throws SQLException;
780 781 782 783 784 785 786 787 788

  /**
   * This method tests whether or not the ANSI92 intermediate SQL
   * grammar is supported.  
   *
   * @return <code>true</code> if the ANSI92 intermediate SQL grammar is
   *         supported, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
789
  boolean supportsANSI92IntermediateSQL() throws SQLException;
790 791 792 793 794 795 796 797 798

  /**
   * This method tests whether or not the ANSI92 full SQL
   * grammar is supported.  
   *
   * @return <code>true</code> if the ANSI92 full SQL grammar is
   *         supported, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
799
  boolean supportsANSI92FullSQL() throws SQLException;
800 801 802 803 804 805 806 807 808

  /**
   * This method tests whether or not the SQL integrity enhancement
   * facility is supported.
   *
   * @return <code>true</code> if the integrity enhancement facility is
   *         supported, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
809
  boolean supportsIntegrityEnhancementFacility() throws SQLException;
810 811 812 813 814 815 816 817

  /**
   * This method tests whether or not the database supports outer joins.
   *
   * @return <code>true</code> if outer joins are supported, <code>false</code>
   *         otherwise.
   * @exception SQLException If an error occurs.
   */
818
  boolean supportsOuterJoins() throws SQLException;
819 820 821 822 823 824 825 826

  /**
   * This method tests whether or not the database supports full outer joins.
   *
   * @return <code>true</code> if full outer joins are supported, 
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
827
  boolean supportsFullOuterJoins() throws SQLException;
828 829 830 831 832 833 834 835

  /**
   * This method tests whether or not the database supports limited outer joins.
   *
   * @return <code>true</code> if limited outer joins are supported, 
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
836
  boolean supportsLimitedOuterJoins() throws SQLException;
837 838 839 840 841 842 843

  /**
   * This method returns the vendor's term for "schema".
   *
   * @return The vendor's term for schema.
   * @exception SQLException if an error occurs.
   */
844
  String getSchemaTerm() throws SQLException;
845 846 847 848 849 850 851

  /**
   * This method returns the vendor's term for "procedure".
   *
   * @return The vendor's term for procedure.
   * @exception SQLException if an error occurs.
   */
852
  String getProcedureTerm() throws SQLException;
853 854 855 856 857 858 859

  /**
   * This method returns the vendor's term for "catalog".
   *
   * @return The vendor's term for catalog.
   * @exception SQLException if an error occurs.
   */
860
  String getCatalogTerm() throws SQLException;
861 862 863 864 865 866 867 868 869

  /**
   * This method tests whether a catalog name appears at the beginning of
   * a fully qualified table name.
   *
   * @return <code>true</code> if the catalog name appears at the beginning,
   *         <code>false</code> if it appears at the end.
   * @exception SQLException If an error occurs.
   */
870
  boolean isCatalogAtStart() throws SQLException;
871 872 873 874 875 876 877 878

  /**
   * This method returns the separator between the catalog name and the
   * table name.
   *
   * @return The separator between the catalog name and the table name.
   * @exception SQLException If an error occurs.
   */
879
  String getCatalogSeparator() throws SQLException;
880 881 882 883 884 885 886 887 888

  /**
   * This method tests whether a catalog name can appear in a data
   * manipulation statement.
   *
   * @return <code>true</code> if a catalog name can appear in a data
   *         manipulation statement, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
889
  boolean supportsSchemasInDataManipulation() throws SQLException;
890 891 892 893 894 895 896 897 898

  /**
   * This method tests whether a catalog name can appear in a procedure
   * call
   *
   * @return <code>true</code> if a catalog name can appear in a procedure
   *         call, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
899
  boolean supportsSchemasInProcedureCalls() throws SQLException;
900 901 902 903 904 905 906 907

  /**
   * This method tests whether a catalog name can appear in a table definition.
   *
   * @return <code>true</code> if a catalog name can appear in a table
   *         definition, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
908
  boolean supportsSchemasInTableDefinitions() throws SQLException;
909 910 911 912 913 914 915 916

  /**
   * This method tests whether a catalog name can appear in an index definition.
   *
   * @return <code>true</code> if a catalog name can appear in an index
   *         definition, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
917
  boolean supportsSchemasInIndexDefinitions() throws SQLException;
918 919 920 921 922 923 924 925

  /**
   * This method tests whether a catalog name can appear in privilege definitions.
   *
   * @return <code>true</code> if a catalog name can appear in privilege
   *         definition, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
926
  boolean supportsSchemasInPrivilegeDefinitions() throws SQLException;
927 928 929 930 931 932 933 934 935

  /**
   * This method tests whether a catalog name can appear in a data
   * manipulation statement.
   *
   * @return <code>true</code> if a catalog name can appear in a data
   *         manipulation statement, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
936
  boolean supportsCatalogsInDataManipulation() throws SQLException;
937 938 939 940 941 942 943 944 945

  /**
   * This method tests whether a catalog name can appear in a procedure
   * call
   *
   * @return <code>true</code> if a catalog name can appear in a procedure
   *         call, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
946
  boolean supportsCatalogsInProcedureCalls() throws SQLException;
947 948 949 950 951 952 953 954

  /**
   * This method tests whether a catalog name can appear in a table definition.
   *
   * @return <code>true</code> if a catalog name can appear in a table
   *         definition, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
955
  boolean supportsCatalogsInTableDefinitions() throws SQLException;
956 957 958 959 960 961 962 963

  /**
   * This method tests whether a catalog name can appear in an index definition.
   *
   * @return <code>true</code> if a catalog name can appear in an index
   *         definition, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
964
  boolean supportsCatalogsInIndexDefinitions() throws SQLException;
965 966 967 968 969 970 971 972

  /**
   * This method tests whether a catalog name can appear in privilege definitions.
   *
   * @return <code>true</code> if a catalog name can appear in privilege
   *         definition, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
973
  boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException;
974 975 976 977 978 979 980 981 982

  /**
   * This method tests whether or not that database supports positioned
   * deletes.
   *
   * @return <code>true</code> if positioned deletes are supported,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
983
  boolean supportsPositionedDelete() throws SQLException;
984 985 986 987 988 989 990 991 992

  /**
   * This method tests whether or not that database supports positioned
   * updates.
   *
   * @return <code>true</code> if positioned updates are supported,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
993
  boolean supportsPositionedUpdate() throws SQLException;
994 995 996 997 998 999 1000 1001 1002

  /**
   * This method tests whether or not SELECT FOR UPDATE is supported by the
   * database.
   *
   * @return <code>true</code> if SELECT FOR UPDATE is supported 
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
1003
  boolean supportsSelectForUpdate() throws SQLException;
1004 1005 1006 1007 1008 1009 1010 1011 1012

  /**
   * This method tests whether or not stored procedures are supported on
   * this database.
   *
   * @return <code>true</code> if stored procedures are supported,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
1013
  boolean supportsStoredProcedures() throws SQLException;
1014 1015 1016 1017 1018 1019 1020 1021 1022

  /**
   * This method tests whether or not subqueries are allowed in comparisons.
   * A fully JDBC compliant driver will always return <code>true</code>.
   *
   * @return <code>true</code> if subqueries are allowed in comparisons,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
1023
  boolean supportsSubqueriesInComparisons() throws SQLException;
1024 1025 1026 1027 1028 1029 1030 1031 1032 1033

  /**
   * This method tests whether or not subqueries are allowed in exists
   * expressions.  A fully JDBC compliant driver will always return
   * <code>true</code>.
   *
   * @return <code>true</code> if subqueries are allowed in exists 
   *         expressions, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
1034
  boolean supportsSubqueriesInExists() throws SQLException;
1035 1036 1037 1038 1039 1040 1041 1042 1043

  /**
   * This method tests whether subqueries are allowed in IN statements.
   * A fully JDBC compliant driver will always return <code>true</code>.
   *
   * @return <code>true</code> if the driver supports subqueries in IN
   *         statements, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
1044
  boolean supportsSubqueriesInIns() throws SQLException;
1045 1046 1047 1048 1049 1050 1051 1052 1053 1054

  /**
   * This method tests whether or not subqueries are allowed in quantified
   * expressions.  A fully JDBC compliant driver will always return
   * <code>true</code>.
   *
   * @return <code>true</code> if subqueries are allowed in quantified 
   *         expressions, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
1055
  boolean supportsSubqueriesInQuantifieds() throws SQLException;
1056 1057 1058 1059 1060 1061 1062 1063 1064

  /**
   * This method test whether or not correlated subqueries are allowed. A
   * fully JDBC compliant driver will always return <code>true</code>.
   *
   * @return <code>true</code> if correlated subqueries are allowed,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
1065
  boolean supportsCorrelatedSubqueries() throws SQLException;
1066 1067 1068 1069 1070 1071 1072 1073

  /**
   * This method tests whether or not the UNION statement is supported.
   *
   * @return <code>true</code> if UNION is supported, <code>false</code>
   *         otherwise.
   * @exception SQLException If an error occurs.
   */
1074
  boolean supportsUnion() throws SQLException;
1075 1076 1077 1078 1079 1080 1081 1082

  /**
   * This method tests whether or not the UNION ALL statement is supported.
   *
   * @return <code>true</code> if UNION ALL is supported, <code>false</code>
   *         otherwise.
   * @exception SQLException If an error occurs.
   */
1083
  boolean supportsUnionAll() throws SQLException;
1084 1085 1086 1087 1088 1089 1090 1091 1092

  /**
   * This method tests whether or not the database supports cursors
   * remaining open across commits.
   *
   * @return <code>true</code> if cursors can remain open across commits,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
1093
  boolean supportsOpenCursorsAcrossCommit() throws SQLException;
1094 1095 1096 1097 1098 1099 1100 1101 1102

  /**
   * This method tests whether or not the database supports cursors
   * remaining open across rollbacks.
   *
   * @return <code>true</code> if cursors can remain open across rollbacks,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
1103
  boolean supportsOpenCursorsAcrossRollback() throws SQLException;
1104 1105 1106 1107 1108 1109 1110 1111 1112

  /**
   * This method tests whether or not the database supports statements
   * remaining open across commits.
   *
   * @return <code>true</code> if statements can remain open across commits,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
1113
  boolean supportsOpenStatementsAcrossCommit() throws SQLException;
1114 1115 1116 1117 1118 1119 1120 1121 1122

  /**
   * This method tests whether or not the database supports statements
   * remaining open across rollbacks.
   *
   * @return <code>true</code> if statements can remain open across rollbacks,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
1123
  boolean supportsOpenStatementsAcrossRollback() throws SQLException;
1124 1125 1126 1127 1128 1129 1130 1131 1132

  /**
   * This method returns the number of hex characters allowed in an inline
   * binary literal.
   *
   * @return The number of hex characters allowed in a binary literal, 0 meaning
   *         either an unknown or unlimited number.
   * @exception SQLException If an error occurs.
   */
1133
  int getMaxBinaryLiteralLength() throws SQLException;
1134 1135 1136 1137 1138 1139 1140

  /**
   * This method returns the maximum length of a character literal.
   * 
   * @return The maximum length of a character literal.
   * @exception SQLException If an error occurs.
   */
1141
  int getMaxCharLiteralLength() throws SQLException;
1142 1143 1144 1145 1146 1147 1148

  /**
   * This method returns the maximum length of a column name.
   *
   * @return The maximum length of a column name.
   * @exception SQLException If an error occurs.
   */
1149
  int getMaxColumnNameLength() throws SQLException;
1150 1151 1152 1153 1154 1155 1156

  /**
   * This method returns the maximum number of columns in a GROUP BY statement.
   *
   * @return The maximum number of columns in a GROUP BY statement.
   * @exception SQLException If an error occurs.
   */
1157
  int getMaxColumnsInGroupBy() throws SQLException;
1158 1159 1160 1161 1162 1163 1164

  /**
   * This method returns the maximum number of columns in an index.
   *
   * @return The maximum number of columns in an index.
   * @exception SQLException If an error occurs.
   */
1165
  int getMaxColumnsInIndex() throws SQLException;
1166 1167 1168 1169 1170 1171 1172

  /**
   * This method returns the maximum number of columns in an ORDER BY statement.
   *
   * @return The maximum number of columns in an ORDER BY statement.
   * @exception SQLException If an error occurs.
   */
1173
  int getMaxColumnsInOrderBy() throws SQLException;
1174 1175 1176 1177 1178 1179 1180

  /**
   * This method returns the maximum number of columns in a SELECT statement.
   *
   * @return The maximum number of columns in a SELECT statement.
   * @exception SQLException If an error occurs.
   */
1181
  int getMaxColumnsInSelect() throws SQLException;
1182 1183 1184 1185 1186 1187 1188

  /**
   * This method returns the maximum number of columns in a table.
   *
   * @return The maximum number of columns in a table.
   * @exception SQLException If an error occurs.
   */
1189
  int getMaxColumnsInTable() throws SQLException;
1190 1191 1192 1193 1194 1195 1196 1197

  /**
   * This method returns the maximum number of connections this client
   * can have to the database.
   *
   * @return The maximum number of database connections.
   * @SQLException If an error occurs.
   */
1198
  int getMaxConnections() throws SQLException;
1199 1200 1201 1202 1203 1204 1205

  /**
   * This method returns the maximum length of a cursor name.
   *
   * @return The maximum length of a cursor name.
   * @exception SQLException If an error occurs.
   */
1206
  int getMaxCursorNameLength() throws SQLException;
1207 1208 1209 1210 1211 1212 1213

  /**
   * This method returns the maximum length of an index.
   *
   * @return The maximum length of an index.
   * @exception SQLException If an error occurs.
   */
1214
  int getMaxIndexLength() throws SQLException;
1215 1216 1217 1218 1219 1220 1221

  /**
   * This method returns the maximum length of a schema name.
   *
   * @return The maximum length of a schema name.
   * @exception SQLException If an error occurs.
   */
1222
  int getMaxSchemaNameLength() throws SQLException;
1223 1224 1225 1226 1227 1228 1229

  /**
   * This method returns the maximum length of a procedure name.
   *
   * @return The maximum length of a procedure name.
   * @exception SQLException If an error occurs.
   */
1230
  int getMaxProcedureNameLength() throws SQLException;
1231 1232 1233 1234 1235 1236 1237

  /**
   * This method returns the maximum length of a catalog name.
   *
   * @return The maximum length of a catalog name.
   * @exception SQLException If an error occurs.
   */
1238
  int getMaxCatalogNameLength() throws SQLException;
1239 1240 1241 1242 1243 1244 1245

  /**
   * This method returns the maximum size of a row in bytes.
   *
   * @return The maximum size of a row.
   * @exception SQLException If an error occurs.
   */
1246
  int getMaxRowSize() throws SQLException;
1247 1248 1249 1250 1251 1252 1253 1254

  /**
   * This method tests whether or not the maximum row size includes BLOB's
   *
   * @return <code>true</code> if the maximum row size includes BLOB's,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
1255
  boolean doesMaxRowSizeIncludeBlobs() throws SQLException;
1256 1257 1258 1259 1260 1261 1262

  /**
   * This method includes the maximum length of a SQL statement.
   *
   * @return The maximum length of a SQL statement.
   * @exception SQLException If an error occurs.
   */
1263
  int getMaxStatementLength() throws SQLException;
1264 1265 1266 1267 1268 1269 1270 1271

  /**
   * This method returns the maximum number of statements that can be
   * active at any time.
   *
   * @return The maximum number of statements that can be active at any time.
   * @exception SQLException If an error occurs.
   */
1272
  int getMaxStatements() throws SQLException;
1273 1274 1275 1276 1277 1278 1279

  /**
   * This method returns the maximum length of a table name.
   *
   * @return The maximum length of a table name.
   * @exception SQLException If an error occurs.
   */
1280
  int getMaxTableNameLength() throws SQLException;
1281 1282 1283 1284 1285 1286 1287 1288

  /**
   * This method returns the maximum number of tables that may be referenced
   * in a SELECT statement.
   *
   * @return The maximum number of tables allowed in a SELECT statement.
   * @exception SQLException If an error occurs.
   */
1289
  int getMaxTablesInSelect() throws SQLException;
1290 1291 1292 1293 1294 1295 1296

  /**
   * This method returns the maximum length of a user name.
   *
   * @return The maximum length of a user name.
   * @exception SQLException If an error occurs.
   */
1297
  int getMaxUserNameLength() throws SQLException;
1298 1299 1300 1301 1302 1303 1304 1305 1306

  /**
   * This method returns the default transaction isolation level of the
   * database.
   *
   * @return The default transaction isolation level of the database.
   * @exception SQLException If an error occurs.
   * @see Connection
   */
1307
  int getDefaultTransactionIsolation() throws SQLException;
1308 1309 1310 1311 1312 1313 1314 1315

  /**
   * This method tests whether or not the database supports transactions.
   *
   * @return <code>true</code> if the database supports transactions,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
1316
  boolean supportsTransactions() throws SQLException;
1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327

  /**
   * This method tests whether or not the database supports the specified
   * transaction isolation level.
   *
   * @param level The transaction isolation level.
   *
   * @return <code>true</code> if the specified transaction isolation level
   *         is supported, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
1328
  boolean supportsTransactionIsolationLevel(int level) throws
1329 1330 1331 1332 1333 1334 1335 1336 1337 1338
      SQLException;

  /**
   * This method tests whether or not DDL and DML statements allowed within 
   * the same transaction.
   *
   * @return <code>true</code> if DDL and DML statements are allowed in the
   *         same transaction, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
1339
  boolean supportsDataDefinitionAndDataManipulationTransactions()
1340 1341 1342 1343 1344 1345 1346 1347 1348 1349
      throws SQLException;

  /**
   * This method tests whether or not only DML statement are allowed
   * inside a transaction.
   *
   * @return <code>true</code> if only DML statements are allowed in
   *         transactions, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
1350
  boolean supportsDataManipulationTransactionsOnly() throws
1351 1352 1353 1354 1355 1356 1357 1358 1359 1360
      SQLException;

  /**
   * This method tests whether or not a DDL statement will cause the
   * current transaction to be automatically committed.
   *
   * @return <code>true</code> if DDL causes an immediate transaction commit,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
1361
  boolean dataDefinitionCausesTransactionCommit() throws SQLException;
1362 1363 1364 1365 1366 1367 1368 1369 1370

  /**
   * This method tests whether or not DDL statements are ignored in
   * transactions.
   *
   * @return <code>true</code> if DDL statements are ignored in transactions,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
1371
  boolean dataDefinitionIgnoredInTransactions() throws SQLException;
1372 1373 1374 1375 1376 1377 1378 1379

  /**
   * This method returns a list of all the stored procedures matching the
   * specified pattern in the given schema and catalog.  This is returned
   * a <code>ResultSet</code> with the following columns:
   * <p>
   * <ol>
   * <li>PROCEDURE_CAT - The catalog the procedure is in, which may be 
1380
   * <code>null</code>.</li>
1381
   * <li>PROCEDURE_SCHEM - The schema the procedures is in, which may be
1382 1383 1384 1385 1386 1387
   * <code>null</code>.</li>
   * <li>PROCEDURE_NAME - The name of the procedure.</li>
   * <li>Unused</li>
   * <li>Unused</li>
   * <li>Unused</li>
   * <li>REMARKS - A description of the procedure</li>
1388 1389 1390
   * <li>PROCEDURE_TYPE - Indicates the return type of the procedure, which 
   * is one of the contstants defined in this class 
   * (<code>procedureResultUnknown</code>, <code>procedureNoResult</code>, or
1391
   * <code>procedureReturnsResult</code>).</li>
1392 1393 1394 1395 1396 1397 1398 1399 1400 1401
   * </ol>
   *
   * @param catalog The name of the catalog to return stored procedured from,
   *        or "" to return procedures from all catalogs.
   * @param schemaPattern A schema pattern for the schemas to return stored
   *        procedures from, or "" to return procedures from all schemas.
   * @param namePattern The pattern of procedures names to return.
   * @returns A <code>ResultSet</code> with all the requested procedures.
   * @exception SQLException If an error occurs.
   */
1402
  ResultSet getProcedures(String catalog, String schemaPattern, String
1403 1404 1405 1406 1407 1408 1409 1410 1411
      procedureNamePattern) throws SQLException;

  /**
   * This method returns a list of the parameter and result columns for
   * the requested stored procedures.  This is returned in the form of a
   * <code>ResultSet</code> with the following columns:
   * <p>
   * <ol>
   * <li>PROCEDURE_CAT - The catalog the procedure is in, which may be 
1412
   * <code>null</code>.</li>
1413
   * <li>PROCEDURE_SCHEM - The schema the procedures is in, which may be
1414 1415 1416
   * <code>null</code>.</li>
   * <li>PROCEDURE_NAME - The name of the procedure.</li>
   * <li>COLUMN_NAME - The name of the column</li>
1417 1418 1419 1420
   * <li>COLUMN_TYPE - The type of the column, which will be one of the
   * contants defined in this class (<code>procedureColumnUnknown</code>,
   * <code>procedureColumnIn</code>, <code>procedureColumnInOut</code>,
   * <code>procedureColumnOut</code>, <code>procedureColumnReturn</code>,
1421
   * or <code>procedureColumnResult</code>).</li>
1422
   * <li>DATA_TYPE - The SQL type of the column. This is one of the constants
1423 1424 1425 1426 1427 1428
   * defined in <code>Types</code>.</li>
   * <li>TYPE_NAME - The string name of the data type for this column.</li>
   * <li>PRECISION - The precision of the column.</li>
   * <li>LENGTH - The length of the column in bytes</li>
   * <li>SCALE - The scale of the column.</li>
   * <li>RADIX - The radix of the column.</li>
1429 1430
   * <li>NULLABLE - Whether or not the column is NULLABLE.  This is one of
   * the constants defined in this class (<code>procedureNoNulls</code>,
1431 1432
   * <code>procedureNullable</code>, or <code>procedureNullableUnknown</code>)</li>
   * <li>REMARKS - A description of the column.</li>
1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443
   * </ol>
   *
   * @param catalog The name of the catalog to return stored procedured from,
   *        or "" to return procedures from all catalogs.
   * @param schemaPattern A schema pattern for the schemas to return stored
   *        procedures from, or "" to return procedures from all schemas.
   * @param namePattern The pattern of procedures names to return.
   * @param columnPattern The pattern of column names to return.
   * @returns A <code>ResultSet</code> with all the requested procedures.
   * @exception SQLException If an error occurs.
   */
1444
  ResultSet getProcedureColumns(String catalog, String schemaPattern,
1445 1446 1447 1448 1449 1450
      String procedureNamePattern, String columnNamePattern) throws
      SQLException;

  /**
   * This method returns a list of the requested table as a   
   * <code>ResultSet</code> with the following columns:
1451
   *
1452
   * <ol>
1453 1454 1455
   * <li>TABLE_CAT - The catalog the table is in, which may be <code>null</code>.</li>
   * <li>TABLE_SCHEM - The schema the table is in, which may be <code>null</code>.</li>
   * <li>TABLE_NAME - The name of the table.</li>
1456
   * <li>TABLE_TYPE - A string describing the table type.  This will be one
1457 1458
   * of the values returned by the <code>getTableTypes()</code> method.</li>
   * <li>REMARKS - Comments about the table.</li>
1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469
   * </ol>
   * 
   * @param catalog The name of the catalog to return tables from,
   *        or "" to return tables from all catalogs.
   * @param schemaPattern A schema pattern for the schemas to return tables
   *        from, or "" to return tables from all schemas.
   * @param namePattern The pattern of table names to return.
   * @param types The list of table types to include; null returns all types.
   * @returns A <code>ResultSet</code> with all the requested tables.
   * @exception SQLException If an error occurs.
   */
1470
  ResultSet getTables(String catalog, String schemaPattern, String
1471 1472 1473 1474 1475 1476 1477 1478 1479 1480
      tableNamePattern, String[] types) throws SQLException;

  /**
   * This method returns the list of database schemas as a 
   * <code>ResultSet</code>, with one column - TABLE_SCHEM - that is the
   * name of the schema.
   *
   * @return A <code>ResultSet</code> with all the requested schemas.
   * @exception SQLException If an error occurs.
   */
1481
  ResultSet getSchemas() throws SQLException;
1482 1483 1484 1485 1486 1487 1488 1489 1490

  /**
   * This method returns the list of database catalogs as a
   * <code>ResultSet</code> with one column - TABLE_CAT - that is the
   * name of the catalog.
   *
   * @return A <code>ResultSet</code> with all the requested catalogs.
   * @exception SQLException If an error occurs.
   */
1491
  ResultSet getCatalogs() throws SQLException;
1492 1493 1494 1495 1496 1497 1498 1499 1500

  /**
   * This method returns the list of database table types as a
   * <code>ResultSet</code> with one column - TABLE_TYPE - that is the
   * name of the table type.
   *
   * @return A <code>ResultSet</code> with all the requested table types.
   * @exception SQLException If an error occurs.
   */
1501
  ResultSet getTableTypes() throws SQLException;
1502 1503 1504 1505 1506 1507 1508 1509

  /**
   * This method returns a list of the tables columns for
   * the requested tables.  This is returned in the form of a
   * <code>ResultSet</code> with the following columns:
   * <p>
   * <ol>
   * <li>TABLE_CAT - The catalog the table is in, which may be 
1510
   * <code>null</code>.</li>
1511
   * <li>TABLE_SCHEM - The schema the tables is in, which may be
1512 1513 1514
   * <code>null</code>.</li>
   * <li>TABLE_NAME - The name of the table.</li>
   * <li>COLUMN_NAME - The name of the column</li>
1515
   * <li>DATA_TYPE - The SQL type of the column. This is one of the constants
1516 1517 1518 1519 1520
   * defined in <code>Types</code>.</li>
   * <li>TYPE_NAME - The string name of the data type for this column.</li>
   * <li>COLUMN_SIZE - The size of the column.</li>
   * <li>Unused</li>
   * <li>NUM_PREC_RADIX - The radix of the column.</li>
1521 1522
   * <li>NULLABLE - Whether or not the column is NULLABLE.  This is one of
   * the constants defined in this class (<code>tableNoNulls</code>,
1523 1524 1525 1526 1527
   * <code>tableNullable</code>, or <code>tableNullableUnknown</code>)</li>
   * <li>REMARKS - A description of the column.</li>
   * <li>COLUMN_DEF - The default value for the column, may be <code>null</code>.</li>
   * <li>SQL_DATA_TYPE - Unused</li>
   * <li>SQL_DATETIME_SUB - Unused</li>
1528
   * <li>CHAR_OCTET_LENGTH - For character columns, the maximum number of bytes
1529 1530
   * in the column.</li>
   * <li>ORDINAL_POSITION - The index of the column in the table.</li>
1531
   * <li>IS_NULLABLE - "NO" means no, "YES" means maybe, and an empty string
1532
   * means unknown.</li>
1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543
   * </ol>
   *
   * @param catalog The name of the catalog to return table from,
   * or "" to return tables from all catalogs.
   * @param schemaPattern A schema pattern for the schemas to return 
   * tables from, or "" to return tables from all schemas.
   * @param namePattern The pattern of tables names to return.
   * @param columnPattern The pattern of column names to return.
   * @returns A <code>ResultSet</code> with all the requested tables.
   * @exception SQLException If an error occurs.
   */
1544
  ResultSet getColumns(String catalog, String schemaPattern, String
1545 1546 1547 1548 1549 1550
      tableNamePattern, String columnNamePattern) throws SQLException;

  /**
   * This method returns the access rights that have been granted to the
   * requested columns.  This information is returned as a <code>ResultSet</code>
   * with the following columns:
1551
   *
1552 1553
   * <ol>
   * <li>TABLE_CAT - The catalog the table is in, which may be 
1554
   * <code>null</code>.</li>
1555
   * <li>TABLE_SCHEM - The schema the tables is in, which may be
1556 1557 1558 1559 1560 1561
   * <code>null</code>.</li>
   * <li>TABLE_NAME - The name of the table.</li>
   * <li>COLUMN_NAME - The name of the column.</li>
   * <li>GRANTOR - The entity that granted the access.</li>
   * <li>GRANTEE - The entity granted the access.</li>
   * <li>PRIVILEGE - The name of the privilege granted.</li>
1562
   * <li>IS_GRANTABLE - "YES" if the grantee can grant the privilege to
1563
   * others, "NO" if not, and <code>null</code> if unknown.</li>
1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575
   * </ol>
   *
   * @param catalog The catalog to retrieve information from, or the empty string
   *        to return entities not associated with a catalog, or <code>null</code>
   *        to return information from all catalogs.
   * @param schema The schema to retrieve information from, or the empty string
   *        to return entities not associated with a schema.
   * @param table The table name to return information for.
   * @param columnPattern A pattern of column names to return information for.
   * @return A <code>ResultSet</code> with all the requested privileges.
   * @exception SQLException If an error occurs.
   */
1576
  ResultSet getColumnPrivileges(String catalog, String schema, String
1577 1578 1579 1580 1581 1582
      table, String columnNamePattern) throws SQLException;

  /**
   * This method returns the access rights that have been granted to the
   * requested tables.  This information is returned as a <code>ResultSet</code>
   * with the following columns:
1583
   *
1584 1585
   * <ol>
   * <li>TABLE_CAT - The catalog the table is in, which may be 
1586
   * <code>null</code>.</li>
1587
   * <li>TABLE_SCHEM - The schema the tables is in, which may be
1588 1589 1590 1591 1592
   * <code>null</code>.</li>
   * <li>TABLE_NAME - The name of the table.</li>
   * <li>GRANTOR - The entity that granted the access.</li>
   * <li>GRANTEE - The entity granted the access.</li>
   * <li>PRIVILEGE - The name of the privilege granted.</li>
1593
   * <li>IS_GRANTABLE - "YES" if the grantee can grant the privilege to
1594
   * others, "NO" if not, and <code>null</code> if unknown.</li>
1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606
   * </ol>
   *
   * @param catalog The catalog to retrieve information from, or the empty string
   *        to return entities not associated with a catalog, or <code>null</code>
   *        to return information from all catalogs.
   * @param schema The schema to retrieve information from, or the empty string
   *        to return entities not associated with a schema.
   * @param tablePattern The table name pattern of tables to return 
   *        information for.
   * @return A <code>ResultSet</code> with all the requested privileges.
   * @exception SQLException If an error occurs.
   */
1607
  ResultSet getTablePrivileges(String catalog, String schemaPattern,
1608 1609 1610 1611 1612 1613
      String tableNamePattern) throws SQLException;

  /**
   * This method returns the best set of columns for uniquely identifying
   * a row.  It returns this information as a <code>ResultSet</code> with
   * the following columns:
1614
   *
1615 1616 1617
   * <ol>
   * <li>SCOPE - The scope of the results returned.  This is one of the 
   * constants defined in this class (<code>bestRowTemporary</code>,
1618 1619
   * <code>bestRowTransaction</code>, or <code>bestRowSession</code>).</li>
   * <li>COLUMN_NAME - The name of the column.</li>
1620
   * <li>DATA_TYPE - The SQL type of the column. This is one of the constants
1621 1622 1623 1624 1625
   * defined in <code>Types</code>.</li>
   * <li>TYPE_NAME - The string name of the data type for this column.</li>
   * <li>COLUMN_SIZE - The precision of the columns</li>
   * <li>BUFFER_LENGTH - Unused</li>
   * <li>DECIMAL_DIGITS - The scale of the column.</li>
1626 1627 1628
   * <li>PSEUDO_COLUMN - Whether or not the best row identifier is a
   * pseudo_column.  This is one of the constants defined in this class 
   * (<code>bestRowUnknown</code>, <code>bestRowNotPseudo</code>, or
1629
   * <code>bestRowPseudo</code>).</li>
1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644
   * </ol>
   *
   * @param catalog The catalog to retrieve information from, or the empty string
   * to return entities not associated with a catalog, or <code>null</code>
   * to return information from all catalogs.
   * @param schema The schema to retrieve information from, or the empty string
   * to return entities not associated with a schema.
   * @param table The table name to return information for.
   * @param columnPattern A pattern of column names to return information for.
   * @param scope One of the best row id scope constants from this class.
   * @param nullable <code>true</code> to include columns that are nullable,
   * <code>false</code> otherwise.
   * @return A <code>ResultSet</code> with the best row identifier.
   * @exception SQLException If an error occurs.
   */
1645
  ResultSet getBestRowIdentifier(String catalog, String schema,
1646 1647 1648 1649 1650 1651
    String table, int scope, boolean nullable) throws SQLException;

  /**
   * This method returns the set of columns that are automatically updated
   * when the row is update. It returns this information as a 
   * <code>ResultSet</code> with the following columns:
1652
   *
1653
   * <ol>
1654 1655
   * <li>SCOPE - Unused</li>
   * <li>COLUMN_NAME - The name of the column.</li>
1656
   * <li>DATA_TYPE - The SQL type of the column. This is one of the constants
1657 1658 1659 1660 1661
   * defined in <code>Types</code>.</li>
   * <li>TYPE_NAME - The string name of the data type for this column.</li>
   * <li>COLUMN_SIZE - The precision of the columns</li>
   * <li>BUFFER_LENGTH - Unused</li>
   * <li>DECIMAL_DIGITS - The scale of the column.</li>
1662 1663 1664
   * <li>PSEUDO_COLUMN - Whether or not the best row identifier is a
   * pseudo_column.  This is one of the constants defined in this class 
   * (<code>versionRowUnknown</code>, <code>versionRowNotPseudo</code>, or
1665
   * <code>versionRowPseudo</code>).</li>
1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677
   * </ol>
   *
   * @param catalog The catalog to retrieve information from, or the empty string
   *        to return entities not associated with a catalog, or <code>null</code>
   *        to return information from all catalogs.
   * @param schema The schema to retrieve information from, or the empty string
   *        to return entities not associated with a schema.
   * @param table The table name to return information for.
   * @param columnPattern A pattern of column names to return information for.
   * @return A <code>ResultSet</code> with the version columns.
   * @exception SQLException If an error occurs.
   */
1678
  ResultSet getVersionColumns(String catalog, String schema,
1679 1680 1681 1682 1683
    String table) throws SQLException;

  /**
   * This method returns a list of a table's primary key columns.  These
   * are returned as a <code>ResultSet</code> with the following columns.
1684
   *
1685
   * <ol>
1686 1687 1688 1689 1690 1691
   * <li>TABLE_CAT - The catalog of the table, which may be <code>null</code>.</li>
   * <li>TABLE_SCHEM - The schema of the table, which may be <code>null</code>.</li>
   * <li>TABLE_NAME - The name of the table.</li>
   * <li>COLUMN_NAME - The name of the column.</li>
   * <li>KEY_SEQ - The sequence number of the column within the primary key.</li>
   * <li>PK_NAME - The name of the primary key, which may be <code>null</code>.</li>
1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703
   * </ol>
   *
   * @param catalog The catalog to retrieve information from, or the empty string
   *        to return entities not associated with a catalog, or <code>null</code>
   *        to return information from all catalogs.
   * @param schema The schema to retrieve information from, or the empty string
   *        to return entities not associated with a schema.
   * @param table The table name to return information for.
   * @param columnPattern A pattern of column names to return information for.
   * @return A <code>ResultSet</code> with the primary key columns.
   * @exception SQLException If an error occurs.
   */
1704
  ResultSet getPrimaryKeys(String catalog, String schema, String table)
1705 1706 1707 1708 1709
      throws SQLException;

  /**
   * This method returns a list of the table's foreign keys.  These are
   * returned as a <code>ResultSet</code> with the following columns:
1710
   *
1711
   * <ol>
1712 1713 1714 1715 1716 1717 1718 1719 1720
   * <li>PKTABLE_CAT - The catalog of the table the key was imported from.</li>
   * <li>PKTABLE_SCHEM - The schema of the table the key was imported from.</li>
   * <li>PKTABLE_NAME - The name of the table the key was imported from.</li>
   * <li>PKCOLUMN_NAME - The name of the column that was imported.</li>
   * <li>FKTABLE_CAT - The foreign key catalog name.</li>
   * <li>FKTABLE_SCHEM - The foreign key schema name.</li>
   * <li>FKTABLE_NAME - The foreign key table name.</li>
   * <li>FKCOLUMN_NAME - The foreign key column name.</li>
   * <li>KEY_SEQ - The sequence number of the column within the foreign key.</li>
1721 1722 1723 1724
   * <li>UPDATE_RULE - How the foreign key behaves when the primary key is
   * updated.  This is one of the constants defined in this class 
   * (<code>importedNoAction</code>, <code>importedKeyCascade</code>,
   * <code>importedKeySetNull</code>, <code>importedKeySetDefault</code>, or
1725
   * <code>importedKeyRestrict</code>).</li>
1726 1727 1728
   * <li>DELETE_RULE - How the foreign key behaves when the primary key is
   * deleted.  This is one of the constants defined in this class 
   * (<code>importedNoAction</code>, <code>importedKeyCascade</code>,
1729 1730 1731
   * <code>importedKeySetNull</code>, or <code>importedKeySetDefault</code>)</li>
   * <li>FK_NAME - The name of the foreign key.</li>
   * <li>PK_NAME - The name of the primary key.</li>
1732 1733 1734
   * <li>DEFERRABILITY - The deferrability value.  This is one of the
   * constants defined in this table (<code>importedKeyInitiallyDeferred</code>,
   * <code>importedKeyInitiallyImmediate</code>, or
1735
   * <code>importedKeyNotDeferrable</code>).</li>
1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748
   * </ol>
   *
   * @param catalog The catalog to retrieve information from, or the empty string
   *        to return entities not associated with a catalog, or <code>null</code>
   *        to return information from all catalogs.
   * @param schema The schema to retrieve information from, or the empty string
   *        to return entities not associated with a schema.
   * @param table The table name to return information for.
   *
   * @return A <code>ResultSet</code> with the foreign key columns.
   *
   * @exception SQLException If an error occurs.
   */
1749
  ResultSet getImportedKeys(String catalog, String schema,
1750 1751 1752 1753 1754 1755
    String table) throws SQLException;

  /**
   * This method returns a list of the table's which use this table's
   * primary key as a foreign key.  The information is
   * returned as a <code>ResultSet</code> with the following columns:
1756
   *
1757
   * <ol>
1758 1759 1760 1761 1762 1763 1764 1765 1766
   * <li>PKTABLE_CAT - The catalog of the table the key was imported from.</li>
   * <li>PKTABLE_SCHEM - The schema of the table the key was imported from.</li>
   * <li>PKTABLE_NAME - The name of the table the key was imported from.</li>
   * <li>PKCOLUMN_NAME - The name of the column that was imported.</li>
   * <li>FKTABLE_CAT - The foreign key catalog name.</li>
   * <li>FKTABLE_SCHEM - The foreign key schema name.</li>
   * <li>FKTABLE_NAME - The foreign key table name.</li>
   * <li>FKCOLUMN_NAME - The foreign key column name.</li>
   * <li>KEY_SEQ - The sequence number of the column within the foreign key.</li>
1767 1768 1769 1770
   * <li>UPDATE_RULE - How the foreign key behaves when the primary key is
   * updated.  This is one of the constants defined in this class 
   * (<code>importedNoAction</code>, <code>importedKeyCascade</code>,
   * <code>importedKeySetNull</code>, <code>importedKeySetDefault</code>, or
1771
   * <code>importedKeyRestrict</code>).</li>
1772 1773 1774
   * <li>DELETE_RULE - How the foreign key behaves when the primary key is
   * deleted.  This is one of the constants defined in this class 
   * (<code>importedNoAction</code>, <code>importedKeyCascade</code>,
1775 1776 1777
   * <code>importedKeySetNull</code>, or <code>importedKeySetDefault</code>)</li>
   * <li>FK_NAME - The name of the foreign key.</li>
   * <li>PK_NAME - The name of the primary key.</li>
1778 1779 1780
   * <li>DEFERRABILITY - The deferrability value.  This is one of the
   * constants defined in this table (<code>importedKeyInitiallyDeferred</code>,
   * <code>importedKeyInitiallyImmediate</code>, or
1781
   * <code>importedKeyNotDeferrable</code>).</li>
1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792
   * </ol>
   *
   * @param catalog The catalog to retrieve information from, or the empty string
   *        to return entities not associated with a catalog, or <code>null</code>
   *        to return information from all catalogs.
   * @param schema The schema to retrieve information from, or the empty string
   *        to return entities not associated with a schema.
   * @param table The table name to return information for.
   * @return A <code>ResultSet</code> with the requested information
   * @exception SQLException If an error occurs.
   */
1793
  ResultSet getExportedKeys(String catalog, String schema,
1794 1795 1796 1797 1798 1799
    String table) throws SQLException;

  /**
   * This method returns a description of how one table imports another
   * table's primary key as a foreign key.  The information is
   * returned as a <code>ResultSet</code> with the following columns:
1800
   *
1801
   * <ol>
1802 1803 1804 1805 1806 1807 1808 1809 1810
   * <li>PKTABLE_CAT - The catalog of the table the key was imported from.</li>
   * <li>PKTABLE_SCHEM - The schema of the table the key was imported from.</li>
   * <li>PKTABLE_NAME - The name of the table the key was imported from.</li>
   * <li>PKCOLUMN_NAME - The name of the column that was imported.</li>
   * <li>FKTABLE_CAT - The foreign key catalog name.</li>
   * <li>FKTABLE_SCHEM - The foreign key schema name.</li>
   * <li>FKTABLE_NAME - The foreign key table name.</li>
   * <li>FKCOLUMN_NAME - The foreign key column name.</li>
   * <li>KEY_SEQ - The sequence number of the column within the foreign key.</li>
1811 1812 1813 1814
   * <li>UPDATE_RULE - How the foreign key behaves when the primary key is
   * updated.  This is one of the constants defined in this class 
   * (<code>importedNoAction</code>, <code>importedKeyCascade</code>,
   * <code>importedKeySetNull</code>, <code>importedKeySetDefault</code>, or
1815
   * <code>importedKeyRestrict</code>).</li>
1816 1817 1818
   * <li>DELETE_RULE - How the foreign key behaves when the primary key is
   * deleted.  This is one of the constants defined in this class 
   * (<code>importedNoAction</code>, <code>importedKeyCascade</code>,
1819 1820 1821
   * <code>importedKeySetNull</code>, or <code>importedKeySetDefault</code>)</li>
   * <li>FK_NAME - The name of the foreign key.</li>
   * <li>PK_NAME - The name of the primary key.</li>
1822 1823 1824
   * <li>DEFERRABILITY - The deferrability value.  This is one of the
   * constants defined in this table (<code>importedKeyInitiallyDeferred</code>,
   * <code>importedKeyInitiallyImmediate</code>, or
1825
   * <code>importedKeyNotDeferrable</code>).</li>
1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844
   * </ol>
   *
   * @param primCatalog The catalog to retrieve information from, or the empty string
   *        to return entities not associated with a catalog, or <code>null</code>
   *        to return information from all catalogs, on the exporting side.
   * @param primSchema The schema to retrieve information from, or the empty string
   *        to return entities not associated with a schema, on the exporting side.
   * @param primTable The table name to return information for, on the exporting
   *        side.
   * @param forCatalog The catalog to retrieve information from, or the empty string
   *        to return entities not associated with a catalog, or <code>null</code>
   *        to return information from all catalogs, on the importing side.
   * @param forSchema The schema to retrieve information from, or the empty string
   *        to return entities not associated with a schema on the importing side.
   * @param forTable The table name to return information for on the importing
   *        side.
   * @return A <code>ResultSet</code> with the requested information
   * @exception SQLException If an error occurs.
   */
1845
  ResultSet getCrossReference(String primaryCatalog, String
1846 1847 1848 1849 1850 1851 1852
    primarySchema, String primaryTable, String foreignCatalog, String
    foreignSchema, String foreignTable) throws SQLException;

  /**
   * This method returns a list of the SQL types supported by this
   * database.  The information is returned as a <code>ResultSet</code>
   * with the following columns:
1853
   *
1854
   * <ol>
1855
   * <li>TYPE_NAME - The name of the data type.</li>
1856
   * <li>DATA_TYPE - A data type constant from <code>Types</code> for this
1857 1858
   * type.</li>
   * <li>PRECISION - The maximum precision of this type.</li>
1859
   * <li>LITERAL_PREFIX - Prefix value used to quote a literal, which may be
1860
   * <code>null</code>.</li>
1861
   * <li>LITERAL_SUFFIX - Suffix value used to quote a literal, which may be
1862
   * <code>null</code>.</li>
1863
   * <li>CREATE_PARAMS - The parameters used to create the type, which may be
1864
   * <code>null</code>.</li>
1865 1866 1867
   * <li>NULLABLE - Whether or not this type supports NULL values.  This will
   * be one of the constants defined in this interface 
   * (<code>typeNoNulls</code>, <code>typeNullable</code>, or
1868 1869
   * <code>typeNullableUnknown</code>).</li>
   * <li>CASE_SENSITIVE - Whether or not the value is case sensitive.</li>
1870 1871 1872
   * <li>SEARCHABLE - Whether or not "LIKE" expressions are supported in
   * WHERE clauses for this type.  This will be one of the constants defined
   * in this interface (<code>typePredNone</code>, <code>typePredChar</code>,
1873 1874 1875 1876 1877 1878 1879 1880 1881 1882
   * <code>typePredBasic</code>, or <code>typeSearchable</code>).</li>
   * <li>UNSIGNED_ATTRIBUTE - Is the value of this type unsigned.</li>
   * <li>FIXED_PREC_SCALE - Whether or not this type can be used for money.</li>
   * <li>AUTO_INCREMENT - Whether or not this type supports auto-incrementing.</li>
   * <li>LOCAL_TYPE_NAME - A localized name for this data type.</li>
   * <li>MINIMUM_SCALE - The minimum scale supported by this type.</li>
   * <li>MAXIMUM_SCALE - The maximum scale supported by this type.</li>
   * <li>SQL_DATA_TYPE - Unused.</li>
   * <li>SQL_DATETIME_SUB - Unused.</li>
   * <li>NUM_PREC_RADIX - The radix of this data type.</li>
1883 1884 1885 1886 1887
   * </ol>
   * 
   * @return A <code>ResultSet</code> with the list of available data types.
   * @exception SQLException If an error occurs.
   */
1888
  ResultSet getTypeInfo() throws SQLException;
1889 1890 1891 1892

  /**
   * This method returns information about a tables indices and statistics.
   * It is returned as a <code>ResultSet</code> with the following columns:
1893
   *
1894
   * <ol>
1895 1896 1897 1898 1899 1900
   * <li>TABLE_CAT - The catalog of the table, which may be <code>null</code>.</li>
   * <li>TABLE_SCHEM - The schema of the table, which may be <code>null</code>.</li>
   * <li>TABLE_NAME - The name of the table.</li>
   * <li>NON_UNIQUE - Are index values non-unique?</li>
   * <li>INDEX_QUALIFIER The index catalog, which may be <code>null</code></li>
   * <li>INDEX_NAME - The name of the index.</li>
1901 1902 1903
   * <li>TYPE - The type of index, which will be one of the constants defined
   * in this interface (<code>tableIndexStatistic</code>,
   * <code>tableIndexClustered</code>, <code>tableIndexHashed</code>, or
1904
   * <code>tableIndexOther</code>).</li>
1905
   * <li>ORDINAL_POSITION - The sequence number of this column in the index.
1906 1907
   * This will be 0 when the index type is <code>tableIndexStatistic</code>.</li>
   * <li>COLUMN_NAME - The name of this column in the index.</li>
1908 1909
   * <li>ASC_OR_DESC - "A" for an ascending sort sequence, "D" for a
   * descending sort sequence or <code>null</code> if a sort sequence is not
1910
   * supported.</li>
1911
   * <li>CARDINALITY - The number of unique rows in the index, or the number
1912
   * of rows in the table if the index type is <code>tableIndexStatistic</code>.</li>
1913
   * <li>PAGES - The number of pages used for the index, or the number of pages
1914
   * in the table if the index type is <code>tableIndexStatistic</code>.</li>
1915
   * <li>FILTER_CONDITION - The filter condition for this index, which may be
1916
   * <code>null</code>.</li>
1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931
   * </ol>
   *
   * @param catalog The catalog to retrieve information from, or the empty string
   *        to return entities not associated with a catalog, or 
   *        <code>null</code> to return information from all catalogs.
   * @param schema The schema to retrieve information from, or the empty string
   *        to return entities not associated with a schema.
   * @param table The table name to return information for.
   * @param unique <code>true</code> to return only unique indexes, 
   *        <code>false</code> otherwise.
   * @param approx <code>true</code> if data values can be approximations,
   *        <code>false</code> otherwise.
   * @return A <code>ResultSet</code> with the requested index information
   * @exception SQLException If an error occurs.
   */
1932
  ResultSet getIndexInfo(String catalog, String schema, String table,
1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948
    boolean unique, boolean approximate) throws SQLException;

  /**
   * This method tests whether or not the datbase supports the specified
   * result type.
   *
   * @param type The desired result type, which is one of the constants
   * defined in <code>ResultSet</code>.
   *
   * @return <code>true</code> if the result set type is supported,
   * <code>false</code> otherwise.
   *
   * @exception SQLException If an error occurs.
   *
   * @see ResultSet
   */
1949
  boolean supportsResultSetType(int type) throws SQLException;
1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963

  /**
   * This method tests whether the specified result set type and result set
   * concurrency type are supported by the database.
   *
   * @param type The desired result type, which is one of the constants
   *        defined in <code>ResultSet</code>.
   * @param concur The desired concurrency type, which is one of the constants
   *        defined in <code>ResultSet</code>.
   * @return <code>true</code> if the result set type is supported,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   * @see ResultSet
   */
1964
  boolean supportsResultSetConcurrency(int type, int concurrency)
1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977
      throws SQLException;

  /**
   * This method tests whether or not the specified result set type sees its
   * own updates.
   *
   * @param type The desired result type, which is one of the constants
   *        defined in <code>ResultSet</code>.
   * @return <code>true</code> if the result set type sees its own updates,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   * @see ResultSet
   */
1978
  boolean ownUpdatesAreVisible(int type) throws SQLException;
1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990

 /**
   * This method tests whether or not the specified result set type sees its
   * own deletes.
   *
   * @param type The desired result type, which is one of the constants
   *        defined in <code>ResultSet</code>.
   * @return <code>true</code> if the result set type sees its own deletes,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   * @see ResultSet
   */
1991
  boolean ownDeletesAreVisible(int type) throws SQLException;
1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003

  /**
   * This method tests whether or not the specified result set type sees its
   * own inserts.
   *
   * @param type The desired result type, which is one of the constants
   *        defined in <code>ResultSet</code>.
   * @return <code>true</code> if the result set type sees its own inserts,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   * @see ResultSet
   */
2004
  boolean ownInsertsAreVisible(int type) throws SQLException;
2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016

  /**
   * This method tests whether or not the specified result set type sees 
   * updates committed by others.
   *
   * @param type The desired result type, which is one of the constants
   *        defined in <code>ResultSet</code>.
   * @return <code>true</code> if the result set type sees other updates,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   * @see ResultSet
   */
2017
  boolean othersUpdatesAreVisible(int type) throws SQLException;
2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029

  /**
   * This method tests whether or not the specified result set type sees 
   * deletes committed by others.
   *
   * @param type The desired result type, which is one of the constants
   *        defined in <code>ResultSet</code>.
   * @return <code>true</code> if the result set type sees other deletes,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   * @see ResultSet
   */
2030
  boolean othersDeletesAreVisible(int type) throws SQLException;
2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042

  /**
   * This method tests whether or not the specified result set type sees 
   * inserts committed by others.
   *
   * @param type The desired result type, which is one of the constants
   *        defined in <code>ResultSet</code>.
   * @return <code>true</code> if the result set type sees other inserts,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   * @see ResultSet
   */
2043
  boolean othersInsertsAreVisible(int type) throws SQLException;
2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055

  /**
   * This method tests whether or not the specified result set type can detect
   * a visible update by calling the <code>rowUpdated</code> method.
   *
   * @param type The desired result type, which is one of the constants
   *        defined in <code>ResultSet</code>.
   * @return <code>true</code> if the result set type can detect visible updates
   *         using <code>rowUpdated</code>, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   * @see ResultSet
   */
2056
  boolean updatesAreDetected(int type) throws SQLException;
2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068

  /**
   * This method tests whether or not the specified result set type can detect
   * a visible delete by calling the <code>rowUpdated</code> method.
   *
   * @param type The desired result type, which is one of the constants
   *        defined in <code>ResultSet</code>.
   * @return <code>true</code> if the result set type can detect visible deletes
   *         using <code>rowUpdated</code>, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   * @see ResultSet
   */
2069
  boolean deletesAreDetected(int type) throws SQLException;
2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081
  
  /**
   * This method tests whether or not the specified result set type can detect
   * a visible insert by calling the <code>rowUpdated</code> method.
   *
   * @param type The desired result type, which is one of the constants
   *        defined in <code>ResultSet</code>.
   * @return <code>true</code> if the result set type can detect visible inserts
   *         using <code>rowUpdated</code>, <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   * @see ResultSet
   */
2082
  boolean insertsAreDetected(int type) throws SQLException;
2083 2084 2085 2086 2087 2088 2089 2090

  /**
   * This method tests whether or not the database supports batch updates.
   *
   * @return <code>true</code> if batch updates are supported,
   *         <code>false</code> otherwise.
   * @exception SQLException If an error occurs.
   */
2091
  boolean supportsBatchUpdates() throws SQLException;
2092 2093 2094 2095

  /**
   * This method returns the list of user defined data types in use.  These
   * are returned as a <code>ResultSet</code> with the following columns:
2096
   *
2097
   * <ol>
2098 2099 2100 2101
   * <li>TYPE_CAT - The catalog name, which may be <code>null</code>.</li>
   * <li>TYPE_SCEHM - The schema name, which may be <code>null</code>.</li>
   * <li>TYPE_NAME - The user defined data type name.</li>
   * <li>CLASS_NAME - The Java class name this type maps to.</li>
2102 2103
   * <li>DATA_TYPE - A type identifier from <code>Types</code> for this type.
   * This will be one of <code>JAVA_OBJECT</code>, <code>STRUCT</code>, or
2104 2105
   * <code>DISTINCT</code>.</li>
   * <li>REMARKS - Comments about this data type.</li>
2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118
   * </ol>
   *
   * @param catalog The catalog to retrieve information from, or the empty string
   *        to return entities not associated with a catalog, or <code>null</code>
   *        to return information from all catalogs.
   * @param schema The schema to retrieve information from, or the empty string
   *        to return entities not associated with a schema.
   * @param typePattern The type name pattern to match.
   * @param types The type identifier patterns (from <code>Types</code>) to
   *        match.
   * @return A <code>ResultSet</code> with the requested type information
   * @exception SQLException If an error occurs.
   */
2119
  ResultSet getUDTs(String catalog, String schemaPattern, String
2120 2121 2122 2123 2124 2125 2126 2127 2128
      typeNamePattern, int[] types) throws SQLException;

  /**
   * This method returns the <code>Connection</code> object that was used
   * to generate the metadata in this object.
   *
   * @return The connection for this object.
   * @exception SQLException If an error occurs.
   */
2129
  Connection getConnection() throws SQLException;
2130 2131 2132 2133

  /**
   * @since 1.4
   */
2134
  boolean supportsSavepoints() throws SQLException;
2135 2136 2137 2138

  /**
   * @since 1.4
   */
2139
  boolean supportsNamedParameters() throws SQLException;
2140 2141 2142 2143

  /**
   * @since 1.4
   */
2144
  boolean supportsMultipleOpenResults() throws SQLException;
2145 2146 2147 2148

  /**
   * @since 1.4
   */
2149
  boolean supportsGetGeneratedKeys() throws SQLException;
2150 2151 2152 2153

  /**
   * @since 1.4
   */
2154
  ResultSet getSuperTypes(String catalog, String schemaPattern,
2155 2156 2157 2158 2159
    String typeNamePattern) throws SQLException;

  /**
   * @since 1.4
   */
2160
  ResultSet getSuperTables(String catalog, String schemaPattern,
2161 2162 2163 2164 2165
    String tableNamePattern) throws SQLException;

  /**
   * @since 1.4
   */
2166
  ResultSet getAttributes(String catalog, String schemaPattern, String
2167 2168 2169 2170 2171
    typeNamePattern, String attributeNamePattern) throws SQLException;

  /**
   * @since 1.4
   */
2172
  boolean supportsResultSetHoldability(int holdability)
2173 2174 2175 2176 2177
    throws SQLException;

  /**
   * @since 1.4
   */
2178
  int getResultSetHoldability() throws SQLException;
2179 2180 2181 2182

  /**
   * @since 1.4
   */
2183
  int getDatabaseMajorVersion() throws SQLException;
2184 2185 2186 2187

  /**
   * @since 1.4
   */
2188
  int getDatabaseMinorVersion() throws SQLException;
2189 2190 2191 2192

  /**
   * @since 1.4
   */
2193
  int getJDBCMajorVersion() throws SQLException;
2194 2195 2196 2197

  /**
   * @since 1.4
   */
2198
  int getJDBCMinorVersion() throws SQLException;
2199 2200 2201 2202

  /**
   * @since 1.4
   */
2203
  int getSQLStateType() throws SQLException;
2204 2205 2206 2207

  /**
   * @since 1.4
   */
2208
  boolean locatorsUpdateCopy() throws SQLException;
2209 2210 2211 2212

  /**
   * @since 1.4
   */
2213
  boolean supportsStatementPooling() throws SQLException;
2214
}