1. /*
  2. * @(#)ResultSet.java 1.26 00/02/02
  3. *
  4. * Copyright 1996-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.sql;
  11. import java.math.BigDecimal;
  12. import java.util.Calendar;
  13. /**
  14. * A table of data representing a database result set, which
  15. * is usually generated by executing a statement that queries the database.
  16. *
  17. * <P>A <code>ResultSet</code> object maintains a cursor pointing
  18. * to its current row of data. Initially the cursor is positioned
  19. * before the first row. The <code>next</code> method moves the
  20. * cursor to the next row, and because it returns <code>false</code>
  21. * when there are no more rows in the <code>ResultSet</code> object,
  22. * it can be used in a <code>while</code> loop to iterate through
  23. * the result set.
  24. * <P>
  25. * A default <code>ResultSet</code> object is not updatable and
  26. * has a cursor that moves forward only. Thus, it is possible to
  27. * iterate through it only once and only from the first row to the
  28. * last row. New methods in the JDBC 2.0 API make it possible to
  29. * produce <code>ResultSet</code> objects that are scrollable and/or
  30. * updatable. The following code fragment, in which <code>con</code>
  31. * is a valid <code>Connection</code> object, illustrates how to make
  32. * a result set that is scrollable and insensitive to updates by others, and
  33. * that is updatable. See <code>ResultSet</code> fields for other
  34. * options.
  35. * <PRE>
  36. *
  37. * Statement stmt = con.createStatement(
  38. * ResultSet.TYPE_SCROLL_INSENSITIVE,
  39. * ResultSet.CONCUR_UPDATABLE);
  40. * ResultSet rs = stmt.executeQuery("SELECT a, b FROM TABLE2");
  41. * // rs will be scrollable, will not show changes made by others,
  42. * // and will be updatable
  43. *
  44. * </PRE>
  45. * The <code>ResultSet</code> interface provides
  46. * <code>getXXX</code> methods for retrieving column values from
  47. * the current row.
  48. * Values can be retrieved using either the index number of the
  49. * column or the name of the column. In general, using the
  50. * column index will be more efficient. Columns are numbered from 1.
  51. * For maximum portability, result set columns within each row should be
  52. * read in left-to-right order, and each column should be read only once.
  53. *
  54. * <P>For the <code>getXXX</code> methods, a JDBC driver attempts
  55. * to convert the underlying data to the Java type specified in the
  56. * <code>XXX</code> part of the <code>getXXX</code> method and
  57. * returns a suitable Java value. The JDBC specification
  58. * has a table showing the allowable mappings
  59. * from SQL types to Java types with the <code>ResultSet.getXXX</code>
  60. * methods.
  61. * <P>
  62. * <P>Column names used as input to <code>getXXX</code> methods are case
  63. * insensitive. When a <code>getXXX</code> method is called with
  64. * a column name and several columns have the same name,
  65. * the value of the first matching column will be returned.
  66. * The column name option is
  67. * designed to be used when column names are used in the SQL
  68. * query that generated the result set.
  69. * For columns that are NOT explicitly named in the query, it
  70. * is best to use column numbers. If column names are used, there is
  71. * no way for the programmer to guarantee that they actually refer to
  72. * the intended columns.
  73. * <P>
  74. * A set of <code>updateXXX</code> methods were added to this interface
  75. * in the JDBC 2.0 API (Java<sup><font size=-2>TM</font></sup> 2 SDK,
  76. * Standard Edition, version 1.2). The comments regarding parameters
  77. * to the <code>getXXX</code> methods also apply to parameters to the
  78. * <code>updateXXX</code> methods.
  79. *<P>
  80. * The <code>updateXXX</code> methods may be used in two ways:
  81. * <ol>
  82. * <LI>to update a column value in the current row. In a scrollable
  83. * <code>ResultSet</code> object, the cursor can be moved backwards
  84. * and forwards, to an absolute position, or to a position
  85. * relative to the current row.
  86. * The following code fragment updates the <code>NAME</code> column
  87. * in the fifth row of the <code>ResultSet</code> object
  88. * <code>rs</code> and then uses the method <code>updateRow</code>
  89. * to update the data source table from which <code>rs</code> was derived.
  90. * <PRE>
  91. *
  92. * rs.absolute(5); // moves the cursor to the fifth row of rs
  93. * rs.updateString("NAME", "AINSWORTH"); // updates the
  94. * // <code>NAME</code> column of row 5 to be <code>AINSWORTH</code>
  95. * rs.updateRow(); // updates the row in the data source
  96. *
  97. * </PRE>
  98. * <LI>to insert column values into the insert row. An updatable
  99. * <code>ResultSet</code> object has a special row associated with
  100. * it that serves as a staging area for building a row to be inserted.
  101. * The following code fragment moves the cursor to the insert row, builds
  102. * a three-column row, and inserts it into <code>rs</code> and into
  103. * the data source table using the method <code>insertRow</code>.
  104. * <PRE>
  105. *
  106. * rs.moveToInsertRow(); // moves cursor to the insert row
  107. * rs.updateString(1, "AINSWORTH"); // updates the
  108. * // first column of the insert row to be <code>AINSWORTH</code>
  109. * rs.updateInt(2,35); // updates the second column to be <code>35</code>
  110. * rs.updateBoolean(3, true); // updates the third row to <code>true</code>
  111. * rs.insertRow();
  112. * rs.moveToCurrentRow();
  113. *
  114. * </PRE>
  115. * </ol>
  116. * <P>A <code>ResultSet</code> object is automatically closed when the
  117. * <code>Statement</code> object that
  118. * generated it is closed, re-executed, or used
  119. * to retrieve the next result from a sequence of multiple results.
  120. *
  121. * <P>The number, types and properties of a <code>ResultSet</code>
  122. * object's columns are provided by the <code>ResulSetMetaData</code>
  123. * object returned by the <code>ResultSet.getMetaData</code> method.
  124. *
  125. * @see Statement#executeQuery
  126. * @see Statement#getResultSet
  127. * @see ResultSetMetaData
  128. */
  129. public interface ResultSet {
  130. /**
  131. * Moves the cursor down one row from its current position.
  132. * A <code>ResultSet</code> cursor is initially positioned
  133. * before the first row; the first call to the method
  134. * <code>next</code> makes the first row the current row; the
  135. * second call makes the second row the current row, and so on.
  136. *
  137. * <P>If an input stream is open for the current row, a call
  138. * to the method <code>next</code> will
  139. * implicitly close it. A <code>ResultSet</code> object's
  140. * warning chain is cleared when a new row is read.
  141. *
  142. * @return <code>true</code> if the new current row is valid;
  143. * <code>false</code> if there are no more rows
  144. * @exception SQLException if a database access error occurs
  145. */
  146. boolean next() throws SQLException;
  147. /**
  148. * Releases this <code>ResultSet</code> object's database and
  149. * JDBC resources immediately instead of waiting for
  150. * this to happen when it is automatically closed.
  151. *
  152. * <P><B>Note:</B> A <code>ResultSet</code> object
  153. * is automatically closed by the
  154. * <code>Statement</code> object that generated it when
  155. * that <code>Statement</code> object is closed,
  156. * re-executed, or is used to retrieve the next result from a
  157. * sequence of multiple results. A <code>ResultSet</code> object
  158. * is also automatically closed when it is garbage collected.
  159. *
  160. * @exception SQLException if a database access error occurs
  161. */
  162. void close() throws SQLException;
  163. /**
  164. * Reports whether
  165. * the last column read had a value of SQL <code>NULL</code>.
  166. * Note that you must first call one of the <code>getXXX</code> methods
  167. * on a column to try to read its value and then call
  168. * the method <code>wasNull</code> to see if the value read was
  169. * SQL <code>NULL</code>.
  170. *
  171. * @return <code>true</code> if the last column value read was SQL
  172. * <code>NULL</code> and <code>false</code> otherwise
  173. * @exception SQLException if a database access error occurs
  174. */
  175. boolean wasNull() throws SQLException;
  176. //======================================================================
  177. // Methods for accessing results by column index
  178. //======================================================================
  179. /**
  180. * Gets the value of the designated column in the current row
  181. * of this <code>ResultSet</code> object as
  182. * a <code>String</code> in the Java programming language.
  183. *
  184. * @param columnIndex the first column is 1, the second is 2, ...
  185. * @return the column value; if the value is SQL <code>NULL</code>, the
  186. * value returned is <code>null</code>
  187. * @exception SQLException if a database access error occurs
  188. */
  189. String getString(int columnIndex) throws SQLException;
  190. /**
  191. * Gets the value of the designated column in the current row
  192. * of this <code>ResultSet</code> object as
  193. * a <code>boolean</code> in the Java programming language.
  194. *
  195. * @param columnIndex the first column is 1, the second is 2, ...
  196. * @return the column value; if the value is SQL <code>NULL</code>, the
  197. * value returned is <code>false</code>
  198. * @exception SQLException if a database access error occurs
  199. */
  200. boolean getBoolean(int columnIndex) throws SQLException;
  201. /**
  202. * Gets the value of the designated column in the current row
  203. * of this <code>ResultSet</code> object as
  204. * a <code>byte</code> in the Java programming language.
  205. *
  206. * @param columnIndex the first column is 1, the second is 2, ...
  207. * @return the column value; if the value is SQL <code>NULL</code>, the
  208. * value returned is <code>0</code>
  209. * @exception SQLException if a database access error occurs
  210. */
  211. byte getByte(int columnIndex) throws SQLException;
  212. /**
  213. * Gets the value of the designated column in the current row
  214. * of this <code>ResultSet</code> object as
  215. * a <code>short</code> in the Java programming language.
  216. *
  217. * @param columnIndex the first column is 1, the second is 2, ...
  218. * @return the column value; if the value is SQL <code>NULL</code>, the
  219. * value returned is <code>0</code>
  220. * @exception SQLException if a database access error occurs
  221. */
  222. short getShort(int columnIndex) throws SQLException;
  223. /**
  224. * Gets the value of the designated column in the current row
  225. * of this <code>ResultSet</code> object as
  226. * an <code>int</code> in the Java programming language.
  227. *
  228. * @param columnIndex the first column is 1, the second is 2, ...
  229. * @return the column value; if the value is SQL <code>NULL</code>, the
  230. * value returned is <code>0</code>
  231. * @exception SQLException if a database access error occurs
  232. */
  233. int getInt(int columnIndex) throws SQLException;
  234. /**
  235. * Gets the value of the designated column in the current row
  236. * of this <code>ResultSet</code> object as
  237. * a <code>long</code> in the Java programming language.
  238. *
  239. * @param columnIndex the first column is 1, the second is 2, ...
  240. * @return the column value; if the value is SQL <code>NULL</code>, the
  241. * value returned is <code>0</code>
  242. * @exception SQLException if a database access error occurs
  243. */
  244. long getLong(int columnIndex) throws SQLException;
  245. /**
  246. * Gets the value of the designated column in the current row
  247. * of this <code>ResultSet</code> object as
  248. * a <code>float</code> in the Java programming language.
  249. *
  250. * @param columnIndex the first column is 1, the second is 2, ...
  251. * @return the column value; if the value is SQL <code>NULL</code>, the
  252. * value returned is <code>0</code>
  253. * @exception SQLException if a database access error occurs
  254. */
  255. float getFloat(int columnIndex) throws SQLException;
  256. /**
  257. * Gets the value of the designated column in the current row
  258. * of this <code>ResultSet</code> object as
  259. * a <code>double</code> in the Java programming language.
  260. *
  261. * @param columnIndex the first column is 1, the second is 2, ...
  262. * @return the column value; if the value is SQL <code>NULL</code>, the
  263. * value returned is <code>0</code>
  264. * @exception SQLException if a database access error occurs
  265. */
  266. double getDouble(int columnIndex) throws SQLException;
  267. /**
  268. * Gets the value of the designated column in the current row
  269. * of this <code>ResultSet</code> object as
  270. * a <code>java.sql.BigDecimal</code> in the Java programming language.
  271. *
  272. * @param columnIndex the first column is 1, the second is 2, ...
  273. * @param scale the number of digits to the right of the decimal point
  274. * @return the column value; if the value is SQL <code>NULL</code>, the
  275. * value returned is <code>null</code>
  276. * @exception SQLException if a database access error occurs
  277. * @deprecated
  278. */
  279. BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException;
  280. /**
  281. * Gets the value of the designated column in the current row
  282. * of this <code>ResultSet</code> object as
  283. * a <code>byte</code> array in the Java programming language.
  284. * The bytes represent the raw values returned by the driver.
  285. *
  286. * @param columnIndex the first column is 1, the second is 2, ...
  287. * @return the column value; if the value is SQL <code>NULL</code>, the
  288. * value returned is <code>null</code>
  289. * @exception SQLException if a database access error occurs
  290. */
  291. byte[] getBytes(int columnIndex) throws SQLException;
  292. /**
  293. * Gets the value of the designated column in the current row
  294. * of this <code>ResultSet</code> object as
  295. * a <code>java.sql.Date</code> object in the Java programming language.
  296. *
  297. * @param columnIndex the first column is 1, the second is 2, ...
  298. * @return the column value; if the value is SQL <code>NULL</code>, the
  299. * value returned is <code>null</code>
  300. * @exception SQLException if a database access error occurs
  301. */
  302. java.sql.Date getDate(int columnIndex) throws SQLException;
  303. /**
  304. * Gets the value of the designated column in the current row
  305. * of this <code>ResultSet</code> object as
  306. * a <code>java.sql.Time</code> object in the Java programming language.
  307. *
  308. * @param columnIndex the first column is 1, the second is 2, ...
  309. * @return the column value; if the value is SQL <code>NULL</code>, the
  310. * value returned is <code>null</code>
  311. * @exception SQLException if a database access error occurs
  312. */
  313. java.sql.Time getTime(int columnIndex) throws SQLException;
  314. /**
  315. * Gets the value of the designated column in the current row
  316. * of this <code>ResultSet</code> object as
  317. * a <code>java.sql.Timestamp</code> object in the Java programming language.
  318. *
  319. * @param columnIndex the first column is 1, the second is 2, ...
  320. * @return the column value; if the value is SQL <code>NULL</code>, the
  321. * value returned is <code>null</code>
  322. * @exception SQLException if a database access error occurs
  323. */
  324. java.sql.Timestamp getTimestamp(int columnIndex) throws SQLException;
  325. /**
  326. * Gets the value of the designated column in the current row
  327. * of this <code>ResultSet</code> object as
  328. * a stream of ASCII characters. The value can then be read in chunks from the
  329. * stream. This method is particularly
  330. * suitable for retrieving large <char>LONGVARCHAR</char> values.
  331. * The JDBC driver will
  332. * do any necessary conversion from the database format into ASCII.
  333. *
  334. * <P><B>Note:</B> All the data in the returned stream must be
  335. * read prior to getting the value of any other column. The next
  336. * call to a <code>getXXX</code> method implicitly closes the stream. Also, a
  337. * stream may return <code>0</code> when the method
  338. * <code>InputStream.available</code>
  339. * is called whether there is data available or not.
  340. *
  341. * @param columnIndex the first column is 1, the second is 2, ...
  342. * @return a Java input stream that delivers the database column value
  343. * as a stream of one-byte ASCII characters;
  344. * if the value is SQL <code>NULL</code>, the
  345. * value returned is <code>null</code>
  346. * @exception SQLException if a database access error occurs
  347. */
  348. java.io.InputStream getAsciiStream(int columnIndex) throws SQLException;
  349. /**
  350. * Gets the value of a column in the current row as a stream of
  351. * Gets the value of the designated column in the current row
  352. * of this <code>ResultSet</code> object as
  353. * as a stream of Unicode characters.
  354. * The value can then be read in chunks from the
  355. * stream. This method is particularly
  356. * suitable for retrieving large<code>LONGVARCHAR</code>values. The JDBC driver will
  357. * do any necessary conversion from the database format into Unicode.
  358. * The byte format of the Unicode stream must be Java UTF-8,
  359. * as specified in the Java virtual machine specification.
  360. *
  361. * <P><B>Note:</B> All the data in the returned stream must be
  362. * read prior to getting the value of any other column. The next
  363. * call to a <code>getXXX</code> method implicitly closes the stream. Also, a
  364. * stream may return <code>0</code> when the method
  365. * <code>InputStream.available</code>
  366. * is called whether there is data available or not.
  367. *
  368. * @param columnIndex the first column is 1, the second is 2, ...
  369. * @return a Java input stream that delivers the database column value
  370. * as a stream in Java UTF-8 byte format;
  371. * if the value is SQL <code>NULL</code>, the value returned is <code>null</code>
  372. * @exception SQLException if a database access error occurs
  373. * @deprecated use <code>getCharacterStream</code> in place of
  374. * <code>getUnicodeStream</code>
  375. */
  376. java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException;
  377. /**
  378. * Gets the value of a column in the current row as a stream of
  379. * Gets the value of the designated column in the current row
  380. * of this <code>ResultSet</code> object as a binary stream of
  381. * uninterpreted bytes. The value can then be read in chunks from the
  382. * stream. This method is particularly
  383. * suitable for retrieving large <code>LONGVARBINARY</code> values.
  384. *
  385. * <P><B>Note:</B> All the data in the returned stream must be
  386. * read prior to getting the value of any other column. The next
  387. * call to a <code>getXXX</code> method implicitly closes the stream. Also, a
  388. * stream may return <code>0</code> when the method
  389. * <code>InputStream.available</code>
  390. * is called whether there is data available or not.
  391. *
  392. * @param columnIndex the first column is 1, the second is 2, ...
  393. * @return a Java input stream that delivers the database column value
  394. * as a stream of uninterpreted bytes;
  395. * if the value is SQL <code>NULL</code>, the value returned is <code>null</code>
  396. * @exception SQLException if a database access error occurs
  397. */
  398. java.io.InputStream getBinaryStream(int columnIndex)
  399. throws SQLException;
  400. //======================================================================
  401. // Methods for accessing results by column name
  402. //======================================================================
  403. /**
  404. * Gets the value of the designated column in the current row
  405. * of this <code>ResultSet</code> object as
  406. * a <code>String</code> in the Java programming language.
  407. *
  408. * @param columnName the SQL name of the column
  409. * @return the column value; if the value is SQL <code>NULL</code>, the
  410. * value returned is <code>null</code>
  411. * @exception SQLException if a database access error occurs
  412. */
  413. String getString(String columnName) throws SQLException;
  414. /**
  415. * Gets the value of the designated column in the current row
  416. * of this <code>ResultSet</code> object as
  417. * a <code>boolean</code> in the Java programming language.
  418. *
  419. * @param columnName the SQL name of the column
  420. * @return the column value; if the value is SQL <code>NULL</code>, the
  421. * value returned is <code>false</code>
  422. * @exception SQLException if a database access error occurs
  423. */
  424. boolean getBoolean(String columnName) throws SQLException;
  425. /**
  426. * Gets the value of the designated column in the current row
  427. * of this <code>ResultSet</code> object as
  428. * a <code>byte</code> in the Java programming language.
  429. *
  430. * @param columnName the SQL name of the column
  431. * @return the column value; if the value is SQL <code>NULL</code>, the
  432. * value returned is <code>0</code>
  433. * @exception SQLException if a database access error occurs
  434. */
  435. byte getByte(String columnName) throws SQLException;
  436. /**
  437. * Gets the value of the designated column in the current row
  438. * of this <code>ResultSet</code> object as
  439. * a <code>short</code> in the Java programming language.
  440. *
  441. * @param columnName the SQL name of the column
  442. * @return the column value; if the value is SQL <code>NULL</code>, the
  443. * value returned is <code>0</code>
  444. * @exception SQLException if a database access error occurs
  445. */
  446. short getShort(String columnName) throws SQLException;
  447. /**
  448. * Gets the value of the designated column in the current row
  449. * of this <code>ResultSet</code> object as
  450. * an <code>int</code> in the Java programming language.
  451. *
  452. * @param columnName the SQL name of the column
  453. * @return the column value; if the value is SQL <code>NULL</code>, the
  454. * value returned is <code>0</code>
  455. * @exception SQLException if a database access error occurs
  456. */
  457. int getInt(String columnName) throws SQLException;
  458. /**
  459. * Gets the value of the designated column in the current row
  460. * of this <code>ResultSet</code> object as
  461. * a <code>long</code> in the Java programming language.
  462. *
  463. * @param columnName the SQL name of the column
  464. * @return the column value; if the value is SQL <code>NULL</code>, the
  465. * value returned is <code>0</code>
  466. * @exception SQLException if a database access error occurs
  467. */
  468. long getLong(String columnName) throws SQLException;
  469. /**
  470. * Gets the value of the designated column in the current row
  471. * of this <code>ResultSet</code> object as
  472. * a <code>float</code> in the Java programming language.
  473. *
  474. * @param columnName the SQL name of the column
  475. * @return the column value; if the value is SQL <code>NULL</code>, the
  476. * value returned is <code>0</code>
  477. * @exception SQLException if a database access error occurs
  478. */
  479. float getFloat(String columnName) throws SQLException;
  480. /**
  481. * Gets the value of the designated column in the current row
  482. * of this <code>ResultSet</code> object as
  483. * a <code>double</code> in the Java programming language.
  484. *
  485. * @param columnName the SQL name of the column
  486. * @return the column value; if the value is SQL <code>NULL</code>, the
  487. * value returned is <code>0</code>
  488. * @exception SQLException if a database access error occurs
  489. */
  490. double getDouble(String columnName) throws SQLException;
  491. /**
  492. * Gets the value of the designated column in the current row
  493. * of this <code>ResultSet</code> object as
  494. * a <code>java.math.BigDecimal</code> in the Java programming language.
  495. *
  496. * @param columnName the SQL name of the column
  497. * @param scale the number of digits to the right of the decimal point
  498. * @return the column value; if the value is SQL <code>NULL</code>, the
  499. * value returned is <code>null</code>
  500. * @exception SQLException if a database access error occurs
  501. * @deprecated
  502. */
  503. BigDecimal getBigDecimal(String columnName, int scale) throws SQLException;
  504. /**
  505. * Gets the value of the designated column in the current row
  506. * of this <code>ResultSet</code> object as
  507. * a <code>byte</code> array in the Java programming language.
  508. * The bytes represent the raw values returned by the driver.
  509. *
  510. * @param columnName the SQL name of the column
  511. * @return the column value; if the value is SQL <code>NULL</code>, the
  512. * value returned is <code>null</code>
  513. * @exception SQLException if a database access error occurs
  514. */
  515. byte[] getBytes(String columnName) throws SQLException;
  516. /**
  517. * Gets the value of the designated column in the current row
  518. * of this <code>ResultSet</code> object as
  519. * a <code>java.sql.Date</code> object in the Java programming language.
  520. *
  521. * @param columnName the SQL name of the column
  522. * @return the column value; if the value is SQL <code>NULL</code>, the
  523. * value returned is <code>null</code>
  524. * @exception SQLException if a database access error occurs
  525. */
  526. java.sql.Date getDate(String columnName) throws SQLException;
  527. /**
  528. * Gets the value of the designated column in the current row
  529. * of this <code>ResultSet</code> object as
  530. * a <code>java.sql.Time</code> object in the Java programming language.
  531. *
  532. * @param columnName the SQL name of the column
  533. * @return the column value;
  534. * if the value is SQL <code>NULL</code>,
  535. * the value returned is <code>null</code>
  536. * @exception SQLException if a database access error occurs
  537. */
  538. java.sql.Time getTime(String columnName) throws SQLException;
  539. /**
  540. * Gets the value of the designated column in the current row
  541. * of this <code>ResultSet</code> object as
  542. * a <code>java.sql.Timestamp</code> object.
  543. *
  544. * @param columnName the SQL name of the column
  545. * @return the column value; if the value is SQL <code>NULL</code>, the
  546. * value returned is <code>null</code>
  547. * @exception SQLException if a database access error occurs
  548. */
  549. java.sql.Timestamp getTimestamp(String columnName) throws SQLException;
  550. /**
  551. * Gets the value of the designated column in the current row
  552. * of this <code>ResultSet</code> object as a stream of
  553. * ASCII characters. The value can then be read in chunks from the
  554. * stream. This method is particularly
  555. * suitable for retrieving large <code>LONGVARCHAR</code> values.
  556. * The JDBC driver will
  557. * do any necessary conversion from the database format into ASCII.
  558. *
  559. * <P><B>Note:</B> All the data in the returned stream must be
  560. * read prior to getting the value of any other column. The next
  561. * call to a <code>getXXX</code> method implicitly closes the stream. Also, a
  562. * stream may return <code>0</code> when the method <code>available</code>
  563. * is called whether there is data available or not.
  564. *
  565. * @param columnName the SQL name of the column
  566. * @return a Java input stream that delivers the database column value
  567. * as a stream of one-byte ASCII characters.
  568. * If the value is SQL <code>NULL</code>,
  569. * the value returned is <code>null</code>.
  570. * @exception SQLException if a database access error occurs
  571. */
  572. java.io.InputStream getAsciiStream(String columnName) throws SQLException;
  573. /**
  574. * Gets the value of the designated column in the current row
  575. * of this <code>ResultSet</code> object as a stream of
  576. * Unicode characters. The value can then be read in chunks from the
  577. * stream. This method is particularly
  578. * suitable for retrieving large <code>LONGVARCHAR</code> values.
  579. * The JDBC driver will
  580. * do any necessary conversion from the database format into Unicode.
  581. * The byte format of the Unicode stream must be Java UTF-8,
  582. * as defined in the Java virtual machine specification.
  583. *
  584. * <P><B>Note:</B> All the data in the returned stream must be
  585. * read prior to getting the value of any other column. The next
  586. * call to a <code>getXXX</code> method implicitly closes the stream. Also, a
  587. * stream may return <code>0</code> when the method <code>available</code>
  588. * is called whether there is data available or not.
  589. *
  590. * @param columnName the SQL name of the column
  591. * @return a Java input stream that delivers the database column value
  592. * as a stream of two-byte Unicode characters.
  593. * If the value is SQL <code>NULL</code>,
  594. * the value returned is <code>null</code>.
  595. * @exception SQLException if a database access error occurs
  596. * @deprecated
  597. */
  598. java.io.InputStream getUnicodeStream(String columnName) throws SQLException;
  599. /**
  600. * Gets the value of the designated column in the current row
  601. * of this <code>ResultSet</code> object as a stream of uninterpreted
  602. * <code>byte</code>s.
  603. * The value can then be read in chunks from the
  604. * stream. This method is particularly
  605. * suitable for retrieving large <code>LONGVARBINARY</code>
  606. * values.
  607. *
  608. * <P><B>Note:</B> All the data in the returned stream must be
  609. * read prior to getting the value of any other column. The next
  610. * call to a <code>getXXX</code> method implicitly closes the stream. Also, a
  611. * stream may return <code>0</code> when the method <code>available</code>
  612. * is called whether there is data available or not.
  613. *
  614. * @param columnName the SQL name of the column
  615. * @return a Java input stream that delivers the database column value
  616. * as a stream of uninterpreted bytes;
  617. * if the value is SQL <code>NULL</code>, the result is <code>null</code>
  618. * @exception SQLException if a database access error occurs
  619. */
  620. java.io.InputStream getBinaryStream(String columnName)
  621. throws SQLException;
  622. //=====================================================================
  623. // Advanced features:
  624. //=====================================================================
  625. /**
  626. * Returns the first warning reported by calls on this
  627. * <code>ResultSet</code> object.
  628. * Subsequent warnings on this <code>ResultSet</code> object
  629. * will be chained to the <code>SQLWarning</code> object that
  630. * this method returns.
  631. *
  632. * <P>The warning chain is automatically cleared each time a new
  633. * row is read.
  634. *
  635. * <P><B>Note:</B> This warning chain only covers warnings caused
  636. * by <code>ResultSet</code> methods. Any warning caused by
  637. * <code>Statement</code> methods
  638. * (such as reading OUT parameters) will be chained on the
  639. * <code>Statement</code> object.
  640. *
  641. * @return the first <code>SQLWarning</code> object reported or <code>null</code>
  642. * @exception SQLException if a database access error occurs
  643. */
  644. SQLWarning getWarnings() throws SQLException;
  645. /**
  646. * Clears all warnings reported on this <code>ResultSet</code> object.
  647. * After this method is called, the method <code>getWarnings</code>
  648. * returns <code>null</code> until a new warning is
  649. * reported for this <code>ResultSet</code> object.
  650. *
  651. * @exception SQLException if a database access error occurs
  652. */
  653. void clearWarnings() throws SQLException;
  654. /**
  655. * Gets the name of the SQL cursor used by this <code>ResultSet</code>
  656. * object.
  657. *
  658. * <P>In SQL, a result table is retrieved through a cursor that is
  659. * named. The current row of a result set can be updated or deleted
  660. * using a positioned update/delete statement that references the
  661. * cursor name. To insure that the cursor has the proper isolation
  662. * level to support update, the cursor's <code>select</code> statement should be
  663. * of the form 'select for update'. If the 'for update' clause is
  664. * omitted, the positioned updates may fail.
  665. *
  666. * <P>The JDBC API supports this SQL feature by providing the name of the
  667. * SQL cursor used by a <code>ResultSet</code> object.
  668. * The current row of a <code>ResultSet</code> object
  669. * is also the current row of this SQL cursor.
  670. *
  671. * <P><B>Note:</B> If positioned update is not supported, a
  672. * <code>SQLException</code> is thrown.
  673. *
  674. * @return the SQL name for this <code>ResultSet</code> object's cursor
  675. * @exception SQLException if a database access error occurs
  676. */
  677. String getCursorName() throws SQLException;
  678. /**
  679. * Retrieves the number, types and properties of
  680. * this <code>ResultSet</code> object's columns.
  681. *
  682. * @return the description of this <code>ResultSet</code> object's columns
  683. * @exception SQLException if a database access error occurs
  684. */
  685. ResultSetMetaData getMetaData() throws SQLException;
  686. /**
  687. * <p>Gets the value of the designated column in the current row
  688. * of this <code>ResultSet</code> object as
  689. * an <code>Object</code> in the Java programming language.
  690. *
  691. * <p>This method will return the value of the given column as a
  692. * Java object. The type of the Java object will be the default
  693. * Java object type corresponding to the column's SQL type,
  694. * following the mapping for built-in types specified in the JDBC
  695. * specification.
  696. *
  697. * <p>This method may also be used to read datatabase-specific
  698. * abstract data types.
  699. *
  700. * In the JDBC 2.0 API, the behavior of method
  701. * <code>getObject</code> is extended to materialize
  702. * data of SQL user-defined types. When a column contains
  703. * a structured or distinct value, the behavior of this method is as
  704. * if it were a call to: <code>getObject(columnIndex,
  705. * this.getStatement().getConnection().getTypeMap())</code>.
  706. *
  707. * @param columnIndex the first column is 1, the second is 2, ...
  708. * @return a <code>java.lang.Object</code> holding the column value
  709. * @exception SQLException if a database access error occurs
  710. */
  711. Object getObject(int columnIndex) throws SQLException;
  712. /**
  713. * <p>Gets the value of the designated column in the current row
  714. * of this <code>ResultSet</code> object as
  715. * an <code>Object</code> in the Java programming language.
  716. *
  717. * <p>This method will return the value of the given column as a
  718. * Java object. The type of the Java object will be the default
  719. * Java object type corresponding to the column's SQL type,
  720. * following the mapping for built-in types specified in the JDBC
  721. * specification.
  722. *
  723. * <p>This method may also be used to read datatabase-specific
  724. * abstract data types.
  725. *
  726. * In the JDBC 2.0 API, the behavior of the method
  727. * <code>getObject</code> is extended to materialize
  728. * data of SQL user-defined types. When a column contains
  729. * a structured or distinct value, the behavior of this method is as
  730. * if it were a call to: <code>getObject(columnIndex,
  731. * this.getStatement().getConnection().getTypeMap())</code>.
  732. *
  733. * @param columnName the SQL name of the column
  734. * @return a <code>java.lang.Object</code> holding the column value
  735. * @exception SQLException if a database access error occurs
  736. */
  737. Object getObject(String columnName) throws SQLException;
  738. //----------------------------------------------------------------
  739. /**
  740. * Maps the given <code>ResultSet</code> column name to its
  741. * <code>ResultSet</code> column index.
  742. *
  743. * @param columnName the name of the column
  744. * @return the column index of the given column name
  745. * @exception SQLException if a database access error occurs
  746. */
  747. int findColumn(String columnName) throws SQLException;
  748. //--------------------------JDBC 2.0-----------------------------------
  749. //---------------------------------------------------------------------
  750. // Getters and Setters
  751. //---------------------------------------------------------------------
  752. /**
  753. * Gets the value of the designated column in the current row
  754. * of this <code>ResultSet</code> object as a
  755. * <code>java.io.Reader</code> object.
  756. * @return a <code>java.io.Reader</code> object that contains the column
  757. * value; if the value is SQL <code>NULL</code>, the value returned is
  758. * <code>null</code> in the Java programming language.
  759. * @param columnIndex the first column is 1, the second is 2, ...
  760. * @since 1.2
  761. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  762. * 2.0 API</a>
  763. */
  764. java.io.Reader getCharacterStream(int columnIndex) throws SQLException;
  765. /**
  766. * Gets the value of the designated column in the current row
  767. * of this <code>ResultSet</code> object as a
  768. * <code>java.io.Reader</code> object.
  769. *
  770. * @return a <code>java.io.Reader</code> object that contains the column
  771. * value; if the value is SQL <code>NULL</code>, the value returned is
  772. * <code>null</code> in the Java programming language.
  773. * @param columnName the name of the column
  774. * @return the value in the specified column as a <code>java.io.Reader</code>
  775. * @since 1.2
  776. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  777. * 2.0 API</a>
  778. */
  779. java.io.Reader getCharacterStream(String columnName) throws SQLException;
  780. /**
  781. * Gets the value of the designated column in the current row
  782. * of this <code>ResultSet</code> object as a
  783. * <code>java.math.BigDecimal</code> with full precision.
  784. *
  785. * @param columnIndex the first column is 1, the second is 2, ...
  786. * @return the column value (full precision);
  787. * if the value is SQL <code>NULL</code>, the value returned is
  788. * <code>null</code> in the Java programming language.
  789. * @exception SQLException if a database access error occurs
  790. * @since 1.2
  791. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  792. * 2.0 API</a>
  793. */
  794. BigDecimal getBigDecimal(int columnIndex) throws SQLException;
  795. /**
  796. * Gets the value of the designated column in the current row
  797. * of this <code>ResultSet</code> object as a
  798. * <code>java.math.BigDecimal</code> with full precision.
  799. *
  800. * @param columnName the column name
  801. * @return the column value (full precision);
  802. * if the value is SQL <code>NULL</code>, the value returned is
  803. * <code>null</code> in the Java programming language.
  804. * @exception SQLException if a database access error occurs
  805. * @since 1.2
  806. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  807. * 2.0 API</a>
  808. *
  809. */
  810. BigDecimal getBigDecimal(String columnName) throws SQLException;
  811. //---------------------------------------------------------------------
  812. // Traversal/Positioning
  813. //---------------------------------------------------------------------
  814. /**
  815. * Indicates whether the cursor is before the first row in
  816. * this <code>ResultSet</code> object.
  817. *
  818. * @return <code>true</code> if the cursor is before the first row;
  819. * <code>false</code> if the cursor is at any other position or the
  820. * result set contains no rows
  821. * @exception SQLException if a database access error occurs
  822. * @since 1.2
  823. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  824. * 2.0 API</a>
  825. */
  826. boolean isBeforeFirst() throws SQLException;
  827. /**
  828. * Indicates whether the cursor is after the last row in
  829. * this <code>ResultSet</code> object.
  830. *
  831. * @return <code>true</code> if the cursor is after the last row;
  832. * <code>false</code> if the cursor is at any other position or the
  833. * result set contains no rows
  834. * @exception SQLException if a database access error occurs
  835. * @since 1.2
  836. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  837. * 2.0 API</a>
  838. */
  839. boolean isAfterLast() throws SQLException;
  840. /**
  841. * Indicates whether the cursor is on the first row of
  842. * this <code>ResultSet</code> object.
  843. *
  844. * @return <code>true</code> if the cursor is on the first row;
  845. * <code>false</code> otherwise
  846. * @exception SQLException if a database access error occurs
  847. * @since 1.2
  848. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  849. * 2.0 API</a>
  850. */
  851. boolean isFirst() throws SQLException;
  852. /**
  853. * Indicates whether the cursor is on the last row of
  854. * this <code>ResultSet</code> object.
  855. * Note: Calling the method <code>isLast</code> may be expensive
  856. * because the JDBC driver
  857. * might need to fetch ahead one row in order to determine
  858. * whether the current row is the last row in the result set.
  859. *
  860. * @return <code>true</code> if the cursor is on the last row;
  861. * <code>false</code> otherwise
  862. * @exception SQLException if a database access error occurs
  863. * @since 1.2
  864. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  865. * 2.0 API</a>
  866. */
  867. boolean isLast() throws SQLException;
  868. /**
  869. * Moves the cursor to the front of
  870. * this <code>ResultSet</code> object, just before the
  871. * first row. This method has no effect if the result set contains no rows.
  872. *
  873. * @exception SQLException if a database access error
  874. * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
  875. * @since 1.2
  876. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  877. * 2.0 API</a>
  878. */
  879. void beforeFirst() throws SQLException;
  880. /**
  881. * Moves the cursor to the end of
  882. * this <code>ResultSet</code> object, just after the
  883. * last row. This method has no effect if the result set contains no rows.
  884. * @exception SQLException if a database access error
  885. * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
  886. * @since 1.2
  887. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  888. * 2.0 API</a>
  889. */
  890. void afterLast() throws SQLException;
  891. /**
  892. * Moves the cursor to the first row in
  893. * this <code>ResultSet</code> object.
  894. *
  895. * @return <code>true</code> if the cursor is on a valid row;
  896. * <code>false</code> if there are no rows in the result set
  897. * @exception SQLException if a database access error
  898. * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
  899. * @since 1.2
  900. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  901. * 2.0 API</a>
  902. */
  903. boolean first() throws SQLException;
  904. /**
  905. * Moves the cursor to the last row in
  906. * this <code>ResultSet</code> object.
  907. *
  908. * @return <code>true</code> if the cursor is on a valid row;
  909. * <code>false</code> if there are no rows in the result set
  910. * @exception SQLException if a database access error
  911. * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
  912. * @since 1.2
  913. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  914. * 2.0 API</a>
  915. */
  916. boolean last() throws SQLException;
  917. /**
  918. * Retrieves the current row number. The first row is number 1, the
  919. * second number 2, and so on.
  920. *
  921. * @return the current row number; <code>0</code> if there is no current row
  922. * @exception SQLException if a database access error occurs
  923. * @since 1.2
  924. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  925. * 2.0 API</a>
  926. */
  927. int getRow() throws SQLException;
  928. /**
  929. * Moves the cursor to the given row number in
  930. * this <code>ResultSet</code> object.
  931. *
  932. * <p>If the row number is positive, the cursor moves to
  933. * the given row number with respect to the
  934. * beginning of the result set. The first row is row 1, the second
  935. * is row 2, and so on.
  936. *
  937. * <p>If the given row number is negative, the cursor moves to
  938. * an absolute row position with respect to
  939. * the end of the result set. For example, calling the method
  940. * <code>absolute(-1)</code> positions the
  941. * cursor on the last row; calling the method <code>absolute(-2)</code>
  942. * moves the cursor to the next-to-last row, and so on.
  943. *
  944. * <p>An attempt to position the cursor beyond the first/last row in
  945. * the result set leaves the cursor before the first row or after
  946. * the last row.
  947. *
  948. * <p><B>Note:</B> Calling <code>absolute(1)</code> is the same
  949. * as calling <code>first()</code>. Calling <code>absolute(-1)</code>
  950. * is the same as calling <code>last()</code>.
  951. *
  952. * @return <code>true</code> if the cursor is on the result set;
  953. * <code>false</code> otherwise
  954. * @exception SQLException if a database access error
  955. * occurs, the row is <code>0</code>, or the result set type is
  956. * <code>TYPE_FORWARD_ONLY</code>
  957. * @since 1.2
  958. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  959. * 2.0 API</a>
  960. */
  961. boolean absolute( int row ) throws SQLException;
  962. /**
  963. * Moves the cursor a relative number of rows, either positive or negative.
  964. * Attempting to move beyond the first/last row in the
  965. * result set positions the cursor before/after the
  966. * the first/last row. Calling <code>relative(0)</code> is valid, but does
  967. * not change the cursor position.
  968. *
  969. * <p>Note: Calling the method <code>relative(1)</code>
  970. * is different from calling the method <code>next()</code>
  971. * because is makes sense to call <code>next()</code> when there
  972. * is no current row,
  973. * for example, when the cursor is positioned before the first row
  974. * or after the last row of the result set.
  975. *
  976. * @return <code>true</code> if the cursor is on a row;
  977. * <code>false</code> otherwise
  978. * @exception SQLException if a database access error occurs,
  979. * there is no current row, or the result set type is
  980. * <code>TYPE_FORWARD_ONLY</code>
  981. * @since 1.2
  982. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  983. * 2.0 API</a>
  984. */
  985. boolean relative( int rows ) throws SQLException;
  986. /**
  987. * Moves the cursor to the previous row in this
  988. * <code>ResultSet</code> object.
  989. *
  990. * <p><B>Note:</B> Calling the method <code>previous()</code> is not the same as
  991. * calling the method <code>relative(-1)</code> because it
  992. * makes sense to call</code>previous()</code> when there is no current row.
  993. *
  994. * @return <code>true</code> if the cursor is on a valid row;
  995. * <code>false</code> if it is off the result set
  996. * @exception SQLException if a database access error
  997. * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
  998. * @since 1.2
  999. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1000. * 2.0 API</a>
  1001. */
  1002. boolean previous() throws SQLException;
  1003. //---------------------------------------------------------------------
  1004. // Properties
  1005. //---------------------------------------------------------------------
  1006. /**
  1007. * The constant indicating that the rows in a result set will be
  1008. * processed in a forward direction; first-to-last.
  1009. * This constant is used by the method <code>setFetchDirection</code>
  1010. * as a hint to the driver, which the driver may ignore.
  1011. * @since 1.2
  1012. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1013. * 2.0 API</a>
  1014. */
  1015. int FETCH_FORWARD = 1000;
  1016. /**
  1017. * The constant indicating that the rows in a result set will be
  1018. * processed in a reverse direction; last-to-first.
  1019. * This constant is used by the method <code>setFetchDirection</code>
  1020. * as a hint to the driver, which the driver may ignore.
  1021. * @since 1.2
  1022. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1023. * 2.0 API</a>
  1024. */
  1025. int FETCH_REVERSE = 1001;
  1026. /**
  1027. * The constant indicating that the order in which rows in a
  1028. * result set will be processed is unknown.
  1029. * This constant is used by the method <code>setFetchDirection</code>
  1030. * as a hint to the driver, which the driver may ignore.
  1031. */
  1032. int FETCH_UNKNOWN = 1002;
  1033. /**
  1034. * Gives a hint as to the direction in which the rows in this
  1035. * <code>ResultSet</code> object will be processed.
  1036. * The initial value is determined by the
  1037. * <code>Statement</code> object
  1038. * that produced this <code>ResultSet</code> object.
  1039. * The fetch direction may be changed at any time.
  1040. *
  1041. * @exception SQLException if a database access error occurs or
  1042. * the result set type is <code>TYPE_FORWARD_ONLY</code> and the fetch
  1043. * direction is not <code>FETCH_FORWARD</code>
  1044. * @since 1.2
  1045. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1046. * 2.0 API</a>
  1047. * @see Statement#setFetchDirection
  1048. */
  1049. void setFetchDirection(int direction) throws SQLException;
  1050. /**
  1051. * Returns the fetch direction for this
  1052. * <code>ResultSet</code> object.
  1053. *
  1054. * @return the current fetch direction for this <code>ResultSet</code> object
  1055. * @exception SQLException if a database access error occurs
  1056. * @since 1.2
  1057. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1058. * 2.0 API</a>
  1059. */
  1060. int getFetchDirection() throws SQLException;
  1061. /**
  1062. * Gives the JDBC driver a hint as to the number of rows that should
  1063. * be fetched from the database when more rows are needed for this
  1064. * <code>ResultSet</code> object.
  1065. * If the fetch size specified is zero, the JDBC driver
  1066. * ignores the value and is free to make its own best guess as to what
  1067. * the fetch size should be. The default value is set by the
  1068. * <code>Statement</code> object
  1069. * that created the result set. The fetch size may be changed at any time.
  1070. *
  1071. * @param rows the number of rows to fetch
  1072. * @exception SQLException if a database access error occurs or the
  1073. * condition <code>0 <= rows <= this.getMaxRows()</code> is not satisfied
  1074. * @since 1.2
  1075. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1076. * 2.0 API</a>
  1077. */
  1078. void setFetchSize(int rows) throws SQLException;
  1079. /**
  1080. *
  1081. * Returns the fetch size for this
  1082. * <code>ResultSet</code> object.
  1083. *
  1084. * @return the current fetch size for this <code>ResultSet</code> object
  1085. * @exception SQLException if a database access error occurs
  1086. * @since 1.2
  1087. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1088. * 2.0 API</a>
  1089. */
  1090. int getFetchSize() throws SQLException;
  1091. /**
  1092. * The constant indicating the type for a <code>ResultSet</code> object
  1093. * whose cursor may move only forward.
  1094. * @since 1.2
  1095. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1096. * 2.0 API</a>
  1097. */
  1098. int TYPE_FORWARD_ONLY = 1003;
  1099. /**
  1100. * The constant indicating the type for a <code>ResultSet</code> object
  1101. * that is scrollable but generally not sensitive to changes made by others.
  1102. * @since 1.2
  1103. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1104. * 2.0 API</a>
  1105. *
  1106. */
  1107. int TYPE_SCROLL_INSENSITIVE = 1004;
  1108. /**
  1109. * The constant indicating the type for a <code>ResultSet</code> object
  1110. * that is scrollable and generally sensitive to changes made by others.
  1111. * @since 1.2
  1112. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1113. * 2.0 API</a>
  1114. */
  1115. int TYPE_SCROLL_SENSITIVE = 1005;
  1116. /**
  1117. * Returns the type of this <code>ResultSet</code> object.
  1118. * The type is determined by the <code>Statement</code> object
  1119. * that created the result set.
  1120. *
  1121. * @return <code>TYPE_FORWARD_ONLY</code>,
  1122. * <code>TYPE_SCROLL_INSENSITIVE</code>,
  1123. * or <code>TYPE_SCROLL_SENSITIVE</code>
  1124. * @exception SQLException if a database access error occurs
  1125. * @since 1.2
  1126. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1127. * 2.0 API</a>
  1128. */
  1129. int getType() throws SQLException;
  1130. /**
  1131. * The constant indicating the concurrency mode for a
  1132. * <code>ResultSet</code> object that may NOT be updated.
  1133. * @since 1.2
  1134. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1135. * 2.0 API</a>
  1136. *
  1137. */
  1138. int CONCUR_READ_ONLY = 1007;
  1139. /**
  1140. * The constant indicating the concurrency mode for a
  1141. * <code>ResultSet</code> object that may be updated.
  1142. * @since 1.2
  1143. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1144. * 2.0 API</a>
  1145. *
  1146. */
  1147. int CONCUR_UPDATABLE = 1008;
  1148. /**
  1149. * Returns the concurrency mode of this <code>ResultSet</code> object.
  1150. * The concurrency used is determined by the
  1151. * <code>Statement</code> object that created the result set.
  1152. *
  1153. * @return the concurrency type, either <code>CONCUR_READ_ONLY</code>
  1154. * or <code>CONCUR_UPDATABLE</code>
  1155. * @exception SQLException if a database access error occurs
  1156. * @since 1.2
  1157. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1158. * 2.0 API</a>
  1159. */
  1160. int getConcurrency() throws SQLException;
  1161. //---------------------------------------------------------------------
  1162. // Updates
  1163. //---------------------------------------------------------------------
  1164. /**
  1165. * Indicates whether the current row has been updated. The value returned
  1166. * depends on whether or not the result set can detect updates.
  1167. *
  1168. * @return <code>true</code> if the row has been visibly updated
  1169. * by the owner or another, and updates are detected
  1170. * @exception SQLException if a database access error occurs
  1171. *
  1172. * @see DatabaseMetaData#updatesAreDetected
  1173. * @since 1.2
  1174. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1175. * 2.0 API</a>
  1176. */
  1177. boolean rowUpdated() throws SQLException;
  1178. /**
  1179. * Indicates whether the current row has had an insertion.
  1180. * The value returned depends on whether or not this
  1181. * <code>ResultSet</code> object can detect visible inserts.
  1182. *
  1183. * @return <code>true</code> if a row has had an insertion
  1184. * and insertions are detected; <code>false</code> otherwise
  1185. * @exception SQLException if a database access error occurs
  1186. *
  1187. * @see DatabaseMetaData#insertsAreDetected
  1188. * @since 1.2
  1189. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1190. * 2.0 API</a>
  1191. */
  1192. boolean rowInserted() throws SQLException;
  1193. /**
  1194. * Indicates whether a row has been deleted. A deleted row may leave
  1195. * a visible "hole" in a result set. This method can be used to
  1196. * detect holes in a result set. The value returned depends on whether
  1197. * or not this <code>ResultSet</code> object can detect deletions.
  1198. *
  1199. * @return <code>true</code> if a row was deleted and deletions are detected;
  1200. * <code>false</code> otherwise
  1201. * @exception SQLException if a database access error occurs
  1202. *
  1203. * @see DatabaseMetaData#deletesAreDetected
  1204. * @since 1.2
  1205. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1206. * 2.0 API</a>
  1207. */
  1208. boolean rowDeleted() throws SQLException;
  1209. /**
  1210. * Gives a nullable column a null value.
  1211. *
  1212. * The <code>updateXXX</code> methods are used to update column values in the
  1213. * current row or the insert row. The <code>updateXXX</code> methods do not
  1214. * update the underlying database; instead the <code>updateRow</code>
  1215. * or <code>insertRow</code> methods are called to update the database.
  1216. *
  1217. * @param columnIndex the first column is 1, the second is 2, ...
  1218. * @exception SQLException if a database access error occurs
  1219. * @since 1.2
  1220. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1221. * 2.0 API</a>
  1222. */
  1223. void updateNull(int columnIndex) throws SQLException;
  1224. /**
  1225. * Updates the designated column with a <code>boolean</code> value.
  1226. * The <code>updateXXX</code> methods are used to update column values in the
  1227. * current row or the insert row. The <code>updateXXX</code> methods do not
  1228. * update the underlying database; instead the <code>updateRow</code> or
  1229. * <code>insertRow</code> methods are called to update the database.
  1230. *
  1231. * @param columnIndex the first column is 1, the second is 2, ...
  1232. * @param x the new column value
  1233. * @exception SQLException if a database access error occurs
  1234. * @since 1.2
  1235. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1236. * 2.0 API</a>
  1237. */
  1238. void updateBoolean(int columnIndex, boolean x) throws SQLException;
  1239. /**
  1240. * Updates the designated column with a <code>byte</code> value.
  1241. * The <code>updateXXX</code> methods are used to update column values in the
  1242. * current row or the insert row. The <code>updateXXX</code> methods do not
  1243. * update the underlying database; instead the <code>updateRow</code> or
  1244. * <code>insertRow</code> methods are called to update the database.
  1245. *
  1246. *
  1247. * @param columnIndex the first column is 1, the second is 2, ...
  1248. * @param x the new column value
  1249. * @exception SQLException if a database access error occurs
  1250. * @since 1.2
  1251. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1252. * 2.0 API</a>
  1253. */
  1254. void updateByte(int columnIndex, byte x) throws SQLException;
  1255. /**
  1256. * Updates the designated column with a <code>short</code> value.
  1257. * The <code>updateXXX</code> methods are used to update column values in the
  1258. * current row or the insert row. The <code>updateXXX</code> methods do not
  1259. * update the underlying database; instead the <code>updateRow</code> or
  1260. * <code>insertRow</code> methods are called to update the database.
  1261. *
  1262. * @param columnIndex the first column is 1, the second is 2, ...
  1263. * @param x the new column value
  1264. * @exception SQLException if a database access error occurs
  1265. * @since 1.2
  1266. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1267. * 2.0 API</a>
  1268. */
  1269. void updateShort(int columnIndex, short x) throws SQLException;
  1270. /**
  1271. * Updates the designated column with an <code>int</code> value.
  1272. * The <code>updateXXX</code> methods are used to update column values in the
  1273. * current row or the insert row. The <code>updateXXX</code> methods do not
  1274. * update the underlying database; instead the <code>updateRow</code> or
  1275. * <code>insertRow</code> methods are called to update the database.
  1276. *
  1277. * @param columnIndex the first column is 1, the second is 2, ...
  1278. * @param x the new column value
  1279. * @exception SQLException if a database access error occurs
  1280. * @since 1.2
  1281. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1282. * 2.0 API</a>
  1283. */
  1284. void updateInt(int columnIndex, int x) throws SQLException;
  1285. /**
  1286. * Updates the designated column with a <code>long</code> value.
  1287. * The <code>updateXXX</code> methods are used to update column values in the
  1288. * current row or the insert row. The <code>updateXXX</code> methods do not
  1289. * update the underlying database; instead the <code>updateRow</code> or
  1290. * <code>insertRow</code> methods are called to update the database.
  1291. *
  1292. * @param columnIndex the first column is 1, the second is 2, ...
  1293. * @param x the new column value
  1294. * @exception SQLException if a database access error occurs
  1295. * @since 1.2
  1296. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1297. * 2.0 API</a>
  1298. */
  1299. void updateLong(int columnIndex, long x) throws SQLException;
  1300. /**
  1301. * Updates the designated column with a <code>float</code> value.
  1302. * The <code>updateXXX</code> methods are used to update column values in the
  1303. * current row or the insert row. The <code>updateXXX</code> methods do not
  1304. * update the underlying database; instead the <code>updateRow</code> or
  1305. * <code>insertRow</code> methods are called to update the database.
  1306. *
  1307. * @param columnIndex the first column is 1, the second is 2, ...
  1308. * @param x the new column value
  1309. * @exception SQLException if a database access error occurs
  1310. * @since 1.2
  1311. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1312. * 2.0 API</a>
  1313. */
  1314. void updateFloat(int columnIndex, float x) throws SQLException;
  1315. /**
  1316. * Updates the designated column with a <code>double</code> value.
  1317. * The <code>updateXXX</code> methods are used to update column values in the
  1318. * current row or the insert row. The <code>updateXXX</code> methods do not
  1319. * update the underlying database; instead the <code>updateRow</code> or
  1320. * <code>insertRow</code> methods are called to update the database.
  1321. *
  1322. * @param columnIndex the first column is 1, the second is 2, ...
  1323. * @param x the new column value
  1324. * @exception SQLException if a database access error occurs
  1325. * @since 1.2
  1326. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1327. * 2.0 API</a>
  1328. */
  1329. void updateDouble(int columnIndex, double x) throws SQLException;
  1330. /**
  1331. * Updates the designated column with a <code>java.math.BigDecimal</code>
  1332. * value.
  1333. * The <code>updateXXX</code> methods are used to update column values in the
  1334. * current row or the insert row. The <code>updateXXX</code> methods do not
  1335. * update the underlying database; instead the <code>updateRow</code> or
  1336. * <code>insertRow</code> methods are called to update the database.
  1337. *
  1338. * @param columnIndex the first column is 1, the second is 2, ...
  1339. * @param x the new column value
  1340. * @exception SQLException if a database access error occurs
  1341. * @since 1.2
  1342. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1343. * 2.0 API</a>
  1344. */
  1345. void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException;
  1346. /**
  1347. * Updates the designated column with a <code>String</code> value.
  1348. * The <code>updateXXX</code> methods are used to update column values in the
  1349. * current row or the insert row. The <code>updateXXX</code> methods do not
  1350. * update the underlying database; instead the <code>updateRow</code> or
  1351. * <code>insertRow</code> methods are called to update the database.
  1352. *
  1353. * @param columnIndex the first column is 1, the second is 2, ...
  1354. * @param x the new column value
  1355. * @exception SQLException if a database access error occurs
  1356. * @since 1.2
  1357. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1358. * 2.0 API</a>
  1359. */
  1360. void updateString(int columnIndex, String x) throws SQLException;
  1361. /**
  1362. * Updates the designated column with a <code>byte</code> array value.
  1363. * The <code>updateXXX</code> methods are used to update column values in the
  1364. * current row or the insert row. The <code>updateXXX</code> methods do not
  1365. * update the underlying database; instead the <code>updateRow</code> or
  1366. * <code>insertRow</code> methods are called to update the database.
  1367. *
  1368. * @param columnIndex the first column is 1, the second is 2, ...
  1369. * @param x the new column value
  1370. * @exception SQLException if a database access error occurs
  1371. * @since 1.2
  1372. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1373. * 2.0 API</a>
  1374. */
  1375. void updateBytes(int columnIndex, byte x[]) throws SQLException;
  1376. /**
  1377. * Updates the designated column with a <code>java.sql.Date</code> value.
  1378. * The <code>updateXXX</code> methods are used to update column values in the
  1379. * current row or the insert row. The <code>updateXXX</code> methods do not
  1380. * update the underlying database; instead the <code>updateRow</code> or
  1381. * <code>insertRow</code> methods are called to update the database.
  1382. *
  1383. * @param columnIndex the first column is 1, the second is 2, ...
  1384. * @param x the new column value
  1385. * @exception SQLException if a database access error occurs
  1386. * @since 1.2
  1387. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1388. * 2.0 API</a>
  1389. */
  1390. void updateDate(int columnIndex, java.sql.Date x) throws SQLException;
  1391. /**
  1392. * Updates the designated column with a <code>java.sql.Time</code> value.
  1393. * The <code>updateXXX</code> methods are used to update column values in the
  1394. * current row or the insert row. The <code>updateXXX</code> methods do not
  1395. * update the underlying database; instead the <code>updateRow</code> or
  1396. * <code>insertRow</code> methods are called to update the database.
  1397. *
  1398. * @param columnIndex the first column is 1, the second is 2, ...
  1399. * @param x the new column value
  1400. * @exception SQLException if a database access error occurs
  1401. * @since 1.2
  1402. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1403. * 2.0 API</a>
  1404. */
  1405. void updateTime(int columnIndex, java.sql.Time x) throws SQLException;
  1406. /**
  1407. * Updates the designated column with a <code>java.sql.Timestamp</code>
  1408. * value.
  1409. * The <code>updateXXX</code> methods are used to update column values in the
  1410. * current row or the insert row. The <code>updateXXX</code> methods do not
  1411. * update the underlying database; instead the <code>updateRow</code> or
  1412. * <code>insertRow</code> methods are called to update the database.
  1413. *
  1414. * @param columnIndex the first column is 1, the second is 2, ...
  1415. * @param x the new column value
  1416. * @exception SQLException if a database access error occurs
  1417. * @since 1.2
  1418. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1419. * 2.0 API</a>
  1420. */
  1421. void updateTimestamp(int columnIndex, java.sql.Timestamp x)
  1422. throws SQLException;
  1423. /**
  1424. * Updates the designated column with an ascii stream value.
  1425. * The <code>updateXXX</code> methods are used to update column values in the
  1426. * current row or the insert row. The <code>updateXXX</code> methods do not
  1427. * update the underlying database; instead the <code>updateRow</code> or
  1428. * <code>insertRow</code> methods are called to update the database.
  1429. *
  1430. * @param columnIndex the first column is 1, the second is 2, ...
  1431. * @param x the new column value
  1432. * @param length the length of the stream
  1433. * @exception SQLException if a database access error occurs
  1434. * @since 1.2
  1435. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1436. * 2.0 API</a>
  1437. */
  1438. void updateAsciiStream(int columnIndex,
  1439. java.io.InputStream x,
  1440. int length) throws SQLException;
  1441. /**
  1442. * Updates the designated column with a binary stream value.
  1443. * The <code>updateXXX</code> methods are used to update column values in the
  1444. * current row or the insert row. The <code>updateXXX</code> methods do not
  1445. * update the underlying database; instead the <code>updateRow</code> or
  1446. * <code>insertRow</code> methods are called to update the database.
  1447. *
  1448. * @param columnIndex the first column is 1, the second is 2, ...
  1449. * @param x the new column value
  1450. * @param length the length of the stream
  1451. * @exception SQLException if a database access error occurs
  1452. * @since 1.2
  1453. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1454. * 2.0 API</a>
  1455. */
  1456. void updateBinaryStream(int columnIndex,
  1457. java.io.InputStream x,
  1458. int length) throws SQLException;
  1459. /**
  1460. * Updates the designated column with a character stream value.
  1461. * The <code>updateXXX</code> methods are used to update column values in the
  1462. * current row or the insert row. The <code>updateXXX</code> methods do not
  1463. * update the underlying database; instead the <code>updateRow</code> or
  1464. * <code>insertRow</code> methods are called to update the database.
  1465. *
  1466. * @param columnIndex the first column is 1, the second is 2, ...
  1467. * @param x the new column value
  1468. * @param length the length of the stream
  1469. * @exception SQLException if a database access error occurs
  1470. * @since 1.2
  1471. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1472. * 2.0 API</a>
  1473. */
  1474. void updateCharacterStream(int columnIndex,
  1475. java.io.Reader x,
  1476. int length) throws SQLException;
  1477. /**
  1478. * Updates the designated column with an <code>Object</code> value.
  1479. * The <code>updateXXX</code> methods are used to update column values in the
  1480. * current row or the insert row. The <code>updateXXX</code> methods do not
  1481. * update the underlying database; instead the <code>updateRow</code> or
  1482. * <code>insertRow</code> methods are called to update the database.
  1483. *
  1484. * @param columnIndex the first column is 1, the second is 2, ...
  1485. * @param x the new column value
  1486. * @param scale for <code>java.sql.Types.DECIMA</code>
  1487. * or <code>java.sql.Types.NUMERIC</code> types,
  1488. * this is the number of digits after the decimal point. For all other
  1489. * types this value will be ignored.
  1490. * @exception SQLException if a database access error occurs
  1491. * @since 1.2
  1492. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1493. * 2.0 API</a>
  1494. */
  1495. void updateObject(int columnIndex, Object x, int scale)
  1496. throws SQLException;
  1497. /**
  1498. * Updates the designated column with an <code>Object</code> value.
  1499. * The <code>updateXXX</code> methods are used to update column values in the
  1500. * current row or the insert row. The <code>updateXXX</code> methods do not
  1501. * update the underlying database; instead the <code>updateRow</code> or
  1502. * <code>insertRow</code> methods are called to update the database.
  1503. *
  1504. * @param columnIndex the first column is 1, the second is 2, ...
  1505. * @param x the new column value
  1506. * @exception SQLException if a database access error occurs
  1507. * @since 1.2
  1508. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1509. * 2.0 API</a>
  1510. */
  1511. void updateObject(int columnIndex, Object x) throws SQLException;
  1512. /**
  1513. * Updates the designated column with a <code>null</code> value.
  1514. * The <code>updateXXX</code> methods are used to update column values in the
  1515. * current row or the insert row. The <code>updateXXX</code> methods do not
  1516. * update the underlying database; instead the <code>updateRow</code> or
  1517. * <code>insertRow</code> methods are called to update the database.
  1518. *
  1519. * @param columnName the name of the column
  1520. * @exception SQLException if a database access error occurs
  1521. * @since 1.2
  1522. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1523. * 2.0 API</a>
  1524. */
  1525. void updateNull(String columnName) throws SQLException;
  1526. /**
  1527. * Updates the designated column with a <code>boolean</code> value.
  1528. * The <code>updateXXX</code> methods are used to update column values in the
  1529. * current row or the insert row. The <code>updateXXX</code> methods do not
  1530. * update the underlying database; instead the <code>updateRow</code> or
  1531. * <code>insertRow</code> methods are called to update the database.
  1532. *
  1533. * @param columnName the name of the column
  1534. * @param x the new column value
  1535. * @exception SQLException if a database access error occurs
  1536. * @since 1.2
  1537. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1538. * 2.0 API</a>
  1539. */
  1540. void updateBoolean(String columnName, boolean x) throws SQLException;
  1541. /**
  1542. * Updates the designated column with a <code>byte</code> value.
  1543. * The <code>updateXXX</code> methods are used to update column values in the
  1544. * current row or the insert row. The <code>updateXXX</code> methods do not
  1545. * update the underlying database; instead the <code>updateRow</code> or
  1546. * <code>insertRow</code> methods are called to update the database.
  1547. *
  1548. * @param columnName the name of the column
  1549. * @param x the new column value
  1550. * @exception SQLException if a database access error occurs
  1551. * @since 1.2
  1552. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1553. * 2.0 API</a>
  1554. */
  1555. void updateByte(String columnName, byte x) throws SQLException;
  1556. /**
  1557. * Updates the designated column with a <code>short</code> value.
  1558. * The <code>updateXXX</code> methods are used to update column values in the
  1559. * current row or the insert row. The <code>updateXXX</code> methods do not
  1560. * update the underlying database; instead the <code>updateRow</code> or
  1561. * <code>insertRow</code> methods are called to update the database.
  1562. *
  1563. * @param columnName the name of the column
  1564. * @param x the new column value
  1565. * @exception SQLException if a database access error occurs
  1566. * @since 1.2
  1567. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1568. * 2.0 API</a>
  1569. */
  1570. void updateShort(String columnName, short x) throws SQLException;
  1571. /**
  1572. * Updates the designated column with an <code>int</code> value.
  1573. * The <code>updateXXX</code> methods are used to update column values in the
  1574. * current row or the insert row. The <code>updateXXX</code> methods do not
  1575. * update the underlying database; instead the <code>updateRow</code> or
  1576. * <code>insertRow</code> methods are called to update the database.
  1577. *
  1578. * @param columnName the name of the column
  1579. * @param x the new column value
  1580. * @exception SQLException if a database access error occurs
  1581. * @since 1.2
  1582. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1583. * 2.0 API</a>
  1584. */
  1585. void updateInt(String columnName, int x) throws SQLException;
  1586. /**
  1587. * Updates the designated column with a <code>long</code> value.
  1588. * The <code>updateXXX</code> methods are used to update column values in the
  1589. * current row or the insert row. The <code>updateXXX</code> methods do not
  1590. * update the underlying database; instead the <code>updateRow</code> or
  1591. * <code>insertRow</code> methods are called to update the database.
  1592. *
  1593. * @param columnName the name of the column
  1594. * @param x the new column value
  1595. * @exception SQLException if a database access error occurs
  1596. * @since 1.2
  1597. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1598. * 2.0 API</a>
  1599. */
  1600. void updateLong(String columnName, long x) throws SQLException;
  1601. /**
  1602. * Updates the designated column with a <code>float </code> value.
  1603. * The <code>updateXXX</code> methods are used to update column values in the
  1604. * current row or the insert row. The <code>updateXXX</code> methods do not
  1605. * update the underlying database; instead the <code>updateRow</code> or
  1606. * <code>insertRow</code> methods are called to update the database.
  1607. *
  1608. * @param columnName the name of the column
  1609. * @param x the new column value
  1610. * @exception SQLException if a database access error occurs
  1611. * @since 1.2
  1612. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1613. * 2.0 API</a>
  1614. */
  1615. void updateFloat(String columnName, float x) throws SQLException;
  1616. /**
  1617. * Updates the designated column with a <code>double</code> value.
  1618. * The <code>updateXXX</code> methods are used to update column values in the
  1619. * current row or the insert row. The <code>updateXXX</code> methods do not
  1620. * update the underlying database; instead the <code>updateRow</code> or
  1621. * <code>insertRow</code> methods are called to update the database.
  1622. *
  1623. * @param columnName the name of the column
  1624. * @param x the new column value
  1625. * @exception SQLException if a database access error occurs
  1626. * @since 1.2
  1627. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1628. * 2.0 API</a>
  1629. */
  1630. void updateDouble(String columnName, double x) throws SQLException;
  1631. /**
  1632. * Updates the designated column with a <code>java.sql.BigDecimal</code>
  1633. * value.
  1634. * The <code>updateXXX</code> methods are used to update column values in the
  1635. * current row or the insert row. The <code>updateXXX</code> methods do not
  1636. * update the underlying database; instead the <code>updateRow</code> or
  1637. * <code>insertRow</code> methods are called to update the database.
  1638. *
  1639. * @param columnName the name of the column
  1640. * @param x the new column value
  1641. * @exception SQLException if a database access error occurs
  1642. * @since 1.2
  1643. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1644. * 2.0 API</a>
  1645. */
  1646. void updateBigDecimal(String columnName, BigDecimal x) throws SQLException;
  1647. /**
  1648. * Updates the designated column with a <code>String</code> value.
  1649. * The <code>updateXXX</code> methods are used to update column values in the
  1650. * current row or the insert row. The <code>updateXXX</code> methods do not
  1651. * update the underlying database; instead the <code>updateRow</code> or
  1652. * <code>insertRow</code> methods are called to update the database.
  1653. *
  1654. * @param columnName the name of the column
  1655. * @param x the new column value
  1656. * @exception SQLException if a database access error occurs
  1657. * @since 1.2
  1658. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1659. * 2.0 API</a>
  1660. */
  1661. void updateString(String columnName, String x) throws SQLException;
  1662. /**
  1663. * Updates the designated column with a <code>boolean</code> value.
  1664. * The <code>updateXXX</code> methods are used to update column values in the
  1665. * current row or the insert row. The <code>updateXXX</code> methods do not
  1666. * update the underlying database; instead the <code>updateRow</code> or
  1667. * <code>insertRow</code> methods are called to update the database.
  1668. *
  1669. * JDBC 2.0
  1670. *
  1671. * Updates a column with a byte array value.
  1672. *
  1673. * The <code>updateXXX</code> methods are used to update column values in the
  1674. * current row, or the insert row. The <code>updateXXX</code> methods do not
  1675. * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
  1676. * methods are called to update the database.
  1677. *
  1678. * @param columnName the name of the column
  1679. * @param x the new column value
  1680. * @exception SQLException if a database access error occurs
  1681. * @since 1.2
  1682. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1683. * 2.0 API</a>
  1684. */
  1685. void updateBytes(String columnName, byte x[]) throws SQLException;
  1686. /**
  1687. * Updates the designated column with a <code>java.sql.Date</code> value.
  1688. * The <code>updateXXX</code> methods are used to update column values in the
  1689. * current row or the insert row. The <code>updateXXX</code> methods do not
  1690. * update the underlying database; instead the <code>updateRow</code> or
  1691. * <code>insertRow</code> methods are called to update the database.
  1692. *
  1693. * @param columnName the name of the column
  1694. * @param x the new column value
  1695. * @exception SQLException if a database access error occurs
  1696. * @since 1.2
  1697. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1698. * 2.0 API</a>
  1699. */
  1700. void updateDate(String columnName, java.sql.Date x) throws SQLException;
  1701. /**
  1702. * Updates the designated column with a <code>java.sql.Time</code> value.
  1703. * The <code>updateXXX</code> methods are used to update column values in the
  1704. * current row or the insert row. The <code>updateXXX</code> methods do not
  1705. * update the underlying database; instead the <code>updateRow</code> or
  1706. * <code>insertRow</code> methods are called to update the database.
  1707. *
  1708. * @param columnName the name of the column
  1709. * @param x the new column value
  1710. * @exception SQLException if a database access error occurs
  1711. * @since 1.2
  1712. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1713. * 2.0 API</a>
  1714. */
  1715. void updateTime(String columnName, java.sql.Time x) throws SQLException;
  1716. /**
  1717. * Updates the designated column with a <code>java.sql.Timestamp</code>
  1718. * value.
  1719. * The <code>updateXXX</code> methods are used to update column values in the
  1720. * current row or the insert row. The <code>updateXXX</code> methods do not
  1721. * update the underlying database; instead the <code>updateRow</code> or
  1722. * <code>insertRow</code> methods are called to update the database.
  1723. *
  1724. * @param columnName the name of the column
  1725. * @param x the new column value
  1726. * @exception SQLException if a database access error occurs
  1727. * @since 1.2
  1728. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1729. * 2.0 API</a>
  1730. */
  1731. void updateTimestamp(String columnName, java.sql.Timestamp x)
  1732. throws SQLException;
  1733. /**
  1734. * Updates the designated column with an ascii stream value.
  1735. * The <code>updateXXX</code> methods are used to update column values in the
  1736. * current row or the insert row. The <code>updateXXX</code> methods do not
  1737. * update the underlying database; instead the <code>updateRow</code> or
  1738. * <code>insertRow</code> methods are called to update the database.
  1739. *
  1740. * @param columnName the name of the column
  1741. * @param x the new column value
  1742. * @param length the length of the stream
  1743. * @exception SQLException if a database access error occurs
  1744. * @since 1.2
  1745. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1746. * 2.0 API</a>
  1747. */
  1748. void updateAsciiStream(String columnName,
  1749. java.io.InputStream x,
  1750. int length) throws SQLException;
  1751. /**
  1752. * Updates the designated column with a binary stream value.
  1753. * The <code>updateXXX</code> methods are used to update column values in the
  1754. * current row or the insert row. The <code>updateXXX</code> methods do not
  1755. * update the underlying database; instead the <code>updateRow</code> or
  1756. * <code>insertRow</code> methods are called to update the database.
  1757. *
  1758. * @param columnName the name of the column
  1759. * @param x the new column value
  1760. * @param length the length of the stream
  1761. * @exception SQLException if a database access error occurs
  1762. * @since 1.2
  1763. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1764. * 2.0 API</a>
  1765. */
  1766. void updateBinaryStream(String columnName,
  1767. java.io.InputStream x,
  1768. int length) throws SQLException;
  1769. /**
  1770. * Updates the designated column with a character stream value.
  1771. * The <code>updateXXX</code> methods are used to update column values in the
  1772. * current row or the insert row. The <code>updateXXX</code> methods do not
  1773. * update the underlying database; instead the <code>updateRow</code> or
  1774. * <code>insertRow</code> methods are called to update the database.
  1775. *
  1776. * @param columnName the name of the column
  1777. * @param x the new column value
  1778. * @param length the length of the stream
  1779. * @exception SQLException if a database access error occurs
  1780. * @since 1.2
  1781. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1782. * 2.0 API</a>
  1783. */
  1784. void updateCharacterStream(String columnName,
  1785. java.io.Reader reader,
  1786. int length) throws SQLException;
  1787. /**
  1788. * Updates the designated column with an <code>Object</code> value.
  1789. * The <code>updateXXX</code> methods are used to update column values in the
  1790. * current row or the insert row. The <code>updateXXX</code> methods do not
  1791. * update the underlying database; instead the <code>updateRow</code> or
  1792. * <code>insertRow</code> methods are called to update the database.
  1793. *
  1794. * @param columnName the name of the column
  1795. * @param x the new column value
  1796. * @param scale for <code>java.sql.Types.DECIMA</code>
  1797. * or <code>java.sql.Types.NUMERIC</code> types,
  1798. * this is the number of digits after the decimal point. For all other
  1799. * types this value will be ignored.
  1800. * @exception SQLException if a database access error occurs
  1801. * @since 1.2
  1802. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1803. * 2.0 API</a>
  1804. */
  1805. void updateObject(String columnName, Object x, int scale)
  1806. throws SQLException;
  1807. /**
  1808. * Updates the designated column with an <code>Object</code> value.
  1809. * The <code>updateXXX</code> methods are used to update column values in the
  1810. * current row or the insert row. The <code>updateXXX</code> methods do not
  1811. * update the underlying database; instead the <code>updateRow</code> or
  1812. * <code>insertRow</code> methods are called to update the database.
  1813. *
  1814. * @param columnName the name of the column
  1815. * @param x the new column value
  1816. * @exception SQLException if a database access error occurs
  1817. * @since 1.2
  1818. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1819. * 2.0 API</a>
  1820. */
  1821. void updateObject(String columnName, Object x) throws SQLException;
  1822. /**
  1823. * Inserts the contents of the insert row into this
  1824. * <code>ResultSet</code> objaect and into the database.
  1825. * The cursor must be on the insert row when this method is called.
  1826. *
  1827. * @exception SQLException if a database access error occurs,
  1828. * if this method is called when the cursor is not on the insert row,
  1829. * or if not all of non-nullable columns in
  1830. * the insert row have been given a value
  1831. * @since 1.2
  1832. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1833. * 2.0 API</a>
  1834. */
  1835. void insertRow() throws SQLException;
  1836. /**
  1837. * Updates the underlying database with the new contents of the
  1838. * current row of this <code>ResultSet</code> object.
  1839. * This method cannot be called when the cursor is on the insert row.
  1840. *
  1841. * @exception SQLException if a database access error occurs or
  1842. * if this method is called when the cursor is on the insert row
  1843. * @since 1.2
  1844. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1845. * 2.0 API</a>
  1846. */
  1847. void updateRow() throws SQLException;
  1848. /**
  1849. * Deletes the current row from this <code>ResultSet</code> object
  1850. * and from the underlying database. This method cannot be called when
  1851. * the cursor is on the insert row.
  1852. *
  1853. * @exception SQLException if a database access error occurs
  1854. * or if this method is called when the cursor is on the insert row
  1855. * @since 1.2
  1856. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1857. * 2.0 API</a>
  1858. */
  1859. void deleteRow() throws SQLException;
  1860. /**
  1861. * Refreshes the current row with its most recent value in
  1862. * the database. This method cannot be called when
  1863. * the cursor is on the insert row.
  1864. *
  1865. * <P>The <code>refreshRow</code> method provides a way for an
  1866. * application to
  1867. * explicitly tell the JDBC driver to refetch a row(s) from the
  1868. * database. An application may want to call <code>refreshRow</code> when
  1869. * caching or prefetching is being done by the JDBC driver to
  1870. * fetch the latest value of a row from the database. The JDBC driver
  1871. * may actually refresh multiple rows at once if the fetch size is
  1872. * greater than one.
  1873. *
  1874. * <P> All values are refetched subject to the transaction isolation
  1875. * level and cursor sensitivity. If <code>refreshRow</code> is called after
  1876. * calling an <code>updateXXX</code> method, but before calling
  1877. * the method <code>updateRow</code>, then the
  1878. * updates made to the row are lost. Calling the method
  1879. * <code>refreshRow</code> frequently will likely slow performance.
  1880. *
  1881. * @exception SQLException if a database access error
  1882. * occurs or if this method is called when the cursor is on the insert row
  1883. * @since 1.2
  1884. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1885. * 2.0 API</a>
  1886. */
  1887. void refreshRow() throws SQLException;
  1888. /**
  1889. * Cancels the updates made to the current row in this
  1890. * <code>ResultSet</code> object.
  1891. * This method may be called after calling an
  1892. * <code>updateXXX</code> method(s) and before calling
  1893. * the method <code>updateRow</code> to roll back
  1894. * the updates made to a row. If no updates have been made or
  1895. * <code>updateRow</code> has already been called, this method has no
  1896. * effect.
  1897. *
  1898. * @exception SQLException if a database access error
  1899. * occurs or if this method is called when the cursor is on the insert row
  1900. * @since 1.2
  1901. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1902. * 2.0 API</a>
  1903. */
  1904. void cancelRowUpdates() throws SQLException;
  1905. /**
  1906. * Moves the cursor to the insert row. The current cursor position is
  1907. * remembered while the cursor is positioned on the insert row.
  1908. *
  1909. * The insert row is a special row associated with an updatable
  1910. * result set. It is essentially a buffer where a new row may
  1911. * be constructed by calling the <code>updateXXX</code> methods prior to
  1912. * inserting the row into the result set.
  1913. *
  1914. * Only the <code>updateXXX</code>, <code>getXXX</code>,
  1915. * and <code>insertRow</code> methods may be
  1916. * called when the cursor is on the insert row. All of the columns in
  1917. * a result set must be given a value each time this method is
  1918. * called before calling <code>insertRow</code>.
  1919. * An <code>updateXXX</code> method must be called before a
  1920. * <code>getXXX</code> method can be called on a column value.
  1921. *
  1922. * @exception SQLException if a database access error occurs
  1923. * or the result set is not updatable
  1924. * @since 1.2
  1925. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1926. * 2.0 API</a>
  1927. */
  1928. void moveToInsertRow() throws SQLException;
  1929. /**
  1930. * Moves the cursor to the remembered cursor position, usually the
  1931. * current row. This method has no effect if the cursor is not on
  1932. * the insert row.
  1933. *
  1934. * @exception SQLException if a database access error occurs
  1935. * or the result set is not updatable
  1936. * @since 1.2
  1937. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1938. * 2.0 API</a>
  1939. */
  1940. void moveToCurrentRow() throws SQLException;
  1941. /**
  1942. * Returns the <code>Statement</code> object that produced this
  1943. * <code>ResultSet</code> object.
  1944. * If the result set was generated some other way, such as by a
  1945. * <code>DatabaseMetaData</code> method, this method returns
  1946. * <code>null</code>.
  1947. *
  1948. * @return the <code>Statment</code> object that produced
  1949. * this <code>ResultSet</code> object or <code>null</code>
  1950. * if the result set was produced some other way
  1951. * @exception SQLException if a database access error occurs
  1952. * @since 1.2
  1953. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1954. * 2.0 API</a>
  1955. */
  1956. Statement getStatement() throws SQLException;
  1957. /**
  1958. * Returns the value of the designated column in the current row
  1959. * of this <code>ResultSet</code> object as an <code>Object</code>
  1960. * in the Java programming language.
  1961. * This method uses the given <code>Map</code> object
  1962. * for the custom mapping of the
  1963. * SQL structured or distinct type that is being retrieved.
  1964. *
  1965. * @param i the first column is 1, the second is 2, ...
  1966. * @param map a <code>java.util.Map</code> object that contains the mapping
  1967. * from SQL type names to classes in the Java programming language
  1968. * @return an <code>Object</code> in the Java programming language
  1969. * representing the SQL value
  1970. * @since 1.2
  1971. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1972. * 2.0 API</a>
  1973. */
  1974. Object getObject(int i, java.util.Map map) throws SQLException;
  1975. /**
  1976. * Returns the value of the designated column in the current row
  1977. * of this <code>ResultSet</code> object as a <code>Ref</code> object
  1978. * in the Java programming language.
  1979. *
  1980. * @param i the first column is 1, the second is 2, ...
  1981. * @return a <code>Ref</code> object representing an SQL <code>REF</code> value
  1982. * @since 1.2
  1983. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1984. * 2.0 API</a>
  1985. */
  1986. Ref getRef(int i) throws SQLException;
  1987. /**
  1988. * Returns the value of the designated column in the current row
  1989. * of this <code>ResultSet</code> object as a <code>Blob</code> object
  1990. * in the Java programming language.
  1991. *
  1992. * @param i the first column is 1, the second is 2, ...
  1993. * @return a <code>Blob</code> object representing the SQL <code>BLOB</code> value in
  1994. * the specified column
  1995. * @since 1.2
  1996. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  1997. * 2.0 API</a>
  1998. */
  1999. Blob getBlob(int i) throws SQLException;
  2000. /**
  2001. * Returns the value of the designated column in the current row
  2002. * of this <code>ResultSet</code> object as a <code>Clob</code> object
  2003. * in the Java programming language.
  2004. *
  2005. * @param i the first column is 1, the second is 2, ...
  2006. * @return a <code>Clob</code> object representing the SQL <code>CLOB</code> value in
  2007. * the specified column
  2008. * @since 1.2
  2009. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  2010. * 2.0 API</a>
  2011. */
  2012. Clob getClob(int i) throws SQLException;
  2013. /**
  2014. * Returns the value of the designated column in the current row
  2015. * of this <code>ResultSet</code> object as an <code>Array</code> object
  2016. * in the Java programming language.
  2017. *
  2018. * @param i the first column is 1, the second is 2, ...
  2019. * @return an <code>Array</code> object representing the SQL <code>ARRAY</code> value in
  2020. * the specified column
  2021. * @since 1.2
  2022. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  2023. * 2.0 API</a>
  2024. */
  2025. Array getArray(int i) throws SQLException;
  2026. /**
  2027. * Returns the value of the designated column in the current row
  2028. * of this <code>ResultSet</code> object as an <code>Object</code>
  2029. * in the Java programming language.
  2030. * This method uses the specified <code>Map</code> object for
  2031. * custom mapping if appropriate.
  2032. *
  2033. * @param colName the name of the column from which to retrieve the value
  2034. * @param map a <code>java.util.Map</code> object that contains the mapping
  2035. * from SQL type names to classes in the Java programming language
  2036. * @return an <code>Object</code> representing the SQL value in the specified column
  2037. * @since 1.2
  2038. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  2039. * 2.0 API</a>
  2040. */
  2041. Object getObject(String colName, java.util.Map map) throws SQLException;
  2042. /**
  2043. * Returns the value of the designated column in the current row
  2044. * of this <code>ResultSet</code> object as a <code>Ref</code> object
  2045. * in the Java programming language.
  2046. *
  2047. * @param colName the column name
  2048. * @return a <code>Ref</code> object representing the SQL <code>REF</code> value in
  2049. * the specified column
  2050. * @since 1.2
  2051. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  2052. * 2.0 API</a>
  2053. */
  2054. Ref getRef(String colName) throws SQLException;
  2055. /**
  2056. * Returns the value of the designated column in the current row
  2057. * of this <code>ResultSet</code> object as a <code>Blob</code> object
  2058. * in the Java programming language.
  2059. *
  2060. * @param colName the name of the column from which to retrieve the value
  2061. * @return a <code>Blob</code> object representing the SQL <code>BLOB</code> value in
  2062. * the specified column
  2063. * @since 1.2
  2064. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  2065. * 2.0 API</a>
  2066. */
  2067. Blob getBlob(String colName) throws SQLException;
  2068. /**
  2069. * Returns the value of the designated column in the current row
  2070. * of this <code>ResultSet</code> object as a <code>Clob</code> object
  2071. * in the Java programming language.
  2072. *
  2073. * @param colName the name of the column from which to retrieve the value
  2074. * @return a <code>Clob</code> object representing the SQL <code>CLOB</code>
  2075. * value in the specified column
  2076. * @since 1.2
  2077. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  2078. * 2.0 API</a>
  2079. */
  2080. Clob getClob(String colName) throws SQLException;
  2081. /**
  2082. * Returns the value of the designated column in the current row
  2083. * of this <code>ResultSet</code> object as an <code>Array</code> object
  2084. * in the Java programming language.
  2085. *
  2086. * @param colName the name of the column from which to retrieve the value
  2087. * @return an <code>Array</code> object representing the SQL <code>ARRAY</code> value in
  2088. * the specified column
  2089. * @since 1.2
  2090. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  2091. * 2.0 API</a>
  2092. */
  2093. Array getArray(String colName) throws SQLException;
  2094. /**
  2095. * Returns the value of the designated column in the current row
  2096. * of this <code>ResultSet</code> object as a <code>java.sql.Date</code> object
  2097. * in the Java programming language.
  2098. * This method uses the given calendar to construct an appropriate millisecond
  2099. * value for the date if the underlying database does not store
  2100. * timezone information.
  2101. *
  2102. * @param columnIndex the first column is 1, the second is 2, ...
  2103. * @param cal the <code>java.util.Calendar</code> object
  2104. * to use in constructing the date
  2105. * @return the column value as a <code>java.sql.Date</code> object;
  2106. * if the value is SQL <code>NULL</code>,
  2107. * the value returned is <code>null</code> in the Java programming language
  2108. * @exception SQLException if a database access error occurs
  2109. * @since 1.2
  2110. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  2111. * 2.0 API</a>
  2112. */
  2113. java.sql.Date getDate(int columnIndex, Calendar cal) throws SQLException;
  2114. /**
  2115. * Returns the value of the designated column in the current row
  2116. * of this <code>ResultSet</code> object as a <code>java.sql.Date</code> object
  2117. * in the Java programming language.
  2118. * This method uses the given calendar to construct an appropriate millisecond
  2119. * value for the date if the underlying database does not store
  2120. * timezone information.
  2121. *
  2122. * @param columnName the SQL name of the column from which to retrieve the value
  2123. * @param cal the <code>java.util.Calendar</code> object
  2124. * to use in constructing the date
  2125. * @return the column value as a <code>java.sql.Date</code> object;
  2126. * if the value is SQL <code>NULL</code>,
  2127. * the value returned is <code>null</code> in the Java programming language
  2128. * @exception SQLException if a database access error occurs
  2129. * @since 1.2
  2130. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  2131. * 2.0 API</a>
  2132. */
  2133. java.sql.Date getDate(String columnName, Calendar cal) throws SQLException;
  2134. /**
  2135. * Returns the value of the designated column in the current row
  2136. * of this <code>ResultSet</code> object as a <code>java.sql.Time</code> object
  2137. * in the Java programming language.
  2138. * This method uses the given calendar to construct an appropriate millisecond
  2139. * value for the time if the underlying database does not store
  2140. * timezone information.
  2141. *
  2142. * @param columnIndex the first column is 1, the second is 2, ...
  2143. * @param cal the <code>java.util.Calendar</code> object
  2144. * to use in constructing the time
  2145. * @return the column value as a <code>java.sql.Time</code> object;
  2146. * if the value is SQL <code>NULL</code>,
  2147. * the value returned is <code>null</code> in the Java programming language
  2148. * @exception SQLException if a database access error occurs
  2149. * @since 1.2
  2150. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  2151. * 2.0 API</a>
  2152. */
  2153. java.sql.Time getTime(int columnIndex, Calendar cal) throws SQLException;
  2154. /**
  2155. * Returns the value of the designated column in the current row
  2156. * of this <code>ResultSet</code> object as a <code>java.sql.Time</code> object
  2157. * in the Java programming language.
  2158. * This method uses the given calendar to construct an appropriate millisecond
  2159. * value for the time if the underlying database does not store
  2160. * timezone information.
  2161. *
  2162. * @param columnName the SQL name of the column
  2163. * @param cal the <code>java.util.Calendar</code> object
  2164. * to use in constructing the time
  2165. * @param cal the calendar to use in constructing the time
  2166. * @return the column value as a <code>java.sql.Time</code> object;
  2167. * if the value is SQL <code>NULL</code>,
  2168. * the value returned is <code>null</code> in the Java programming language
  2169. * @exception SQLException if a database access error occurs
  2170. * @since 1.2
  2171. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  2172. * 2.0 API</a>
  2173. */
  2174. java.sql.Time getTime(String columnName, Calendar cal) throws SQLException;
  2175. /**
  2176. * Returns the value of the designated column in the current row
  2177. * of this <code>ResultSet</code> object as a <code>java.sql.Timestamp</code> object
  2178. * in the Java programming language.
  2179. * This method uses the given calendar to construct an appropriate millisecond
  2180. * value for the timestamp if the underlying database does not store
  2181. * timezone information.
  2182. *
  2183. * @param columnIndex the first column is 1, the second is 2, ...
  2184. * @param cal the <code>java.util.Calendar</code> object
  2185. * to use in constructing the timestamp
  2186. * @return the column value as a <code>java.sql.Timestamp</code> object;
  2187. * if the value is SQL <code>NULL</code>,
  2188. * the value returned is <code>null</code> in the Java programming language
  2189. * @exception SQLException if a database access error occurs
  2190. * @since 1.2
  2191. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  2192. * 2.0 API</a>
  2193. */
  2194. java.sql.Timestamp getTimestamp(int columnIndex, Calendar cal)
  2195. throws SQLException;
  2196. /**
  2197. * Returns the value of the designated column in the current row
  2198. * of this <code>ResultSet</code> object as a <code>java.sql.Timestamp</code> object
  2199. * in the Java programming language.
  2200. * This method uses the given calendar to construct an appropriate millisecond
  2201. * value for the timestamp if the underlying database does not store
  2202. * timezone information.
  2203. *
  2204. * @param columnName the SQL name of the column
  2205. * @param cal the <code>java.util.Calendar</code> object
  2206. * to use in constructing the date
  2207. * @return the column value as a <code>java.sql.Timestamp</code> object;
  2208. * if the value is SQL <code>NULL</code>,
  2209. * the value returned is <code>null</code> in the Java programming language
  2210. * @exception SQLException if a database access error occurs
  2211. * @since 1.2
  2212. * @see <a href="package-summary.html#2.0 API">What Is in the JDBC
  2213. * 2.0 API</a>
  2214. */
  2215. java.sql.Timestamp getTimestamp(String columnName, Calendar cal)
  2216. throws SQLException;
  2217. }