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