DatabaseMetaData.java 82 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271
  1. /* DatabaseMetaData.java -- Information about the database itself.
  2. Copyright (C) 1999, 2000, 2001, 2002, 2006 Free Software Foundation, Inc.
  3. This file is part of GNU Classpath.
  4. GNU Classpath is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. GNU Classpath is distributed in the hope that it will be useful, but
  9. WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GNU Classpath; see the file COPYING. If not, write to the
  14. Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  15. 02110-1301 USA.
  16. Linking this library statically or dynamically with other modules is
  17. making a combined work based on this library. Thus, the terms and
  18. conditions of the GNU General Public License cover the whole
  19. combination.
  20. As a special exception, the copyright holders of this library give you
  21. permission to link this library with independent modules to produce an
  22. executable, regardless of the license terms of these independent
  23. modules, and to copy and distribute the resulting executable under
  24. terms of your choice, provided that you also meet, for each linked
  25. independent module, the terms and conditions of the license of that
  26. module. An independent module is a module which is not derived from
  27. or based on this library. If you modify this library, you may extend
  28. this exception to your version of the library, but you are not
  29. obligated to do so. If you do not wish to do so, delete this
  30. exception statement from your version. */
  31. package java.sql;
  32. public interface DatabaseMetaData
  33. {
  34. /**
  35. * It is unknown whether or not the procedure returns a result.
  36. */
  37. int procedureResultUnknown = 0;
  38. /**
  39. * The procedure does not return a result.
  40. */
  41. int procedureNoResult = 1;
  42. /**
  43. * The procedure returns a result.
  44. */
  45. int procedureReturnsResult = 2;
  46. /**
  47. * The column type is unknown.
  48. */
  49. int procedureColumnUnknown = 0;
  50. /**
  51. * The column type is input.
  52. */
  53. int procedureColumnIn = 1;
  54. /**
  55. * The column type is input/output.
  56. */
  57. int procedureColumnInOut = 2;
  58. /**
  59. * The column type is output
  60. */
  61. int procedureColumnOut = 4;
  62. /**
  63. * The column is used for return values.
  64. */
  65. int procedureColumnReturn = 5;
  66. /**
  67. * The column is used for storing results
  68. */
  69. int procedureColumnResult = 3;
  70. /**
  71. * NULL values are not allowed.
  72. */
  73. int procedureNoNulls = 0;
  74. /**
  75. * NULL values are allowed.
  76. */
  77. int procedureNullable = 1;
  78. /**
  79. * It is unknown whether or not NULL values are allowed.
  80. */
  81. int procedureNullableUnknown = 2;
  82. /**
  83. * The column does not allow NULL
  84. */
  85. int columnNoNulls = 0;
  86. /**
  87. * The column does allow NULL
  88. */
  89. int columnNullable = 1;
  90. /**
  91. * It is unknown whether or not the column allows NULL
  92. */
  93. int columnNullableUnknown = 2;
  94. /**
  95. * The best row's scope is only guaranteed to be valid so long as the
  96. * row is actually being used.
  97. */
  98. int bestRowTemporary = 0;
  99. /**
  100. * The best row identifier is valid to the end of the transaction.
  101. */
  102. int bestRowTransaction = 1;
  103. /**
  104. * The best row identifier is valid to the end of the session.
  105. */
  106. int bestRowSession = 2;
  107. /**
  108. * The best row may or may not be a pseudo-column.
  109. */
  110. int bestRowUnknown = 0;
  111. /**
  112. * The best row identifier is not a pseudo-column.
  113. */
  114. int bestRowNotPseudo = 1;
  115. /**
  116. * The best row identifier is a pseudo-column.
  117. */
  118. int bestRowPseudo = 2;
  119. /**
  120. * It is unknown whether or not the version column is a pseudo-column.
  121. */
  122. int versionColumnUnknown = 0;
  123. /**
  124. * The version column is not a pseudo-column
  125. */
  126. int versionColumnNotPseudo = 1;
  127. /**
  128. * The version column is a pseudo-column
  129. */
  130. int versionColumnPseudo = 2;
  131. /**
  132. * Foreign key changes are cascaded in updates or deletes.
  133. */
  134. int importedKeyCascade = 0;
  135. /**
  136. * Column may not be updated or deleted in use as a foreign key.
  137. */
  138. int importedKeyRestrict = 1;
  139. /**
  140. * When primary key is updated or deleted, the foreign key is set to NULL.
  141. */
  142. int importedKeySetNull = 2;
  143. /**
  144. * If the primary key is a foreign key, it cannot be udpated or deleted.
  145. */
  146. int importedKeyNoAction = 3;
  147. /**
  148. * If the primary key is updated or deleted, the foreign key is set to
  149. * a default value.
  150. */
  151. int importedKeySetDefault = 4;
  152. /**
  153. * Wish I knew what this meant.
  154. */
  155. int importedKeyInitiallyDeferred = 5;
  156. /**
  157. * Wish I knew what this meant.
  158. */
  159. int importedKeyInitiallyImmediate = 6;
  160. /**
  161. * Wish I knew what this meant.
  162. */
  163. int importedKeyNotDeferrable = 7;
  164. /**
  165. * A NULL value is not allowed for this data type.
  166. */
  167. int typeNoNulls = 0;
  168. /**
  169. * A NULL value is allowed for this data type.
  170. */
  171. int typeNullable = 1;
  172. /**
  173. * It is unknown whether or not NULL values are allowed for this data type.
  174. */
  175. int typeNullableUnknown = 2;
  176. /**
  177. * Where clauses are not supported for this type.
  178. */
  179. int typePredNone = 0;
  180. /**
  181. * Only "WHERE..LIKE" style WHERE clauses are allowed on this data type.
  182. */
  183. int typePredChar = 1;
  184. /**
  185. * All WHERE clauses except "WHERE..LIKE" style are allowed on this data type.
  186. */
  187. int typePredBasic = 2;
  188. /**
  189. * Any type of WHERE clause is allowed for this data type.
  190. */
  191. int typeSearchable = 3;
  192. /**
  193. * This column contains table statistics.
  194. */
  195. short tableIndexStatistic = 0;
  196. /**
  197. * This table index is clustered.
  198. */
  199. short tableIndexClustered = 1;
  200. /**
  201. * This table index is hashed.
  202. */
  203. short tableIndexHashed = 2;
  204. /**
  205. * This table index is of another type.
  206. */
  207. short tableIndexOther = 3;
  208. /**
  209. * A NULL value is not allowed for this attribute.
  210. */
  211. short attributeNoNulls = 0;
  212. /**
  213. * A NULL value is allowed for this attribute.
  214. */
  215. short attributeNullable = 1;
  216. /**
  217. * It is unknown whether or not NULL values are allowed for this attribute.
  218. */
  219. short attributeNullableUnknown = 2;
  220. int sqlStateXOpen = 1;
  221. int sqlStateSQL99 = 2;
  222. /**
  223. * This method tests whether or not all the procedures returned by
  224. * the <code>getProcedures</code> method can be called by this user.
  225. *
  226. * @return <code>true</code> if all the procedures can be called,
  227. * <code>false</code> otherwise.
  228. * @exception SQLException If an error occurs.
  229. */
  230. boolean allProceduresAreCallable() throws SQLException;
  231. /**
  232. * This method tests whether or not all the table returned by the
  233. * <code>getTables</code> method can be selected by this user.
  234. *
  235. * @return <code>true</code> if all the procedures can be called,
  236. * <code>false</code> otherwise.
  237. *
  238. * @exception SQLException If an error occurs.
  239. */
  240. boolean allTablesAreSelectable() throws SQLException;
  241. /**
  242. * This method returns the URL for this database.
  243. *
  244. * @return The URL string for this database, or <code>null</code> if it
  245. * is not known.
  246. * @exception SQLException If an error occurs.
  247. */
  248. String getURL() throws SQLException;
  249. /**
  250. * This method returns the database username for this connection.
  251. *
  252. * @return The database username.
  253. * @exception SQLException If an error occurs.
  254. */
  255. String getUserName() throws SQLException;
  256. /**
  257. * This method tests whether or not the database is in read only mode.
  258. *
  259. * @return <code>true</code> if the database is in read only mode,
  260. * <code>false</code> otherwise.
  261. * @exception SQLException If an error occurs.
  262. */
  263. boolean isReadOnly() throws SQLException;
  264. /**
  265. * This method tests whether or not NULL's sort as high values.
  266. *
  267. * @return <code>true</code> if NULL's sort as high values, <code>false</code>
  268. * otherwise.
  269. * @exception SQLException If an error occurs.
  270. */
  271. boolean nullsAreSortedHigh() throws SQLException;
  272. /**
  273. * This method tests whether or not NULL's sort as low values.
  274. *
  275. * @return <code>true</code> if NULL's sort as low values, <code>false</code>
  276. * otherwise.
  277. * @exception SQLException If an error occurs.
  278. */
  279. boolean nullsAreSortedLow() throws SQLException;
  280. /**
  281. * This method tests whether or not NULL's sort as high values.
  282. *
  283. * @return <code>true</code> if NULL's sort as high values, <code>false</code>
  284. * otherwise.
  285. * @exception SQLException If an error occurs.
  286. */
  287. boolean nullsAreSortedAtStart() throws SQLException;
  288. /**
  289. * This method test whether or not NULL's are sorted to the end
  290. * of the list regardless of ascending or descending sort order.
  291. *
  292. * @return <code>true</code> if NULL's always sort to the end,
  293. * <code>false</code> otherwise.
  294. * @exception SQLException If an error occurs.
  295. */
  296. boolean nullsAreSortedAtEnd() throws SQLException;
  297. /**
  298. * This method returns the name of the database product.
  299. *
  300. * @return The database product.
  301. * @exception SQLException If an error occurs.
  302. */
  303. String getDatabaseProductName() throws SQLException;
  304. /**
  305. * This method returns the version of the database product.
  306. *
  307. * @return The version of the database product.
  308. * @exception SQLException If an error occurs.
  309. */
  310. String getDatabaseProductVersion() throws SQLException;
  311. /**
  312. * This method returns the name of the JDBC driver.
  313. *
  314. * @return The name of the JDBC driver.
  315. * @exception SQLException If an error occurs.
  316. */
  317. String getDriverName() throws SQLException;
  318. /**
  319. * This method returns the version of the JDBC driver.
  320. *
  321. * @return The version of the JDBC driver.
  322. * @exception SQLException If an error occurs.
  323. */
  324. String getDriverVersion() throws SQLException;
  325. /**
  326. * This method returns the major version number of the JDBC driver.
  327. *
  328. * @return The major version number of the JDBC driver.
  329. */
  330. int getDriverMajorVersion();
  331. /**
  332. * This method returns the minor version number of the JDBC driver.
  333. *
  334. * @return The minor version number of the JDBC driver.
  335. */
  336. int getDriverMinorVersion();
  337. /**
  338. * This method tests whether or not the database uses local files to
  339. * store tables.
  340. *
  341. * @return <code>true</code> if the database uses local files,
  342. * <code>false</code> otherwise.
  343. *
  344. * @exception SQLException If an error occurs.
  345. */
  346. boolean usesLocalFiles() throws SQLException;
  347. /**
  348. * This method tests whether or not the database uses a separate file for
  349. * each table.
  350. *
  351. * @return <code>true</code> if the database uses a separate file for each
  352. * table <code>false</code> otherwise.
  353. *
  354. * @exception SQLException If an error occurs.
  355. */
  356. boolean usesLocalFilePerTable() throws SQLException;
  357. /**
  358. * This method tests whether or not the database supports identifiers
  359. * with mixed case.
  360. *
  361. * @return <code>true</code> if the database supports mixed case identifiers,
  362. * <code>false</code> otherwise.
  363. *
  364. * @exception SQLException If an error occurs.
  365. */
  366. boolean supportsMixedCaseIdentifiers() throws SQLException;
  367. /**
  368. * This method tests whether or not the database treats mixed case
  369. * identifiers as all upper case.
  370. *
  371. * @return <code>true</code> if the database treats all identifiers as
  372. * upper case, <code>false</code> otherwise.
  373. * @exception SQLException If an error occurs.
  374. */
  375. boolean storesUpperCaseIdentifiers() throws SQLException;
  376. /**
  377. * This method tests whether or not the database treats mixed case
  378. * identifiers as all lower case.
  379. *
  380. * @return <code>true</code> if the database treats all identifiers as
  381. * lower case, <code>false</code> otherwise.
  382. * @exception SQLException If an error occurs.
  383. */
  384. boolean storesLowerCaseIdentifiers() throws SQLException;
  385. /**
  386. * This method tests whether or not the database stores mixed case
  387. * identifers even if it treats them as case insensitive.
  388. *
  389. * @return <code>true</code> if the database stores mixed case identifiers,
  390. * <code>false</code> otherwise.
  391. * @exception SQLException If an error occurs.
  392. */
  393. boolean storesMixedCaseIdentifiers() throws SQLException;
  394. /**
  395. * This method tests whether or not the database supports quoted identifiers
  396. * with mixed case.
  397. *
  398. * @return <code>true</code> if the database supports mixed case quoted
  399. * identifiers, <code>false</code> otherwise.
  400. * @exception SQLException If an error occurs.
  401. */
  402. boolean supportsMixedCaseQuotedIdentifiers() throws SQLException;
  403. /**
  404. * This method tests whether or not the database treats mixed case
  405. * quoted identifiers as all upper case.
  406. *
  407. * @return <code>true</code> if the database treats all quoted identifiers
  408. * as upper case, <code>false</code> otherwise.
  409. * @exception SQLException If an error occurs.
  410. */
  411. boolean storesUpperCaseQuotedIdentifiers() throws SQLException;
  412. /**
  413. * This method tests whether or not the database treats mixed case
  414. * quoted identifiers as all lower case.
  415. *
  416. * @return <code>true</code> if the database treats all quoted identifiers
  417. * as lower case, <code>false</code> otherwise.
  418. * @exception SQLException If an error occurs.
  419. */
  420. boolean storesLowerCaseQuotedIdentifiers() throws SQLException;
  421. /**
  422. * This method tests whether or not the database stores mixed case
  423. * quoted identifers even if it treats them as case insensitive.
  424. *
  425. * @return <code>true</code> if the database stores mixed case quoted
  426. * identifiers, <code>false</code> otherwise.
  427. * @exception SQLException If an error occurs.
  428. */
  429. boolean storesMixedCaseQuotedIdentifiers() throws SQLException;
  430. /**
  431. * This metohd returns the quote string for SQL identifiers.
  432. *
  433. * @return The quote string for SQL identifers, or a space if quoting
  434. * is not supported.
  435. * @exception SQLException If an error occurs.
  436. */
  437. String getIdentifierQuoteString() throws SQLException;
  438. /**
  439. * This method returns a comma separated list of all the SQL keywords in
  440. * the database that are not in SQL92.
  441. *
  442. * @return The list of SQL keywords not in SQL92.
  443. * @exception SQLException If an error occurs.
  444. */
  445. String getSQLKeywords() throws SQLException;
  446. /**
  447. * This method returns a comma separated list of math functions.
  448. *
  449. * @return The list of math functions.
  450. * @exception SQLException If an error occurs.
  451. */
  452. String getNumericFunctions() throws SQLException;
  453. /**
  454. * This method returns a comma separated list of string functions.
  455. *
  456. * @return The list of string functions.
  457. * @exception SQLException If an error occurs.
  458. */
  459. String getStringFunctions() throws SQLException;
  460. /**
  461. * This method returns a comma separated list of of system functions.
  462. *
  463. * @return A comma separated list of system functions.
  464. * @exception SQLException If an error occurs.
  465. */
  466. String getSystemFunctions() throws SQLException;
  467. /**
  468. * This method returns comma separated list of time/date functions.
  469. *
  470. * @return The list of time/date functions.
  471. * @exception SQLException If an error occurs.
  472. */
  473. String getTimeDateFunctions() throws SQLException;
  474. /**
  475. * This method returns the string used to escape wildcards in search strings.
  476. *
  477. * @return The string used to escape wildcards in search strings.
  478. * @exception SQLException If an error occurs.
  479. */
  480. String getSearchStringEscape() throws SQLException;
  481. /**
  482. * This methods returns non-standard characters that can appear in
  483. * unquoted identifiers.
  484. *
  485. * @return Non-standard characters that can appear in unquoted identifiers.
  486. * @exception SQLException If an error occurs.
  487. */
  488. String getExtraNameCharacters() throws SQLException;
  489. /**
  490. * This method tests whether or not the database supports
  491. * "ALTER TABLE ADD COLUMN"
  492. *
  493. * @return <code>true</code> if column add supported, <code>false</code>
  494. * otherwise.
  495. * @exception SQLException If an error occurs.
  496. */
  497. boolean supportsAlterTableWithAddColumn() throws SQLException;
  498. /**
  499. * This method tests whether or not the database supports
  500. * "ALTER TABLE DROP COLUMN"
  501. *
  502. * @return <code>true</code> if column drop supported, <code>false</code>
  503. * otherwise.
  504. * @exception SQLException If an error occurs.
  505. */
  506. boolean supportsAlterTableWithDropColumn() throws SQLException;
  507. /**
  508. * This method tests whether or not column aliasing is supported.
  509. *
  510. * @return <code>true</code> if column aliasing is supported,
  511. * <code>false</code> otherwise.
  512. * @exception SQLException If an error occurs.
  513. */
  514. boolean supportsColumnAliasing() throws SQLException;
  515. /**
  516. * This method tests whether the concatenation of a NULL and non-NULL
  517. * value results in a NULL. This will always be true in fully JDBC compliant
  518. * drivers.
  519. *
  520. * @return <code>true</code> if concatenating NULL and a non-NULL value
  521. * returns a NULL, <code>false</code> otherwise.
  522. * @exception SQLException If an error occurs.
  523. */
  524. boolean nullPlusNonNullIsNull() throws SQLException;
  525. /**
  526. * Tests whether or not CONVERT is supported.
  527. *
  528. * @return <code>true</code> if CONVERT is supported, <code>false</code>
  529. * otherwise.
  530. * @exception SQLException If an error occurs.
  531. */
  532. boolean supportsConvert() throws SQLException;
  533. /**
  534. * This method tests whether or not CONVERT can be performed between the
  535. * specified types. The types are contants from <code>Types</code>.
  536. *
  537. * @param fromType The SQL type to convert from.
  538. * @param toType The SQL type to convert to.
  539. * @return <code>true</code> if the conversion can be performed,
  540. * <code>false</code> otherwise.
  541. * @see Types
  542. */
  543. boolean supportsConvert(int fromType, int toType) throws
  544. SQLException;
  545. /**
  546. * This method tests whether or not table correlation names are
  547. * supported. This will be always be <code>true</code> in a fully JDBC
  548. * compliant driver.
  549. *
  550. * @return <code>true</code> if table correlation names are supported,
  551. * <code>false</code> otherwise.
  552. * @exception SQLException If an error occurs.
  553. */
  554. boolean supportsTableCorrelationNames() throws SQLException;
  555. /**
  556. * This method tests whether correlation names must be different from the
  557. * name of the table.
  558. *
  559. * @return <code>true</code> if the correlation name must be different from
  560. * the table name, <code>false</code> otherwise.
  561. * @exception SQLException If an error occurs.
  562. */
  563. boolean supportsDifferentTableCorrelationNames() throws SQLException;
  564. /**
  565. * This method tests whether or not expressions are allowed in an
  566. * ORDER BY lists.
  567. *
  568. * @return <code>true</code> if expressions are allowed in ORDER BY
  569. * lists, <code>false</code> otherwise.
  570. * @exception SQLException If an error occurs.
  571. */
  572. boolean supportsExpressionsInOrderBy() throws SQLException;
  573. /**
  574. * This method tests whether or ORDER BY on a non-selected column is
  575. * allowed.
  576. *
  577. * @return <code>true</code> if a non-selected column can be used in an
  578. * ORDER BY, <code>false</code> otherwise.
  579. * @exception SQLException If an error occurs.
  580. */
  581. boolean supportsOrderByUnrelated() throws SQLException;
  582. /**
  583. * This method tests whether or not GROUP BY is supported.
  584. *
  585. * @return <code>true</code> if GROUP BY is supported, <code>false</code>
  586. * otherwise.
  587. * @exception SQLException If an error occurs.
  588. */
  589. boolean supportsGroupBy() throws SQLException;
  590. /**
  591. * This method tests whether GROUP BY on a non-selected column is
  592. * allowed.
  593. *
  594. * @return <code>true</code> if a non-selected column can be used in a
  595. * GROUP BY, <code>false</code> otherwise.
  596. * @exception SQLException If an error occurs.
  597. */
  598. boolean supportsGroupByUnrelated() throws SQLException;
  599. /**
  600. * This method tests whether or not a GROUP BY can add columns not in the
  601. * select if it includes all the columns in the select.
  602. *
  603. * @return <code>true</code> if GROUP BY an add columns provided it includes
  604. * all columns in the select, <code>false</code> otherwise.
  605. * @exception SQLException If an error occurs.
  606. */
  607. boolean supportsGroupByBeyondSelect() throws SQLException;
  608. /**
  609. * This method tests whether or not the escape character is supported in
  610. * LIKE expressions. A fully JDBC compliant driver will always return
  611. * <code>true</code>.
  612. *
  613. * @return <code>true</code> if escapes are supported in LIKE expressions,
  614. * <code>false</code> otherwise.
  615. * @exception SQLException If an error occurs.
  616. */
  617. boolean supportsLikeEscapeClause() throws SQLException;
  618. /**
  619. * This method tests whether multiple result sets for a single statement are
  620. * supported.
  621. *
  622. * @return <code>true</code> if multiple result sets are supported for a
  623. * single statement, <code>false</code> otherwise.
  624. * @exception SQLException If an error occurs.
  625. */
  626. boolean supportsMultipleResultSets() throws SQLException;
  627. /**
  628. * This method test whether or not multiple transactions may be open
  629. * at once, as long as they are on different connections.
  630. *
  631. * @return <code>true</code> if multiple transactions on different
  632. * connections are supported, <code>false</code> otherwise.
  633. * @exception SQLException If an error occurs.
  634. */
  635. boolean supportsMultipleTransactions() throws SQLException;
  636. /**
  637. * This method tests whether or not columns can be defined as NOT NULL. A
  638. * fully JDBC compliant driver always returns <code>true</code>.
  639. *
  640. * @return <code>true</code> if NOT NULL columns are supported,
  641. * <code>false</code> otherwise.
  642. * @exception SQLException If an error occurs.
  643. */
  644. boolean supportsNonNullableColumns() throws SQLException;
  645. /**
  646. * This method tests whether or not the minimum grammer for ODBC is supported.
  647. * A fully JDBC compliant driver will always return <code>true</code>.
  648. *
  649. * @return <code>true</code> if the ODBC minimum grammar is supported,
  650. * <code>false</code> otherwise.
  651. * @exception SQLException If an error occurs.
  652. */
  653. boolean supportsMinimumSQLGrammar() throws SQLException;
  654. /**
  655. * This method tests whether or not the core grammer for ODBC is supported.
  656. *
  657. * @return <code>true</code> if the ODBC core grammar is supported,
  658. * <code>false</code> otherwise.
  659. * @exception SQLException If an error occurs.
  660. */
  661. boolean supportsCoreSQLGrammar() throws SQLException;
  662. /**
  663. * This method tests whether or not the extended grammer for ODBC is supported.
  664. *
  665. * @return <code>true</code> if the ODBC extended grammar is supported,
  666. * <code>false</code> otherwise.
  667. * @exception SQLException If an error occurs.
  668. */
  669. boolean supportsExtendedSQLGrammar() throws SQLException;
  670. /**
  671. * This method tests whether or not the ANSI92 entry level SQL
  672. * grammar is supported. A fully JDBC compliant drivers must return
  673. * <code>true</code>.
  674. *
  675. * @return <code>true</code> if the ANSI92 entry level SQL grammar is
  676. * supported, <code>false</code> otherwise.
  677. * @exception SQLException If an error occurs.
  678. */
  679. boolean supportsANSI92EntryLevelSQL() throws SQLException;
  680. /**
  681. * This method tests whether or not the ANSI92 intermediate SQL
  682. * grammar is supported.
  683. *
  684. * @return <code>true</code> if the ANSI92 intermediate SQL grammar is
  685. * supported, <code>false</code> otherwise.
  686. * @exception SQLException If an error occurs.
  687. */
  688. boolean supportsANSI92IntermediateSQL() throws SQLException;
  689. /**
  690. * This method tests whether or not the ANSI92 full SQL
  691. * grammar is supported.
  692. *
  693. * @return <code>true</code> if the ANSI92 full SQL grammar is
  694. * supported, <code>false</code> otherwise.
  695. * @exception SQLException If an error occurs.
  696. */
  697. boolean supportsANSI92FullSQL() throws SQLException;
  698. /**
  699. * This method tests whether or not the SQL integrity enhancement
  700. * facility is supported.
  701. *
  702. * @return <code>true</code> if the integrity enhancement facility is
  703. * supported, <code>false</code> otherwise.
  704. * @exception SQLException If an error occurs.
  705. */
  706. boolean supportsIntegrityEnhancementFacility() throws SQLException;
  707. /**
  708. * This method tests whether or not the database supports outer joins.
  709. *
  710. * @return <code>true</code> if outer joins are supported, <code>false</code>
  711. * otherwise.
  712. * @exception SQLException If an error occurs.
  713. */
  714. boolean supportsOuterJoins() throws SQLException;
  715. /**
  716. * This method tests whether or not the database supports full outer joins.
  717. *
  718. * @return <code>true</code> if full outer joins are supported,
  719. * <code>false</code> otherwise.
  720. * @exception SQLException If an error occurs.
  721. */
  722. boolean supportsFullOuterJoins() throws SQLException;
  723. /**
  724. * This method tests whether or not the database supports limited outer joins.
  725. *
  726. * @return <code>true</code> if limited outer joins are supported,
  727. * <code>false</code> otherwise.
  728. * @exception SQLException If an error occurs.
  729. */
  730. boolean supportsLimitedOuterJoins() throws SQLException;
  731. /**
  732. * This method returns the vendor's term for "schema".
  733. *
  734. * @return The vendor's term for schema.
  735. * @exception SQLException if an error occurs.
  736. */
  737. String getSchemaTerm() throws SQLException;
  738. /**
  739. * This method returns the vendor's term for "procedure".
  740. *
  741. * @return The vendor's term for procedure.
  742. * @exception SQLException if an error occurs.
  743. */
  744. String getProcedureTerm() throws SQLException;
  745. /**
  746. * This method returns the vendor's term for "catalog".
  747. *
  748. * @return The vendor's term for catalog.
  749. * @exception SQLException if an error occurs.
  750. */
  751. String getCatalogTerm() throws SQLException;
  752. /**
  753. * This method tests whether a catalog name appears at the beginning of
  754. * a fully qualified table name.
  755. *
  756. * @return <code>true</code> if the catalog name appears at the beginning,
  757. * <code>false</code> if it appears at the end.
  758. * @exception SQLException If an error occurs.
  759. */
  760. boolean isCatalogAtStart() throws SQLException;
  761. /**
  762. * This method returns the separator between the catalog name and the
  763. * table name.
  764. *
  765. * @return The separator between the catalog name and the table name.
  766. * @exception SQLException If an error occurs.
  767. */
  768. String getCatalogSeparator() throws SQLException;
  769. /**
  770. * This method tests whether a catalog name can appear in a data
  771. * manipulation statement.
  772. *
  773. * @return <code>true</code> if a catalog name can appear in a data
  774. * manipulation statement, <code>false</code> otherwise.
  775. * @exception SQLException If an error occurs.
  776. */
  777. boolean supportsSchemasInDataManipulation() throws SQLException;
  778. /**
  779. * This method tests whether a catalog name can appear in a procedure
  780. * call
  781. *
  782. * @return <code>true</code> if a catalog name can appear in a procedure
  783. * call, <code>false</code> otherwise.
  784. * @exception SQLException If an error occurs.
  785. */
  786. boolean supportsSchemasInProcedureCalls() throws SQLException;
  787. /**
  788. * This method tests whether a catalog name can appear in a table definition.
  789. *
  790. * @return <code>true</code> if a catalog name can appear in a table
  791. * definition, <code>false</code> otherwise.
  792. * @exception SQLException If an error occurs.
  793. */
  794. boolean supportsSchemasInTableDefinitions() throws SQLException;
  795. /**
  796. * This method tests whether a catalog name can appear in an index definition.
  797. *
  798. * @return <code>true</code> if a catalog name can appear in an index
  799. * definition, <code>false</code> otherwise.
  800. * @exception SQLException If an error occurs.
  801. */
  802. boolean supportsSchemasInIndexDefinitions() throws SQLException;
  803. /**
  804. * This method tests whether a catalog name can appear in privilege definitions.
  805. *
  806. * @return <code>true</code> if a catalog name can appear in privilege
  807. * definition, <code>false</code> otherwise.
  808. * @exception SQLException If an error occurs.
  809. */
  810. boolean supportsSchemasInPrivilegeDefinitions() throws SQLException;
  811. /**
  812. * This method tests whether a catalog name can appear in a data
  813. * manipulation statement.
  814. *
  815. * @return <code>true</code> if a catalog name can appear in a data
  816. * manipulation statement, <code>false</code> otherwise.
  817. * @exception SQLException If an error occurs.
  818. */
  819. boolean supportsCatalogsInDataManipulation() throws SQLException;
  820. /**
  821. * This method tests whether a catalog name can appear in a procedure
  822. * call
  823. *
  824. * @return <code>true</code> if a catalog name can appear in a procedure
  825. * call, <code>false</code> otherwise.
  826. * @exception SQLException If an error occurs.
  827. */
  828. boolean supportsCatalogsInProcedureCalls() throws SQLException;
  829. /**
  830. * This method tests whether a catalog name can appear in a table definition.
  831. *
  832. * @return <code>true</code> if a catalog name can appear in a table
  833. * definition, <code>false</code> otherwise.
  834. * @exception SQLException If an error occurs.
  835. */
  836. boolean supportsCatalogsInTableDefinitions() throws SQLException;
  837. /**
  838. * This method tests whether a catalog name can appear in an index definition.
  839. *
  840. * @return <code>true</code> if a catalog name can appear in an index
  841. * definition, <code>false</code> otherwise.
  842. * @exception SQLException If an error occurs.
  843. */
  844. boolean supportsCatalogsInIndexDefinitions() throws SQLException;
  845. /**
  846. * This method tests whether a catalog name can appear in privilege definitions.
  847. *
  848. * @return <code>true</code> if a catalog name can appear in privilege
  849. * definition, <code>false</code> otherwise.
  850. * @exception SQLException If an error occurs.
  851. */
  852. boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException;
  853. /**
  854. * This method tests whether or not that database supports positioned
  855. * deletes.
  856. *
  857. * @return <code>true</code> if positioned deletes are supported,
  858. * <code>false</code> otherwise.
  859. * @exception SQLException If an error occurs.
  860. */
  861. boolean supportsPositionedDelete() throws SQLException;
  862. /**
  863. * This method tests whether or not that database supports positioned
  864. * updates.
  865. *
  866. * @return <code>true</code> if positioned updates are supported,
  867. * <code>false</code> otherwise.
  868. * @exception SQLException If an error occurs.
  869. */
  870. boolean supportsPositionedUpdate() throws SQLException;
  871. /**
  872. * This method tests whether or not SELECT FOR UPDATE is supported by the
  873. * database.
  874. *
  875. * @return <code>true</code> if SELECT FOR UPDATE is supported
  876. * <code>false</code> otherwise.
  877. * @exception SQLException If an error occurs.
  878. */
  879. boolean supportsSelectForUpdate() throws SQLException;
  880. /**
  881. * This method tests whether or not stored procedures are supported on
  882. * this database.
  883. *
  884. * @return <code>true</code> if stored procedures are supported,
  885. * <code>false</code> otherwise.
  886. * @exception SQLException If an error occurs.
  887. */
  888. boolean supportsStoredProcedures() throws SQLException;
  889. /**
  890. * This method tests whether or not subqueries are allowed in comparisons.
  891. * A fully JDBC compliant driver will always return <code>true</code>.
  892. *
  893. * @return <code>true</code> if subqueries are allowed in comparisons,
  894. * <code>false</code> otherwise.
  895. * @exception SQLException If an error occurs.
  896. */
  897. boolean supportsSubqueriesInComparisons() throws SQLException;
  898. /**
  899. * This method tests whether or not subqueries are allowed in exists
  900. * expressions. A fully JDBC compliant driver will always return
  901. * <code>true</code>.
  902. *
  903. * @return <code>true</code> if subqueries are allowed in exists
  904. * expressions, <code>false</code> otherwise.
  905. * @exception SQLException If an error occurs.
  906. */
  907. boolean supportsSubqueriesInExists() throws SQLException;
  908. /**
  909. * This method tests whether subqueries are allowed in IN statements.
  910. * A fully JDBC compliant driver will always return <code>true</code>.
  911. *
  912. * @return <code>true</code> if the driver supports subqueries in IN
  913. * statements, <code>false</code> otherwise.
  914. * @exception SQLException If an error occurs.
  915. */
  916. boolean supportsSubqueriesInIns() throws SQLException;
  917. /**
  918. * This method tests whether or not subqueries are allowed in quantified
  919. * expressions. A fully JDBC compliant driver will always return
  920. * <code>true</code>.
  921. *
  922. * @return <code>true</code> if subqueries are allowed in quantified
  923. * expressions, <code>false</code> otherwise.
  924. * @exception SQLException If an error occurs.
  925. */
  926. boolean supportsSubqueriesInQuantifieds() throws SQLException;
  927. /**
  928. * This method test whether or not correlated subqueries are allowed. A
  929. * fully JDBC compliant driver will always return <code>true</code>.
  930. *
  931. * @return <code>true</code> if correlated subqueries are allowed,
  932. * <code>false</code> otherwise.
  933. * @exception SQLException If an error occurs.
  934. */
  935. boolean supportsCorrelatedSubqueries() throws SQLException;
  936. /**
  937. * This method tests whether or not the UNION statement is supported.
  938. *
  939. * @return <code>true</code> if UNION is supported, <code>false</code>
  940. * otherwise.
  941. * @exception SQLException If an error occurs.
  942. */
  943. boolean supportsUnion() throws SQLException;
  944. /**
  945. * This method tests whether or not the UNION ALL statement is supported.
  946. *
  947. * @return <code>true</code> if UNION ALL is supported, <code>false</code>
  948. * otherwise.
  949. * @exception SQLException If an error occurs.
  950. */
  951. boolean supportsUnionAll() throws SQLException;
  952. /**
  953. * This method tests whether or not the database supports cursors
  954. * remaining open across commits.
  955. *
  956. * @return <code>true</code> if cursors can remain open across commits,
  957. * <code>false</code> otherwise.
  958. * @exception SQLException If an error occurs.
  959. */
  960. boolean supportsOpenCursorsAcrossCommit() throws SQLException;
  961. /**
  962. * This method tests whether or not the database supports cursors
  963. * remaining open across rollbacks.
  964. *
  965. * @return <code>true</code> if cursors can remain open across rollbacks,
  966. * <code>false</code> otherwise.
  967. * @exception SQLException If an error occurs.
  968. */
  969. boolean supportsOpenCursorsAcrossRollback() throws SQLException;
  970. /**
  971. * This method tests whether or not the database supports statements
  972. * remaining open across commits.
  973. *
  974. * @return <code>true</code> if statements can remain open across commits,
  975. * <code>false</code> otherwise.
  976. * @exception SQLException If an error occurs.
  977. */
  978. boolean supportsOpenStatementsAcrossCommit() throws SQLException;
  979. /**
  980. * This method tests whether or not the database supports statements
  981. * remaining open across rollbacks.
  982. *
  983. * @return <code>true</code> if statements can remain open across rollbacks,
  984. * <code>false</code> otherwise.
  985. * @exception SQLException If an error occurs.
  986. */
  987. boolean supportsOpenStatementsAcrossRollback() throws SQLException;
  988. /**
  989. * This method returns the number of hex characters allowed in an inline
  990. * binary literal.
  991. *
  992. * @return The number of hex characters allowed in a binary literal, 0 meaning
  993. * either an unknown or unlimited number.
  994. * @exception SQLException If an error occurs.
  995. */
  996. int getMaxBinaryLiteralLength() throws SQLException;
  997. /**
  998. * This method returns the maximum length of a character literal.
  999. *
  1000. * @return The maximum length of a character literal.
  1001. * @exception SQLException If an error occurs.
  1002. */
  1003. int getMaxCharLiteralLength() throws SQLException;
  1004. /**
  1005. * This method returns the maximum length of a column name.
  1006. *
  1007. * @return The maximum length of a column name.
  1008. * @exception SQLException If an error occurs.
  1009. */
  1010. int getMaxColumnNameLength() throws SQLException;
  1011. /**
  1012. * This method returns the maximum number of columns in a GROUP BY statement.
  1013. *
  1014. * @return The maximum number of columns in a GROUP BY statement.
  1015. * @exception SQLException If an error occurs.
  1016. */
  1017. int getMaxColumnsInGroupBy() throws SQLException;
  1018. /**
  1019. * This method returns the maximum number of columns in an index.
  1020. *
  1021. * @return The maximum number of columns in an index.
  1022. * @exception SQLException If an error occurs.
  1023. */
  1024. int getMaxColumnsInIndex() throws SQLException;
  1025. /**
  1026. * This method returns the maximum number of columns in an ORDER BY statement.
  1027. *
  1028. * @return The maximum number of columns in an ORDER BY statement.
  1029. * @exception SQLException If an error occurs.
  1030. */
  1031. int getMaxColumnsInOrderBy() throws SQLException;
  1032. /**
  1033. * This method returns the maximum number of columns in a SELECT statement.
  1034. *
  1035. * @return The maximum number of columns in a SELECT statement.
  1036. * @exception SQLException If an error occurs.
  1037. */
  1038. int getMaxColumnsInSelect() throws SQLException;
  1039. /**
  1040. * This method returns the maximum number of columns in a table.
  1041. *
  1042. * @return The maximum number of columns in a table.
  1043. * @exception SQLException If an error occurs.
  1044. */
  1045. int getMaxColumnsInTable() throws SQLException;
  1046. /**
  1047. * This method returns the maximum number of connections this client
  1048. * can have to the database.
  1049. *
  1050. * @return The maximum number of database connections.
  1051. * @SQLException If an error occurs.
  1052. */
  1053. int getMaxConnections() throws SQLException;
  1054. /**
  1055. * This method returns the maximum length of a cursor name.
  1056. *
  1057. * @return The maximum length of a cursor name.
  1058. * @exception SQLException If an error occurs.
  1059. */
  1060. int getMaxCursorNameLength() throws SQLException;
  1061. /**
  1062. * This method returns the maximum length of an index.
  1063. *
  1064. * @return The maximum length of an index.
  1065. * @exception SQLException If an error occurs.
  1066. */
  1067. int getMaxIndexLength() throws SQLException;
  1068. /**
  1069. * This method returns the maximum length of a schema name.
  1070. *
  1071. * @return The maximum length of a schema name.
  1072. * @exception SQLException If an error occurs.
  1073. */
  1074. int getMaxSchemaNameLength() throws SQLException;
  1075. /**
  1076. * This method returns the maximum length of a procedure name.
  1077. *
  1078. * @return The maximum length of a procedure name.
  1079. * @exception SQLException If an error occurs.
  1080. */
  1081. int getMaxProcedureNameLength() throws SQLException;
  1082. /**
  1083. * This method returns the maximum length of a catalog name.
  1084. *
  1085. * @return The maximum length of a catalog name.
  1086. * @exception SQLException If an error occurs.
  1087. */
  1088. int getMaxCatalogNameLength() throws SQLException;
  1089. /**
  1090. * This method returns the maximum size of a row in bytes.
  1091. *
  1092. * @return The maximum size of a row.
  1093. * @exception SQLException If an error occurs.
  1094. */
  1095. int getMaxRowSize() throws SQLException;
  1096. /**
  1097. * This method tests whether or not the maximum row size includes BLOB's
  1098. *
  1099. * @return <code>true</code> if the maximum row size includes BLOB's,
  1100. * <code>false</code> otherwise.
  1101. * @exception SQLException If an error occurs.
  1102. */
  1103. boolean doesMaxRowSizeIncludeBlobs() throws SQLException;
  1104. /**
  1105. * This method includes the maximum length of a SQL statement.
  1106. *
  1107. * @return The maximum length of a SQL statement.
  1108. * @exception SQLException If an error occurs.
  1109. */
  1110. int getMaxStatementLength() throws SQLException;
  1111. /**
  1112. * This method returns the maximum number of statements that can be
  1113. * active at any time.
  1114. *
  1115. * @return The maximum number of statements that can be active at any time.
  1116. * @exception SQLException If an error occurs.
  1117. */
  1118. int getMaxStatements() throws SQLException;
  1119. /**
  1120. * This method returns the maximum length of a table name.
  1121. *
  1122. * @return The maximum length of a table name.
  1123. * @exception SQLException If an error occurs.
  1124. */
  1125. int getMaxTableNameLength() throws SQLException;
  1126. /**
  1127. * This method returns the maximum number of tables that may be referenced
  1128. * in a SELECT statement.
  1129. *
  1130. * @return The maximum number of tables allowed in a SELECT statement.
  1131. * @exception SQLException If an error occurs.
  1132. */
  1133. int getMaxTablesInSelect() throws SQLException;
  1134. /**
  1135. * This method returns the maximum length of a user name.
  1136. *
  1137. * @return The maximum length of a user name.
  1138. * @exception SQLException If an error occurs.
  1139. */
  1140. int getMaxUserNameLength() throws SQLException;
  1141. /**
  1142. * This method returns the default transaction isolation level of the
  1143. * database.
  1144. *
  1145. * @return The default transaction isolation level of the database.
  1146. * @exception SQLException If an error occurs.
  1147. * @see Connection
  1148. */
  1149. int getDefaultTransactionIsolation() throws SQLException;
  1150. /**
  1151. * This method tests whether or not the database supports transactions.
  1152. *
  1153. * @return <code>true</code> if the database supports transactions,
  1154. * <code>false</code> otherwise.
  1155. * @exception SQLException If an error occurs.
  1156. */
  1157. boolean supportsTransactions() throws SQLException;
  1158. /**
  1159. * This method tests whether or not the database supports the specified
  1160. * transaction isolation level.
  1161. *
  1162. * @param level The transaction isolation level.
  1163. *
  1164. * @return <code>true</code> if the specified transaction isolation level
  1165. * is supported, <code>false</code> otherwise.
  1166. * @exception SQLException If an error occurs.
  1167. */
  1168. boolean supportsTransactionIsolationLevel(int level) throws
  1169. SQLException;
  1170. /**
  1171. * This method tests whether or not DDL and DML statements allowed within
  1172. * the same transaction.
  1173. *
  1174. * @return <code>true</code> if DDL and DML statements are allowed in the
  1175. * same transaction, <code>false</code> otherwise.
  1176. * @exception SQLException If an error occurs.
  1177. */
  1178. boolean supportsDataDefinitionAndDataManipulationTransactions()
  1179. throws SQLException;
  1180. /**
  1181. * This method tests whether or not only DML statement are allowed
  1182. * inside a transaction.
  1183. *
  1184. * @return <code>true</code> if only DML statements are allowed in
  1185. * transactions, <code>false</code> otherwise.
  1186. * @exception SQLException If an error occurs.
  1187. */
  1188. boolean supportsDataManipulationTransactionsOnly() throws
  1189. SQLException;
  1190. /**
  1191. * This method tests whether or not a DDL statement will cause the
  1192. * current transaction to be automatically committed.
  1193. *
  1194. * @return <code>true</code> if DDL causes an immediate transaction commit,
  1195. * <code>false</code> otherwise.
  1196. * @exception SQLException If an error occurs.
  1197. */
  1198. boolean dataDefinitionCausesTransactionCommit() throws SQLException;
  1199. /**
  1200. * This method tests whether or not DDL statements are ignored in
  1201. * transactions.
  1202. *
  1203. * @return <code>true</code> if DDL statements are ignored in transactions,
  1204. * <code>false</code> otherwise.
  1205. * @exception SQLException If an error occurs.
  1206. */
  1207. boolean dataDefinitionIgnoredInTransactions() throws SQLException;
  1208. /**
  1209. * This method returns a list of all the stored procedures matching the
  1210. * specified pattern in the given schema and catalog. This is returned
  1211. * a <code>ResultSet</code> with the following columns:
  1212. * <p>
  1213. * <ol>
  1214. * <li>PROCEDURE_CAT - The catalog the procedure is in, which may be
  1215. * <code>null</code>.</li>
  1216. * <li>PROCEDURE_SCHEM - The schema the procedures is in, which may be
  1217. * <code>null</code>.</li>
  1218. * <li>PROCEDURE_NAME - The name of the procedure.</li>
  1219. * <li>Unused</li>
  1220. * <li>Unused</li>
  1221. * <li>Unused</li>
  1222. * <li>REMARKS - A description of the procedure</li>
  1223. * <li>PROCEDURE_TYPE - Indicates the return type of the procedure, which
  1224. * is one of the contstants defined in this class
  1225. * (<code>procedureResultUnknown</code>, <code>procedureNoResult</code>, or
  1226. * <code>procedureReturnsResult</code>).</li>
  1227. * </ol>
  1228. *
  1229. * @param catalog The name of the catalog to return stored procedured from,
  1230. * or "" to return procedures from all catalogs.
  1231. * @param schemaPattern A schema pattern for the schemas to return stored
  1232. * procedures from, or "" to return procedures from all schemas.
  1233. * @param procedurePattern The pattern of procedure names to return.
  1234. * @returns A <code>ResultSet</code> with all the requested procedures.
  1235. * @exception SQLException If an error occurs.
  1236. */
  1237. ResultSet getProcedures(String catalog, String schemaPattern, String
  1238. procedurePattern) throws SQLException;
  1239. /**
  1240. * This method returns a list of the parameter and result columns for
  1241. * the requested stored procedures. This is returned in the form of a
  1242. * <code>ResultSet</code> with the following columns:
  1243. * <p>
  1244. * <ol>
  1245. * <li>PROCEDURE_CAT - The catalog the procedure is in, which may be
  1246. * <code>null</code>.</li>
  1247. * <li>PROCEDURE_SCHEM - The schema the procedures is in, which may be
  1248. * <code>null</code>.</li>
  1249. * <li>PROCEDURE_NAME - The name of the procedure.</li>
  1250. * <li>COLUMN_NAME - The name of the column</li>
  1251. * <li>COLUMN_TYPE - The type of the column, which will be one of the
  1252. * contants defined in this class (<code>procedureColumnUnknown</code>,
  1253. * <code>procedureColumnIn</code>, <code>procedureColumnInOut</code>,
  1254. * <code>procedureColumnOut</code>, <code>procedureColumnReturn</code>,
  1255. * or <code>procedureColumnResult</code>).</li>
  1256. * <li>DATA_TYPE - The SQL type of the column. This is one of the constants
  1257. * defined in <code>Types</code>.</li>
  1258. * <li>TYPE_NAME - The string name of the data type for this column.</li>
  1259. * <li>PRECISION - The precision of the column.</li>
  1260. * <li>LENGTH - The length of the column in bytes</li>
  1261. * <li>SCALE - The scale of the column.</li>
  1262. * <li>RADIX - The radix of the column.</li>
  1263. * <li>NULLABLE - Whether or not the column is NULLABLE. This is one of
  1264. * the constants defined in this class (<code>procedureNoNulls</code>,
  1265. * <code>procedureNullable</code>, or <code>procedureNullableUnknown</code>)</li>
  1266. * <li>REMARKS - A description of the column.</li>
  1267. * </ol>
  1268. *
  1269. * @param catalog The name of the catalog to return stored procedured from,
  1270. * or "" to return procedures from all catalogs.
  1271. * @param schemaPattern A schema pattern for the schemas to return stored
  1272. * procedures from, or "" to return procedures from all schemas.
  1273. * @param procedurePattern The pattern of procedures names to return.
  1274. * @param columnPattern The pattern of column names to return.
  1275. * @returns A <code>ResultSet</code> with all the requested procedures.
  1276. * @exception SQLException If an error occurs.
  1277. */
  1278. ResultSet getProcedureColumns(String catalog, String schemaPattern,
  1279. String procedurePattern, String columnPattern) throws
  1280. SQLException;
  1281. /**
  1282. * This method returns a list of the requested table as a
  1283. * <code>ResultSet</code> with the following columns:
  1284. *
  1285. * <ol>
  1286. * <li>TABLE_CAT - The catalog the table is in, which may be <code>null</code>.</li>
  1287. * <li>TABLE_SCHEM - The schema the table is in, which may be <code>null</code>.</li>
  1288. * <li>TABLE_NAME - The name of the table.</li>
  1289. * <li>TABLE_TYPE - A string describing the table type. This will be one
  1290. * of the values returned by the <code>getTableTypes()</code> method.</li>
  1291. * <li>REMARKS - Comments about the table.</li>
  1292. * </ol>
  1293. *
  1294. * @param catalog The name of the catalog to return tables from,
  1295. * or "" to return tables from all catalogs.
  1296. * @param schemaPattern A schema pattern for the schemas to return tables
  1297. * from, or "" to return tables from all schemas.
  1298. * @param tablePattern The pattern of table names to return.
  1299. * @param types The list of table types to include; null returns all types.
  1300. * @returns A <code>ResultSet</code> with all the requested tables.
  1301. * @exception SQLException If an error occurs.
  1302. */
  1303. ResultSet getTables(String catalog, String schemaPattern, String
  1304. tablePattern, String[] types) throws SQLException;
  1305. /**
  1306. * This method returns the list of database schemas as a
  1307. * <code>ResultSet</code>, with one column - TABLE_SCHEM - that is the
  1308. * name of the schema.
  1309. *
  1310. * @return A <code>ResultSet</code> with all the requested schemas.
  1311. * @exception SQLException If an error occurs.
  1312. */
  1313. ResultSet getSchemas() throws SQLException;
  1314. /**
  1315. * This method returns the list of database catalogs as a
  1316. * <code>ResultSet</code> with one column - TABLE_CAT - that is the
  1317. * name of the catalog.
  1318. *
  1319. * @return A <code>ResultSet</code> with all the requested catalogs.
  1320. * @exception SQLException If an error occurs.
  1321. */
  1322. ResultSet getCatalogs() throws SQLException;
  1323. /**
  1324. * This method returns the list of database table types as a
  1325. * <code>ResultSet</code> with one column - TABLE_TYPE - that is the
  1326. * name of the table type.
  1327. *
  1328. * @return A <code>ResultSet</code> with all the requested table types.
  1329. * @exception SQLException If an error occurs.
  1330. */
  1331. ResultSet getTableTypes() throws SQLException;
  1332. /**
  1333. * This method returns a list of the tables columns for
  1334. * the requested tables. This is returned in the form of a
  1335. * <code>ResultSet</code> with the following columns:
  1336. * <p>
  1337. * <ol>
  1338. * <li>TABLE_CAT - The catalog the table is in, which may be
  1339. * <code>null</code>.</li>
  1340. * <li>TABLE_SCHEM - The schema the tables is in, which may be
  1341. * <code>null</code>.</li>
  1342. * <li>TABLE_NAME - The name of the table.</li>
  1343. * <li>COLUMN_NAME - The name of the column</li>
  1344. * <li>DATA_TYPE - The SQL type of the column. This is one of the constants
  1345. * defined in <code>Types</code>.</li>
  1346. * <li>TYPE_NAME - The string name of the data type for this column.</li>
  1347. * <li>COLUMN_SIZE - The size of the column.</li>
  1348. * <li>Unused</li>
  1349. * <li>NUM_PREC_RADIX - The radix of the column.</li>
  1350. * <li>NULLABLE - Whether or not the column is NULLABLE. This is one of
  1351. * the constants defined in this class (<code>tableNoNulls</code>,
  1352. * <code>tableNullable</code>, or <code>tableNullableUnknown</code>)</li>
  1353. * <li>REMARKS - A description of the column.</li>
  1354. * <li>COLUMN_DEF - The default value for the column, may be <code>null</code>.</li>
  1355. * <li>SQL_DATA_TYPE - Unused</li>
  1356. * <li>SQL_DATETIME_SUB - Unused</li>
  1357. * <li>CHAR_OCTET_LENGTH - For character columns, the maximum number of bytes
  1358. * in the column.</li>
  1359. * <li>ORDINAL_POSITION - The index of the column in the table.</li>
  1360. * <li>IS_NULLABLE - "NO" means no, "YES" means maybe, and an empty string
  1361. * means unknown.</li>
  1362. * </ol>
  1363. *
  1364. * @param catalog The name of the catalog to return table from,
  1365. * or "" to return tables from all catalogs.
  1366. * @param schemaPattern A schema pattern for the schemas to return
  1367. * tables from, or "" to return tables from all schemas.
  1368. * @param tablePattern The pattern of table names to return.
  1369. * @param columnPattern The pattern of column names to return.
  1370. * @returns A <code>ResultSet</code> with all the requested tables.
  1371. * @exception SQLException If an error occurs.
  1372. */
  1373. ResultSet getColumns(String catalog, String schemaPattern, String
  1374. tablePattern, String columnPattern) throws SQLException;
  1375. /**
  1376. * This method returns the access rights that have been granted to the
  1377. * requested columns. This information is returned as a <code>ResultSet</code>
  1378. * with the following columns:
  1379. *
  1380. * <ol>
  1381. * <li>TABLE_CAT - The catalog the table is in, which may be
  1382. * <code>null</code>.</li>
  1383. * <li>TABLE_SCHEM - The schema the tables is in, which may be
  1384. * <code>null</code>.</li>
  1385. * <li>TABLE_NAME - The name of the table.</li>
  1386. * <li>COLUMN_NAME - The name of the column.</li>
  1387. * <li>GRANTOR - The entity that granted the access.</li>
  1388. * <li>GRANTEE - The entity granted the access.</li>
  1389. * <li>PRIVILEGE - The name of the privilege granted.</li>
  1390. * <li>IS_GRANTABLE - "YES" if the grantee can grant the privilege to
  1391. * others, "NO" if not, and <code>null</code> if unknown.</li>
  1392. * </ol>
  1393. *
  1394. * @param catalog The catalog to retrieve information from, or the empty string
  1395. * to return entities not associated with a catalog, or <code>null</code>
  1396. * to return information from all catalogs.
  1397. * @param schema The schema to retrieve information from, or the empty string
  1398. * to return entities not associated with a schema.
  1399. * @param tableName The table name to return information for.
  1400. * @param columnPattern A pattern of column names to return information for.
  1401. * @return A <code>ResultSet</code> with all the requested privileges.
  1402. * @exception SQLException If an error occurs.
  1403. */
  1404. ResultSet getColumnPrivileges(String catalog, String schema, String
  1405. tableName, String columnPattern) throws SQLException;
  1406. /**
  1407. * This method returns the access rights that have been granted to the
  1408. * requested tables. This information is returned as a <code>ResultSet</code>
  1409. * with the following columns:
  1410. *
  1411. * <ol>
  1412. * <li>TABLE_CAT - The catalog the table is in, which may be
  1413. * <code>null</code>.</li>
  1414. * <li>TABLE_SCHEM - The schema the tables is in, which may be
  1415. * <code>null</code>.</li>
  1416. * <li>TABLE_NAME - The name of the table.</li>
  1417. * <li>GRANTOR - The entity that granted the access.</li>
  1418. * <li>GRANTEE - The entity granted the access.</li>
  1419. * <li>PRIVILEGE - The name of the privilege granted.</li>
  1420. * <li>IS_GRANTABLE - "YES" if the grantee can grant the privilege to
  1421. * others, "NO" if not, and <code>null</code> if unknown.</li>
  1422. * </ol>
  1423. *
  1424. * @param catalog The catalog to retrieve information from, or the empty string
  1425. * to return entities not associated with a catalog, or <code>null</code>
  1426. * to return information from all catalogs.
  1427. * @param schemaPattern The schema to retrieve information from, or the empty string
  1428. * to return entities not associated with a schema.
  1429. * @param tablePattern The table name pattern of tables to return
  1430. * information for.
  1431. * @return A <code>ResultSet</code> with all the requested privileges.
  1432. * @exception SQLException If an error occurs.
  1433. */
  1434. ResultSet getTablePrivileges(String catalog, String schemaPattern,
  1435. String tablePattern) throws SQLException;
  1436. /**
  1437. * This method returns the best set of columns for uniquely identifying
  1438. * a row. It returns this information as a <code>ResultSet</code> with
  1439. * the following columns:
  1440. *
  1441. * <ol>
  1442. * <li>SCOPE - The scope of the results returned. This is one of the
  1443. * constants defined in this class (<code>bestRowTemporary</code>,
  1444. * <code>bestRowTransaction</code>, or <code>bestRowSession</code>).</li>
  1445. * <li>COLUMN_NAME - The name of the column.</li>
  1446. * <li>DATA_TYPE - The SQL type of the column. This is one of the constants
  1447. * defined in <code>Types</code>.</li>
  1448. * <li>TYPE_NAME - The string name of the data type for this column.</li>
  1449. * <li>COLUMN_SIZE - The precision of the columns</li>
  1450. * <li>BUFFER_LENGTH - Unused</li>
  1451. * <li>DECIMAL_DIGITS - The scale of the column.</li>
  1452. * <li>PSEUDO_COLUMN - Whether or not the best row identifier is a
  1453. * pseudo_column. This is one of the constants defined in this class
  1454. * (<code>bestRowUnknown</code>, <code>bestRowNotPseudo</code>, or
  1455. * <code>bestRowPseudo</code>).</li>
  1456. * </ol>
  1457. *
  1458. * @param catalog The catalog to retrieve information from, or the empty string
  1459. * to return entities not associated with a catalog, or <code>null</code>
  1460. * to return information from all catalogs.
  1461. * @param schema The schema to retrieve information from, or the empty string
  1462. * to return entities not associated with a schema.
  1463. * @param tableName The table name to return information for.
  1464. * @param scope One of the best row id scope constants from this class.
  1465. * @param nullable <code>true</code> to include columns that are nullable,
  1466. * <code>false</code> otherwise.
  1467. * @return A <code>ResultSet</code> with the best row identifier.
  1468. * @exception SQLException If an error occurs.
  1469. */
  1470. ResultSet getBestRowIdentifier(String catalog, String schema,
  1471. String tableName, int scope, boolean nullable) throws SQLException;
  1472. /**
  1473. * This method returns the set of columns that are automatically updated
  1474. * when the row is update. It returns this information as a
  1475. * <code>ResultSet</code> with the following columns:
  1476. *
  1477. * <ol>
  1478. * <li>SCOPE - Unused</li>
  1479. * <li>COLUMN_NAME - The name of the column.</li>
  1480. * <li>DATA_TYPE - The SQL type of the column. This is one of the constants
  1481. * defined in <code>Types</code>.</li>
  1482. * <li>TYPE_NAME - The string name of the data type for this column.</li>
  1483. * <li>COLUMN_SIZE - The precision of the columns</li>
  1484. * <li>BUFFER_LENGTH - Unused</li>
  1485. * <li>DECIMAL_DIGITS - The scale of the column.</li>
  1486. * <li>PSEUDO_COLUMN - Whether or not the best row identifier is a
  1487. * pseudo_column. This is one of the constants defined in this class
  1488. * (<code>versionRowUnknown</code>, <code>versionRowNotPseudo</code>, or
  1489. * <code>versionRowPseudo</code>).</li>
  1490. * </ol>
  1491. *
  1492. * @param catalog The catalog to retrieve information from, or the empty string
  1493. * to return entities not associated with a catalog, or <code>null</code>
  1494. * to return information from all catalogs.
  1495. * @param schema The schema to retrieve information from, or the empty string
  1496. * to return entities not associated with a schema.
  1497. * @param tableName The table name to return information for
  1498. * @return A <code>ResultSet</code> with the version columns.
  1499. * @exception SQLException If an error occurs.
  1500. */
  1501. ResultSet getVersionColumns(String catalog, String schema,
  1502. String tableName) throws SQLException;
  1503. /**
  1504. * This method returns a list of a table's primary key columns. These
  1505. * are returned as a <code>ResultSet</code> with the following columns.
  1506. *
  1507. * <ol>
  1508. * <li>TABLE_CAT - The catalog of the table, which may be <code>null</code>.</li>
  1509. * <li>TABLE_SCHEM - The schema of the table, which may be <code>null</code>.</li>
  1510. * <li>TABLE_NAME - The name of the table.</li>
  1511. * <li>COLUMN_NAME - The name of the column.</li>
  1512. * <li>KEY_SEQ - The sequence number of the column within the primary key.</li>
  1513. * <li>PK_NAME - The name of the primary key, which may be <code>null</code>.</li>
  1514. * </ol>
  1515. *
  1516. * @param catalog The catalog to retrieve information from, or the empty string
  1517. * to return entities not associated with a catalog, or <code>null</code>
  1518. * to return information from all catalogs.
  1519. * @param schema The schema to retrieve information from, or the empty string
  1520. * to return entities not associated with a schema.
  1521. * @param tableName The table name to return information for.
  1522. * @return A <code>ResultSet</code> with the primary key columns.
  1523. * @exception SQLException If an error occurs.
  1524. */
  1525. ResultSet getPrimaryKeys(String catalog, String schema, String tableName)
  1526. throws SQLException;
  1527. /**
  1528. * This method returns a list of the table's foreign keys. These are
  1529. * returned as a <code>ResultSet</code> with the following columns:
  1530. *
  1531. * <ol>
  1532. * <li>PKTABLE_CAT - The catalog of the table the key was imported from.</li>
  1533. * <li>PKTABLE_SCHEM - The schema of the table the key was imported from.</li>
  1534. * <li>PKTABLE_NAME - The name of the table the key was imported from.</li>
  1535. * <li>PKCOLUMN_NAME - The name of the column that was imported.</li>
  1536. * <li>FKTABLE_CAT - The foreign key catalog name.</li>
  1537. * <li>FKTABLE_SCHEM - The foreign key schema name.</li>
  1538. * <li>FKTABLE_NAME - The foreign key table name.</li>
  1539. * <li>FKCOLUMN_NAME - The foreign key column name.</li>
  1540. * <li>KEY_SEQ - The sequence number of the column within the foreign key.</li>
  1541. * <li>UPDATE_RULE - How the foreign key behaves when the primary key is
  1542. * updated. This is one of the constants defined in this class
  1543. * (<code>importedNoAction</code>, <code>importedKeyCascade</code>,
  1544. * <code>importedKeySetNull</code>, <code>importedKeySetDefault</code>, or
  1545. * <code>importedKeyRestrict</code>).</li>
  1546. * <li>DELETE_RULE - How the foreign key behaves when the primary key is
  1547. * deleted. This is one of the constants defined in this class
  1548. * (<code>importedNoAction</code>, <code>importedKeyCascade</code>,
  1549. * <code>importedKeySetNull</code>, or <code>importedKeySetDefault</code>)</li>
  1550. * <li>FK_NAME - The name of the foreign key.</li>
  1551. * <li>PK_NAME - The name of the primary key.</li>
  1552. * <li>DEFERRABILITY - The deferrability value. This is one of the
  1553. * constants defined in this table (<code>importedKeyInitiallyDeferred</code>,
  1554. * <code>importedKeyInitiallyImmediate</code>, or
  1555. * <code>importedKeyNotDeferrable</code>).</li>
  1556. * </ol>
  1557. *
  1558. * @param catalog The catalog to retrieve information from, or the empty string
  1559. * to return entities not associated with a catalog, or <code>null</code>
  1560. * to return information from all catalogs.
  1561. * @param schema The schema to retrieve information from, or the empty string
  1562. * to return entities not associated with a schema.
  1563. * @param tableName The table name to return information for.
  1564. * @return A <code>ResultSet</code> with the foreign key columns.
  1565. * @exception SQLException If an error occurs.
  1566. */
  1567. ResultSet getImportedKeys(String catalog, String schema,
  1568. String tableName) throws SQLException;
  1569. /**
  1570. * This method returns a list of the table's which use this table's
  1571. * primary key as a foreign key. The information is
  1572. * returned as a <code>ResultSet</code> with the following columns:
  1573. *
  1574. * <ol>
  1575. * <li>PKTABLE_CAT - The catalog of the table the key was imported from.</li>
  1576. * <li>PKTABLE_SCHEM - The schema of the table the key was imported from.</li>
  1577. * <li>PKTABLE_NAME - The name of the table the key was imported from.</li>
  1578. * <li>PKCOLUMN_NAME - The name of the column that was imported.</li>
  1579. * <li>FKTABLE_CAT - The foreign key catalog name.</li>
  1580. * <li>FKTABLE_SCHEM - The foreign key schema name.</li>
  1581. * <li>FKTABLE_NAME - The foreign key table name.</li>
  1582. * <li>FKCOLUMN_NAME - The foreign key column name.</li>
  1583. * <li>KEY_SEQ - The sequence number of the column within the foreign key.</li>
  1584. * <li>UPDATE_RULE - How the foreign key behaves when the primary key is
  1585. * updated. This is one of the constants defined in this class
  1586. * (<code>importedNoAction</code>, <code>importedKeyCascade</code>,
  1587. * <code>importedKeySetNull</code>, <code>importedKeySetDefault</code>, or
  1588. * <code>importedKeyRestrict</code>).</li>
  1589. * <li>DELETE_RULE - How the foreign key behaves when the primary key is
  1590. * deleted. This is one of the constants defined in this class
  1591. * (<code>importedNoAction</code>, <code>importedKeyCascade</code>,
  1592. * <code>importedKeySetNull</code>, or <code>importedKeySetDefault</code>)</li>
  1593. * <li>FK_NAME - The name of the foreign key.</li>
  1594. * <li>PK_NAME - The name of the primary key.</li>
  1595. * <li>DEFERRABILITY - The deferrability value. This is one of the
  1596. * constants defined in this table (<code>importedKeyInitiallyDeferred</code>,
  1597. * <code>importedKeyInitiallyImmediate</code>, or
  1598. * <code>importedKeyNotDeferrable</code>).</li>
  1599. * </ol>
  1600. *
  1601. * @param catalog The catalog to retrieve information from, or the empty string
  1602. * to return entities not associated with a catalog, or <code>null</code>
  1603. * to return information from all catalogs.
  1604. * @param schema The schema to retrieve information from, or the empty string
  1605. * to return entities not associated with a schema.
  1606. * @param tableName The table name to return information for.
  1607. * @return A <code>ResultSet</code> with the requested information
  1608. * @exception SQLException If an error occurs.
  1609. */
  1610. ResultSet getExportedKeys(String catalog, String schema,
  1611. String tableName) throws SQLException;
  1612. /**
  1613. * This method returns a description of how one table imports another
  1614. * table's primary key as a foreign key. The information is
  1615. * returned as a <code>ResultSet</code> with the following columns:
  1616. *
  1617. * <ol>
  1618. * <li>PKTABLE_CAT - The catalog of the table the key was imported from.</li>
  1619. * <li>PKTABLE_SCHEM - The schema of the table the key was imported from.</li>
  1620. * <li>PKTABLE_NAME - The name of the table the key was imported from.</li>
  1621. * <li>PKCOLUMN_NAME - The name of the column that was imported.</li>
  1622. * <li>FKTABLE_CAT - The foreign key catalog name.</li>
  1623. * <li>FKTABLE_SCHEM - The foreign key schema name.</li>
  1624. * <li>FKTABLE_NAME - The foreign key table name.</li>
  1625. * <li>FKCOLUMN_NAME - The foreign key column name.</li>
  1626. * <li>KEY_SEQ - The sequence number of the column within the foreign key.</li>
  1627. * <li>UPDATE_RULE - How the foreign key behaves when the primary key is
  1628. * updated. This is one of the constants defined in this class
  1629. * (<code>importedNoAction</code>, <code>importedKeyCascade</code>,
  1630. * <code>importedKeySetNull</code>, <code>importedKeySetDefault</code>, or
  1631. * <code>importedKeyRestrict</code>).</li>
  1632. * <li>DELETE_RULE - How the foreign key behaves when the primary key is
  1633. * deleted. This is one of the constants defined in this class
  1634. * (<code>importedNoAction</code>, <code>importedKeyCascade</code>,
  1635. * <code>importedKeySetNull</code>, or <code>importedKeySetDefault</code>)</li>
  1636. * <li>FK_NAME - The name of the foreign key.</li>
  1637. * <li>PK_NAME - The name of the primary key.</li>
  1638. * <li>DEFERRABILITY - The deferrability value. This is one of the
  1639. * constants defined in this table (<code>importedKeyInitiallyDeferred</code>,
  1640. * <code>importedKeyInitiallyImmediate</code>, or
  1641. * <code>importedKeyNotDeferrable</code>).</li>
  1642. * </ol>
  1643. *
  1644. * @param primaryCatalog The catalog to retrieve information from, or the
  1645. * empty string to return entities not associated with a catalog, or
  1646. * <code>null</code> to return information from all catalogs, on the
  1647. * exporting side.
  1648. * @param primarySchema The schema to retrieve information from, or the empty
  1649. * string to return entities not associated with a schema, on the
  1650. * exporting side.
  1651. * @param primaryTableName The table name to return information for, on the
  1652. * exporting side.
  1653. * @param foreignCatalog The catalog to retrieve information from, or the
  1654. * empty string to return entities not associated with a catalog,
  1655. * or <code>null</code> to return information from all catalogs, on
  1656. * the importing side.
  1657. * @param foreignSchema The schema to retrieve information from, or the
  1658. * empty string to return entities not associated with a schema on
  1659. * the importing side.
  1660. * @param foreignTableName The table name to return information for on the
  1661. * importing side.
  1662. * @return A <code>ResultSet</code> with the requested information
  1663. * @exception SQLException If an error occurs.
  1664. */
  1665. ResultSet getCrossReference(String primaryCatalog, String
  1666. primarySchema, String primaryTableName, String foreignCatalog, String
  1667. foreignSchema, String foreignTableName) throws SQLException;
  1668. /**
  1669. * This method returns a list of the SQL types supported by this
  1670. * database. The information is returned as a <code>ResultSet</code>
  1671. * with the following columns:
  1672. *
  1673. * <ol>
  1674. * <li>TYPE_NAME - The name of the data type.</li>
  1675. * <li>DATA_TYPE - A data type constant from <code>Types</code> for this
  1676. * type.</li>
  1677. * <li>PRECISION - The maximum precision of this type.</li>
  1678. * <li>LITERAL_PREFIX - Prefix value used to quote a literal, which may be
  1679. * <code>null</code>.</li>
  1680. * <li>LITERAL_SUFFIX - Suffix value used to quote a literal, which may be
  1681. * <code>null</code>.</li>
  1682. * <li>CREATE_PARAMS - The parameters used to create the type, which may be
  1683. * <code>null</code>.</li>
  1684. * <li>NULLABLE - Whether or not this type supports NULL values. This will
  1685. * be one of the constants defined in this interface
  1686. * (<code>typeNoNulls</code>, <code>typeNullable</code>, or
  1687. * <code>typeNullableUnknown</code>).</li>
  1688. * <li>CASE_SENSITIVE - Whether or not the value is case sensitive.</li>
  1689. * <li>SEARCHABLE - Whether or not "LIKE" expressions are supported in
  1690. * WHERE clauses for this type. This will be one of the constants defined
  1691. * in this interface (<code>typePredNone</code>, <code>typePredChar</code>,
  1692. * <code>typePredBasic</code>, or <code>typeSearchable</code>).</li>
  1693. * <li>UNSIGNED_ATTRIBUTE - Is the value of this type unsigned.</li>
  1694. * <li>FIXED_PREC_SCALE - Whether or not this type can be used for money.</li>
  1695. * <li>AUTO_INCREMENT - Whether or not this type supports auto-incrementing.</li>
  1696. * <li>LOCAL_TYPE_NAME - A localized name for this data type.</li>
  1697. * <li>MINIMUM_SCALE - The minimum scale supported by this type.</li>
  1698. * <li>MAXIMUM_SCALE - The maximum scale supported by this type.</li>
  1699. * <li>SQL_DATA_TYPE - Unused.</li>
  1700. * <li>SQL_DATETIME_SUB - Unused.</li>
  1701. * <li>NUM_PREC_RADIX - The radix of this data type.</li>
  1702. * </ol>
  1703. *
  1704. * @return A <code>ResultSet</code> with the list of available data types.
  1705. * @exception SQLException If an error occurs.
  1706. */
  1707. ResultSet getTypeInfo() throws SQLException;
  1708. /**
  1709. * This method returns information about a tables indices and statistics.
  1710. * It is returned as a <code>ResultSet</code> with the following columns:
  1711. *
  1712. * <ol>
  1713. * <li>TABLE_CAT - The catalog of the table, which may be <code>null</code>.</li>
  1714. * <li>TABLE_SCHEM - The schema of the table, which may be <code>null</code>.</li>
  1715. * <li>TABLE_NAME - The name of the table.</li>
  1716. * <li>NON_UNIQUE - Are index values non-unique?</li>
  1717. * <li>INDEX_QUALIFIER The index catalog, which may be <code>null</code></li>
  1718. * <li>INDEX_NAME - The name of the index.</li>
  1719. * <li>TYPE - The type of index, which will be one of the constants defined
  1720. * in this interface (<code>tableIndexStatistic</code>,
  1721. * <code>tableIndexClustered</code>, <code>tableIndexHashed</code>, or
  1722. * <code>tableIndexOther</code>).</li>
  1723. * <li>ORDINAL_POSITION - The sequence number of this column in the index.
  1724. * This will be 0 when the index type is <code>tableIndexStatistic</code>.</li>
  1725. * <li>COLUMN_NAME - The name of this column in the index.</li>
  1726. * <li>ASC_OR_DESC - "A" for an ascending sort sequence, "D" for a
  1727. * descending sort sequence or <code>null</code> if a sort sequence is not
  1728. * supported.</li>
  1729. * <li>CARDINALITY - The number of unique rows in the index, or the number
  1730. * of rows in the table if the index type is <code>tableIndexStatistic</code>.</li>
  1731. * <li>PAGES - The number of pages used for the index, or the number of pages
  1732. * in the table if the index type is <code>tableIndexStatistic</code>.</li>
  1733. * <li>FILTER_CONDITION - The filter condition for this index, which may be
  1734. * <code>null</code>.</li>
  1735. * </ol>
  1736. *
  1737. * @param catalog The catalog to retrieve information from, or the empty string
  1738. * to return entities not associated with a catalog, or
  1739. * <code>null</code> to return information from all catalogs.
  1740. * @param schema The schema to retrieve information from, or the empty string
  1741. * to return entities not associated with a schema.
  1742. * @param tableName The table name to return information for.
  1743. * @param unique <code>true</code> to return only unique indexes,
  1744. * <code>false</code> otherwise.
  1745. * @param approximate <code>true</code> if data values can be approximations,
  1746. * <code>false</code> otherwise.
  1747. * @return A <code>ResultSet</code> with the requested index information
  1748. * @exception SQLException If an error occurs.
  1749. */
  1750. ResultSet getIndexInfo(String catalog, String schema, String tableName,
  1751. boolean unique, boolean approximate) throws SQLException;
  1752. /**
  1753. * This method tests whether or not the datbase supports the specified
  1754. * result type.
  1755. *
  1756. * @param type The desired result type, which is one of the constants
  1757. * defined in <code>ResultSet</code>.
  1758. *
  1759. * @return <code>true</code> if the result set type is supported,
  1760. * <code>false</code> otherwise.
  1761. *
  1762. * @exception SQLException If an error occurs.
  1763. *
  1764. * @see ResultSet
  1765. */
  1766. boolean supportsResultSetType(int type) throws SQLException;
  1767. /**
  1768. * This method tests whether the specified result set type and result set
  1769. * concurrency type are supported by the database.
  1770. *
  1771. * @param type The desired result type, which is one of the constants
  1772. * defined in <code>ResultSet</code>.
  1773. * @param concurrency The desired concurrency type, which is one of the
  1774. * constants defined in <code>ResultSet</code>.
  1775. * @return <code>true</code> if the result set type is supported,
  1776. * <code>false</code> otherwise.
  1777. * @exception SQLException If an error occurs.
  1778. * @see ResultSet
  1779. */
  1780. boolean supportsResultSetConcurrency(int type, int concurrency)
  1781. throws SQLException;
  1782. /**
  1783. * This method tests whether or not the specified result set type sees its
  1784. * own updates.
  1785. *
  1786. * @param type The desired result type, which is one of the constants
  1787. * defined in <code>ResultSet</code>.
  1788. * @return <code>true</code> if the result set type sees its own updates,
  1789. * <code>false</code> otherwise.
  1790. * @exception SQLException If an error occurs.
  1791. * @see ResultSet
  1792. */
  1793. boolean ownUpdatesAreVisible(int type) throws SQLException;
  1794. /**
  1795. * This method tests whether or not the specified result set type sees its
  1796. * own deletes.
  1797. *
  1798. * @param type The desired result type, which is one of the constants
  1799. * defined in <code>ResultSet</code>.
  1800. * @return <code>true</code> if the result set type sees its own deletes,
  1801. * <code>false</code> otherwise.
  1802. * @exception SQLException If an error occurs.
  1803. * @see ResultSet
  1804. */
  1805. boolean ownDeletesAreVisible(int type) throws SQLException;
  1806. /**
  1807. * This method tests whether or not the specified result set type sees its
  1808. * own inserts.
  1809. *
  1810. * @param type The desired result type, which is one of the constants
  1811. * defined in <code>ResultSet</code>.
  1812. * @return <code>true</code> if the result set type sees its own inserts,
  1813. * <code>false</code> otherwise.
  1814. * @exception SQLException If an error occurs.
  1815. * @see ResultSet
  1816. */
  1817. boolean ownInsertsAreVisible(int type) throws SQLException;
  1818. /**
  1819. * This method tests whether or not the specified result set type sees
  1820. * updates committed by others.
  1821. *
  1822. * @param type The desired result type, which is one of the constants
  1823. * defined in <code>ResultSet</code>.
  1824. * @return <code>true</code> if the result set type sees other updates,
  1825. * <code>false</code> otherwise.
  1826. * @exception SQLException If an error occurs.
  1827. * @see ResultSet
  1828. */
  1829. boolean othersUpdatesAreVisible(int type) throws SQLException;
  1830. /**
  1831. * This method tests whether or not the specified result set type sees
  1832. * deletes committed by others.
  1833. *
  1834. * @param type The desired result type, which is one of the constants
  1835. * defined in <code>ResultSet</code>.
  1836. * @return <code>true</code> if the result set type sees other deletes,
  1837. * <code>false</code> otherwise.
  1838. * @exception SQLException If an error occurs.
  1839. * @see ResultSet
  1840. */
  1841. boolean othersDeletesAreVisible(int type) throws SQLException;
  1842. /**
  1843. * This method tests whether or not the specified result set type sees
  1844. * inserts committed by others.
  1845. *
  1846. * @param type The desired result type, which is one of the constants
  1847. * defined in <code>ResultSet</code>.
  1848. * @return <code>true</code> if the result set type sees other inserts,
  1849. * <code>false</code> otherwise.
  1850. * @exception SQLException If an error occurs.
  1851. * @see ResultSet
  1852. */
  1853. boolean othersInsertsAreVisible(int type) throws SQLException;
  1854. /**
  1855. * This method tests whether or not the specified result set type can detect
  1856. * a visible update by calling the <code>rowUpdated</code> method.
  1857. *
  1858. * @param type The desired result type, which is one of the constants
  1859. * defined in <code>ResultSet</code>.
  1860. * @return <code>true</code> if the result set type can detect visible updates
  1861. * using <code>rowUpdated</code>, <code>false</code> otherwise.
  1862. * @exception SQLException If an error occurs.
  1863. * @see ResultSet
  1864. */
  1865. boolean updatesAreDetected(int type) throws SQLException;
  1866. /**
  1867. * This method tests whether or not the specified result set type can detect
  1868. * a visible delete by calling the <code>rowUpdated</code> method.
  1869. *
  1870. * @param type The desired result type, which is one of the constants
  1871. * defined in <code>ResultSet</code>.
  1872. * @return <code>true</code> if the result set type can detect visible deletes
  1873. * using <code>rowUpdated</code>, <code>false</code> otherwise.
  1874. * @exception SQLException If an error occurs.
  1875. * @see ResultSet
  1876. */
  1877. boolean deletesAreDetected(int type) throws SQLException;
  1878. /**
  1879. * This method tests whether or not the specified result set type can detect
  1880. * a visible insert by calling the <code>rowUpdated</code> method.
  1881. *
  1882. * @param type The desired result type, which is one of the constants
  1883. * defined in <code>ResultSet</code>.
  1884. * @return <code>true</code> if the result set type can detect visible inserts
  1885. * using <code>rowUpdated</code>, <code>false</code> otherwise.
  1886. * @exception SQLException If an error occurs.
  1887. * @see ResultSet
  1888. */
  1889. boolean insertsAreDetected(int type) throws SQLException;
  1890. /**
  1891. * This method tests whether or not the database supports batch updates.
  1892. *
  1893. * @return <code>true</code> if batch updates are supported,
  1894. * <code>false</code> otherwise.
  1895. * @exception SQLException If an error occurs.
  1896. */
  1897. boolean supportsBatchUpdates() throws SQLException;
  1898. /**
  1899. * This method returns the list of user defined data types in use. These
  1900. * are returned as a <code>ResultSet</code> with the following columns:
  1901. *
  1902. * <ol>
  1903. * <li>TYPE_CAT - The catalog name, which may be <code>null</code>.</li>
  1904. * <li>TYPE_SCEHM - The schema name, which may be <code>null</code>.</li>
  1905. * <li>TYPE_NAME - The user defined data type name.</li>
  1906. * <li>CLASS_NAME - The Java class name this type maps to.</li>
  1907. * <li>DATA_TYPE - A type identifier from <code>Types</code> for this type.
  1908. * This will be one of <code>JAVA_OBJECT</code>, <code>STRUCT</code>, or
  1909. * <code>DISTINCT</code>.</li>
  1910. * <li>REMARKS - Comments about this data type.</li>
  1911. * </ol>
  1912. *
  1913. * @param catalog The catalog to retrieve information from, or the empty string
  1914. * to return entities not associated with a catalog, or <code>null</code>
  1915. * to return information from all catalogs.
  1916. * @param schemaPattern The schema to retrieve information from, or the
  1917. * empty string to return entities not associated with a schema.
  1918. * @param typePattern The type name pattern to match.
  1919. * @param types The type identifier patterns (from <code>Types</code>) to
  1920. * match.
  1921. * @return A <code>ResultSet</code> with the requested type information
  1922. * @exception SQLException If an error occurs.
  1923. */
  1924. ResultSet getUDTs(String catalog, String schemaPattern, String
  1925. typePattern, int[] types) throws SQLException;
  1926. /**
  1927. * This method returns the <code>Connection</code> object that was used
  1928. * to generate the metadata in this object.
  1929. *
  1930. * @return The connection for this object.
  1931. * @exception SQLException If an error occurs.
  1932. */
  1933. Connection getConnection() throws SQLException;
  1934. /**
  1935. * This method tests whether the databse supports savepoints.
  1936. *
  1937. * @return <code>true</code> if the database supports savepoints,
  1938. * <code>false</code> if it does not.
  1939. * @exception SQLException If an error occurs.
  1940. * @see Savepoint
  1941. * @since 1.4
  1942. */
  1943. boolean supportsSavepoints() throws SQLException;
  1944. /**
  1945. * This method tests whether the database supports named parameters.
  1946. *
  1947. * @return <code>true</code> if the database supports named parameters,
  1948. * <code>false</code> if it does not.
  1949. * @exception SQLException If an error occurs.
  1950. * @since 1.4
  1951. */
  1952. boolean supportsNamedParameters() throws SQLException;
  1953. /**
  1954. * This method tests whether the database supports returning multiple
  1955. * <code>ResultSet</code>S from a <code>CallableStatement</code> at once.
  1956. *
  1957. * @return <code>true</code> if the database supports returnig multiple
  1958. * results at once, <code>false</code> if it does not.
  1959. * @exception SQLException If an error occurs.
  1960. * @since 1.4
  1961. */
  1962. boolean supportsMultipleOpenResults() throws SQLException;
  1963. /**
  1964. * @since 1.4
  1965. */
  1966. boolean supportsGetGeneratedKeys() throws SQLException;
  1967. /**
  1968. * @since 1.4
  1969. */
  1970. ResultSet getSuperTypes(String catalog, String schemaPattern,
  1971. String typePattern) throws SQLException;
  1972. /**
  1973. * @since 1.4
  1974. */
  1975. ResultSet getSuperTables(String catalog, String schemaPattern,
  1976. String tablePattern) throws SQLException;
  1977. /**
  1978. * @since 1.4
  1979. */
  1980. ResultSet getAttributes(String catalog, String schemaPattern, String
  1981. typePattern, String attributePattern) throws SQLException;
  1982. /**
  1983. * This method tests if the database supports the specified holdability type.
  1984. * Valid values for this parameter are specified in the
  1985. * <code>ResultSet</code> class.
  1986. *
  1987. * @param holdability The holdability type to test.
  1988. * @return <code>true</code> if the database supports the holdability type,
  1989. * <code>false</code> if it does not.
  1990. * @exception SQLException If an error occurs.
  1991. * @see ResultSet
  1992. * @since 1.4
  1993. */
  1994. boolean supportsResultSetHoldability(int holdability)
  1995. throws SQLException;
  1996. /**
  1997. * This method returns the default holdability type of <code>ResultSet</code>S
  1998. * retrieved from this database. The possible values are specified in the
  1999. * <code>ResultSet</code> class.
  2000. *
  2001. * @return The default holdability type.
  2002. * @exception SQLException If an error occurs.
  2003. * @since 1.4
  2004. */
  2005. int getResultSetHoldability() throws SQLException;
  2006. /**
  2007. * This method returns the major version number of the database.
  2008. *
  2009. * @return The major version number of the database.
  2010. * @exception SQLException If an error occurs.
  2011. * @since 1.4
  2012. */
  2013. int getDatabaseMajorVersion() throws SQLException;
  2014. /**
  2015. * This method returns the minor version number of the database.
  2016. *
  2017. * @return The minor version number of the database.
  2018. * @exception SQLException If an error occurs.
  2019. * @since 1.4
  2020. */
  2021. int getDatabaseMinorVersion() throws SQLException;
  2022. /**
  2023. * This method returns the major version number of the JDBC driver.
  2024. *
  2025. * @return The major version number of the JDBC driver.
  2026. * @exception SQLException If an error occurs.
  2027. * @since 1.4
  2028. */
  2029. int getJDBCMajorVersion() throws SQLException;
  2030. /**
  2031. * This method returns the minor version number of the JDBC driver.
  2032. *
  2033. * @return The minor version number of the database.
  2034. * @exception SQLException If an error occurs.
  2035. * @since 1.4
  2036. */
  2037. int getJDBCMinorVersion() throws SQLException;
  2038. /**
  2039. * @since 1.4
  2040. */
  2041. int getSQLStateType() throws SQLException;
  2042. /**
  2043. * @since 1.4
  2044. */
  2045. boolean locatorsUpdateCopy() throws SQLException;
  2046. /**
  2047. * @since 1.4
  2048. */
  2049. boolean supportsStatementPooling() throws SQLException;
  2050. }