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