1. /*
  2. * @(#)ResultSet.java 1.44 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.sql;
  8. import java.math.BigDecimal;
  9. import java.util.Calendar;
  10. /**
  11. * A table of data representing a database result set, which
  12. * is usually generated by executing a statement that queries the database.
  13. *
  14. * <P>A <code>ResultSet</code> object maintains a cursor pointing
  15. * to its current row of data. Initially the cursor is positioned
  16. * before the first row. The <code>next</code> method moves the
  17. * cursor to the next row, and because it returns <code>false</code>
  18. * when there are no more rows in the <code>ResultSet</code> object,
  19. * it can be used in a <code>while</code> loop to iterate through
  20. * the result set.
  21. * <P>
  22. * A default <code>ResultSet</code> object is not updatable and
  23. * has a cursor that moves forward only. Thus, you can
  24. * iterate through it only once and only from the first row to the
  25. * last row. It is possible to
  26. * produce <code>ResultSet</code> objects that are scrollable and/or
  27. * updatable. The following code fragment, in which <code>con</code>
  28. * is a valid <code>Connection</code> object, illustrates how to make
  29. * a result set that is scrollable and insensitive to updates by others, and
  30. * that is updatable. See <code>ResultSet</code> fields for other
  31. * options.
  32. * <PRE>
  33. *
  34. * Statement stmt = con.createStatement(
  35. * ResultSet.TYPE_SCROLL_INSENSITIVE,
  36. * ResultSet.CONCUR_UPDATABLE);
  37. * ResultSet rs = stmt.executeQuery("SELECT a, b FROM TABLE2");
  38. * // rs will be scrollable, will not show changes made by others,
  39. * // and will be updatable
  40. *
  41. * </PRE>
  42. * The <code>ResultSet</code> interface provides
  43. * <i>getter</i> methods (<code>getBoolean</code>, <code>getLong</code>, and so on)
  44. * for retrieving column values from the current row.
  45. * Values can be retrieved using either the index number of the
  46. * column or the name of the column. In general, using the
  47. * column index will be more efficient. Columns are numbered from 1.
  48. * For maximum portability, result set columns within each row should be
  49. * read in left-to-right order, and each column should be read only once.
  50. *
  51. * <P>For the getter methods, a JDBC driver attempts
  52. * to convert the underlying data to the Java type specified in the
  53. * getter method and returns a suitable Java value. The JDBC specification
  54. * has a table showing the allowable mappings from SQL types to Java types
  55. * that can be used by the <code>ResultSet</code> getter methods.
  56. * <P>
  57. * <P>Column names used as input to getter methods are case
  58. * insensitive. When a getter method is called with
  59. * a column name and several columns have the same name,
  60. * the value of the first matching column will be returned.
  61. * The column name option is
  62. * designed to be used when column names are used in the SQL
  63. * query that generated the result set.
  64. * For columns that are NOT explicitly named in the query, it
  65. * is best to use column numbers. If column names are used, there is
  66. * no way for the programmer to guarantee that they actually refer to
  67. * the intended columns.
  68. * <P>
  69. * A set of updater methods were added to this interface
  70. * in the JDBC 2.0 API (Java<sup><font size=-2>TM</font></sup> 2 SDK,
  71. * Standard Edition, version 1.2). The comments regarding parameters
  72. * to the getter methods also apply to parameters to the
  73. * updater methods.
  74. *<P>
  75. * The updater methods may be used in two ways:
  76. * <ol>
  77. * <LI>to update a column value in the current row. In a scrollable
  78. * <code>ResultSet</code> object, the cursor can be moved backwards
  79. * and forwards, to an absolute position, or to a position
  80. * relative to the current row.
  81. * The following code fragment updates the <code>NAME</code> column
  82. * in the fifth row of the <code>ResultSet</code> object
  83. * <code>rs</code> and then uses the method <code>updateRow</code>
  84. * to update the data source table from which <code>rs</code> was derived.
  85. * <PRE>
  86. *
  87. * rs.absolute(5); // moves the cursor to the fifth row of rs
  88. * rs.updateString("NAME", "AINSWORTH"); // updates the
  89. * // <code>NAME</code> column of row 5 to be <code>AINSWORTH</code>
  90. * rs.updateRow(); // updates the row in the data source
  91. *
  92. * </PRE>
  93. * <LI>to insert column values into the insert row. An updatable
  94. * <code>ResultSet</code> object has a special row associated with
  95. * it that serves as a staging area for building a row to be inserted.
  96. * The following code fragment moves the cursor to the insert row, builds
  97. * a three-column row, and inserts it into <code>rs</code> and into
  98. * the data source table using the method <code>insertRow</code>.
  99. * <PRE>
  100. *
  101. * rs.moveToInsertRow(); // moves cursor to the insert row
  102. * rs.updateString(1, "AINSWORTH"); // updates the
  103. * // first column of the insert row to be <code>AINSWORTH</code>
  104. * rs.updateInt(2,35); // updates the second column to be <code>35</code>
  105. * rs.updateBoolean(3, true); // updates the third column to <code>true</code>
  106. * rs.insertRow();
  107. * rs.moveToCurrentRow();
  108. *
  109. * </PRE>
  110. * </ol>
  111. * <P>A <code>ResultSet</code> object is automatically closed when the
  112. * <code>Statement</code> object that
  113. * generated it is closed, re-executed, or used
  114. * to retrieve the next result from a sequence of multiple results.
  115. *
  116. * <P>The number, types and properties of a <code>ResultSet</code>
  117. * object's columns are provided by the <code>ResulSetMetaData</code>
  118. * object returned by the <code>ResultSet.getMetaData</code> method.
  119. *
  120. * @see Statement#executeQuery
  121. * @see Statement#getResultSet
  122. * @see ResultSetMetaData
  123. */
  124. public interface ResultSet {
  125. /**
  126. * Moves the cursor down one row from its current position.
  127. * A <code>ResultSet</code> cursor is initially positioned
  128. * before the first row; the first call to the method
  129. * <code>next</code> makes the first row the current row; the
  130. * second call makes the second row the current row, and so on.
  131. *
  132. * <P>If an input stream is open for the current row, a call
  133. * to the method <code>next</code> will
  134. * implicitly close it. A <code>ResultSet</code> object's
  135. * warning chain is cleared when a new row is read.
  136. *
  137. * @return <code>true</code> if the new current row is valid;
  138. * <code>false</code> if there are no more rows
  139. * @exception SQLException if a database access error occurs
  140. */
  141. boolean next() throws SQLException;
  142. /**
  143. * Releases this <code>ResultSet</code> object's database and
  144. * JDBC resources immediately instead of waiting for
  145. * this to happen when it is automatically closed.
  146. *
  147. * <P><B>Note:</B> A <code>ResultSet</code> object
  148. * is automatically closed by the
  149. * <code>Statement</code> object that generated it when
  150. * that <code>Statement</code> object is closed,
  151. * re-executed, or is used to retrieve the next result from a
  152. * sequence of multiple results. A <code>ResultSet</code> object
  153. * is also automatically closed when it is garbage collected.
  154. *
  155. * @exception SQLException if a database access error occurs
  156. */
  157. void close() throws SQLException;
  158. /**
  159. * Reports whether
  160. * the last column read had a value of SQL <code>NULL</code>.
  161. * Note that you must first call one of the getter methods
  162. * on a column to try to read its value and then call
  163. * the method <code>wasNull</code> to see if the value read was
  164. * SQL <code>NULL</code>.
  165. *
  166. * @return <code>true</code> if the last column value read was SQL
  167. * <code>NULL</code> and <code>false</code> otherwise
  168. * @exception SQLException if a database access error occurs
  169. */
  170. boolean wasNull() throws SQLException;
  171. //======================================================================
  172. // Methods for accessing results by column index
  173. //======================================================================
  174. /**
  175. * Retrieves the value of the designated column in the current row
  176. * of this <code>ResultSet</code> object as
  177. * a <code>String</code> in the Java programming language.
  178. *
  179. * @param columnIndex the first column is 1, the second is 2, ...
  180. * @return the column value; if the value is SQL <code>NULL</code>, the
  181. * value returned is <code>null</code>
  182. * @exception SQLException if a database access error occurs
  183. */
  184. String getString(int columnIndex) throws SQLException;
  185. /**
  186. * Retrieves the value of the designated column in the current row
  187. * of this <code>ResultSet</code> object as
  188. * a <code>boolean</code> in the Java programming language.
  189. *
  190. * @param columnIndex the first column is 1, the second is 2, ...
  191. * @return the column value; if the value is SQL <code>NULL</code>, the
  192. * value returned is <code>false</code>
  193. * @exception SQLException if a database access error occurs
  194. */
  195. boolean getBoolean(int columnIndex) throws SQLException;
  196. /**
  197. * Retrieves the value of the designated column in the current row
  198. * of this <code>ResultSet</code> object as
  199. * a <code>byte</code> in the Java programming language.
  200. *
  201. * @param columnIndex the first column is 1, the second is 2, ...
  202. * @return the column value; if the value is SQL <code>NULL</code>, the
  203. * value returned is <code>0</code>
  204. * @exception SQLException if a database access error occurs
  205. */
  206. byte getByte(int columnIndex) throws SQLException;
  207. /**
  208. * Retrieves the value of the designated column in the current row
  209. * of this <code>ResultSet</code> object as
  210. * a <code>short</code> in the Java programming language.
  211. *
  212. * @param columnIndex the first column is 1, the second is 2, ...
  213. * @return the column value; if the value is SQL <code>NULL</code>, the
  214. * value returned is <code>0</code>
  215. * @exception SQLException if a database access error occurs
  216. */
  217. short getShort(int columnIndex) throws SQLException;
  218. /**
  219. * Retrieves the value of the designated column in the current row
  220. * of this <code>ResultSet</code> object as
  221. * an <code>int</code> in the Java programming language.
  222. *
  223. * @param columnIndex the first column is 1, the second is 2, ...
  224. * @return the column value; if the value is SQL <code>NULL</code>, the
  225. * value returned is <code>0</code>
  226. * @exception SQLException if a database access error occurs
  227. */
  228. int getInt(int columnIndex) throws SQLException;
  229. /**
  230. * Retrieves the value of the designated column in the current row
  231. * of this <code>ResultSet</code> object as
  232. * a <code>long</code> in the Java programming language.
  233. *
  234. * @param columnIndex the first column is 1, the second is 2, ...
  235. * @return the column value; if the value is SQL <code>NULL</code>, the
  236. * value returned is <code>0</code>
  237. * @exception SQLException if a database access error occurs
  238. */
  239. long getLong(int columnIndex) throws SQLException;
  240. /**
  241. * Retrieves the value of the designated column in the current row
  242. * of this <code>ResultSet</code> object as
  243. * a <code>float</code> in the Java programming language.
  244. *
  245. * @param columnIndex the first column is 1, the second is 2, ...
  246. * @return the column value; if the value is SQL <code>NULL</code>, the
  247. * value returned is <code>0</code>
  248. * @exception SQLException if a database access error occurs
  249. */
  250. float getFloat(int columnIndex) throws SQLException;
  251. /**
  252. * Retrieves the value of the designated column in the current row
  253. * of this <code>ResultSet</code> object as
  254. * a <code>double</code> in the Java programming language.
  255. *
  256. * @param columnIndex the first column is 1, the second is 2, ...
  257. * @return the column value; if the value is SQL <code>NULL</code>, the
  258. * value returned is <code>0</code>
  259. * @exception SQLException if a database access error occurs
  260. */
  261. double getDouble(int columnIndex) throws SQLException;
  262. /**
  263. * Retrieves the value of the designated column in the current row
  264. * of this <code>ResultSet</code> object as
  265. * a <code>java.sql.BigDecimal</code> in the Java programming language.
  266. *
  267. * @param columnIndex the first column is 1, the second is 2, ...
  268. * @param scale the number of digits to the right of the decimal point
  269. * @return the column value; if the value is SQL <code>NULL</code>, the
  270. * value returned is <code>null</code>
  271. * @exception SQLException if a database access error occurs
  272. * @deprecated
  273. */
  274. BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException;
  275. /**
  276. * Retrieves the value of the designated column in the current row
  277. * of this <code>ResultSet</code> object as
  278. * a <code>byte</code> array in the Java programming language.
  279. * The bytes represent the raw values returned by the driver.
  280. *
  281. * @param columnIndex the first column is 1, the second is 2, ...
  282. * @return the column value; if the value is SQL <code>NULL</code>, the
  283. * value returned is <code>null</code>
  284. * @exception SQLException if a database access error occurs
  285. */
  286. byte[] getBytes(int columnIndex) throws SQLException;
  287. /**
  288. * Retrieves the value of the designated column in the current row
  289. * of this <code>ResultSet</code> object as
  290. * a <code>java.sql.Date</code> object in the Java programming language.
  291. *
  292. * @param columnIndex the first column is 1, the second is 2, ...
  293. * @return the column value; if the value is SQL <code>NULL</code>, the
  294. * value returned is <code>null</code>
  295. * @exception SQLException if a database access error occurs
  296. */
  297. java.sql.Date getDate(int columnIndex) throws SQLException;
  298. /**
  299. * Retrieves the value of the designated column in the current row
  300. * of this <code>ResultSet</code> object as
  301. * a <code>java.sql.Time</code> object in the Java programming language.
  302. *
  303. * @param columnIndex the first column is 1, the second is 2, ...
  304. * @return the column value; if the value is SQL <code>NULL</code>, the
  305. * value returned is <code>null</code>
  306. * @exception SQLException if a database access error occurs
  307. */
  308. java.sql.Time getTime(int columnIndex) throws SQLException;
  309. /**
  310. * Retrieves the value of the designated column in the current row
  311. * of this <code>ResultSet</code> object as
  312. * a <code>java.sql.Timestamp</code> object in the Java programming language.
  313. *
  314. * @param columnIndex the first column is 1, the second is 2, ...
  315. * @return the column value; if the value is SQL <code>NULL</code>, the
  316. * value returned is <code>null</code>
  317. * @exception SQLException if a database access error occurs
  318. */
  319. java.sql.Timestamp getTimestamp(int columnIndex) throws SQLException;
  320. /**
  321. * Retrieves the value of the designated column in the current row
  322. * of this <code>ResultSet</code> object as
  323. * a stream of ASCII characters. The value can then be read in chunks from the
  324. * stream. This method is particularly
  325. * suitable for retrieving large <char>LONGVARCHAR</char> values.
  326. * The JDBC driver will
  327. * do any necessary conversion from the database format into ASCII.
  328. *
  329. * <P><B>Note:</B> All the data in the returned stream must be
  330. * read prior to getting the value of any other column. The next
  331. * call to a getter method implicitly closes the stream. Also, a
  332. * stream may return <code>0</code> when the method
  333. * <code>InputStream.available</code>
  334. * is called whether there is data available or not.
  335. *
  336. * @param columnIndex the first column is 1, the second is 2, ...
  337. * @return a Java input stream that delivers the database column value
  338. * as a stream of one-byte ASCII characters;
  339. * if the value is SQL <code>NULL</code>, the
  340. * value returned is <code>null</code>
  341. * @exception SQLException if a database access error occurs
  342. */
  343. java.io.InputStream getAsciiStream(int columnIndex) throws SQLException;
  344. /**
  345. * Retrieves the value of the designated column in the current row
  346. * of this <code>ResultSet</code> object as
  347. * as a stream of two-byte Unicode characters. The first byte is
  348. * the high byte; the second byte is the low byte.
  349. *
  350. * The value can then be read in chunks from the
  351. * stream. This method is particularly
  352. * suitable for retrieving large <code>LONGVARCHAR</code>values. The
  353. * JDBC driver will do any necessary conversion from the database
  354. * format into Unicode.
  355. *
  356. * <P><B>Note:</B> All the data in the returned stream must be
  357. * read prior to getting the value of any other column. The next
  358. * call to a getter method implicitly closes the stream.
  359. * Also, a stream may return <code>0</code> when the method
  360. * <code>InputStream.available</code>
  361. * is called, whether there is data available or not.
  362. *
  363. * @param columnIndex the first column is 1, the second is 2, ...
  364. * @return a Java input stream that delivers the database column value
  365. * as a stream of two-byte Unicode characters;
  366. * if the value is SQL <code>NULL</code>, the value returned is
  367. * <code>null</code>
  368. *
  369. * @exception SQLException if a database access error occurs
  370. * @deprecated use <code>getCharacterStream</code> in place of
  371. * <code>getUnicodeStream</code>
  372. */
  373. java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException;
  374. /**
  375. * Retrieves the value of the designated column in the current row
  376. * of this <code>ResultSet</code> object as a binary stream of
  377. * uninterpreted bytes. The value can then be read in chunks from the
  378. * stream. This method is particularly
  379. * suitable for retrieving large <code>LONGVARBINARY</code> values.
  380. *
  381. * <P><B>Note:</B> All the data in the returned stream must be
  382. * read prior to getting the value of any other column. The next
  383. * call to a getter method implicitly closes the stream. Also, a
  384. * stream may return <code>0</code> when the method
  385. * <code>InputStream.available</code>
  386. * is called whether there is data available or not.
  387. *
  388. * @param columnIndex the first column is 1, the second is 2, ...
  389. * @return a Java input stream that delivers the database column value
  390. * as a stream of uninterpreted bytes;
  391. * if the value is SQL <code>NULL</code>, the value returned is
  392. * <code>null</code>
  393. * @exception SQLException if a database access error occurs
  394. */
  395. java.io.InputStream getBinaryStream(int columnIndex)
  396. throws SQLException;
  397. //======================================================================
  398. // Methods for accessing results by column name
  399. //======================================================================
  400. /**
  401. * Retrieves the value of the designated column in the current row
  402. * of this <code>ResultSet</code> object as
  403. * a <code>String</code> in the Java programming language.
  404. *
  405. * @param columnName the SQL name of the column
  406. * @return the column value; if the value is SQL <code>NULL</code>, the
  407. * value returned is <code>null</code>
  408. * @exception SQLException if a database access error occurs
  409. */
  410. String getString(String columnName) throws SQLException;
  411. /**
  412. * Retrieves the value of the designated column in the current row
  413. * of this <code>ResultSet</code> object as
  414. * a <code>boolean</code> in the Java programming language.
  415. *
  416. * @param columnName the SQL name of the column
  417. * @return the column value; if the value is SQL <code>NULL</code>, the
  418. * value returned is <code>false</code>
  419. * @exception SQLException if a database access error occurs
  420. */
  421. boolean getBoolean(String columnName) throws SQLException;
  422. /**
  423. * Retrieves the value of the designated column in the current row
  424. * of this <code>ResultSet</code> object as
  425. * a <code>byte</code> in the Java programming language.
  426. *
  427. * @param columnName the SQL name of the column
  428. * @return the column value; if the value is SQL <code>NULL</code>, the
  429. * value returned is <code>0</code>
  430. * @exception SQLException if a database access error occurs
  431. */
  432. byte getByte(String columnName) throws SQLException;
  433. /**
  434. * Retrieves the value of the designated column in the current row
  435. * of this <code>ResultSet</code> object as
  436. * a <code>short</code> in the Java programming language.
  437. *
  438. * @param columnName the SQL name of the column
  439. * @return the column value; if the value is SQL <code>NULL</code>, the
  440. * value returned is <code>0</code>
  441. * @exception SQLException if a database access error occurs
  442. */
  443. short getShort(String columnName) throws SQLException;
  444. /**
  445. * Retrieves the value of the designated column in the current row
  446. * of this <code>ResultSet</code> object as
  447. * an <code>int</code> in the Java programming language.
  448. *
  449. * @param columnName the SQL name of the column
  450. * @return the column value; if the value is SQL <code>NULL</code>, the
  451. * value returned is <code>0</code>
  452. * @exception SQLException if a database access error occurs
  453. */
  454. int getInt(String columnName) throws SQLException;
  455. /**
  456. * Retrieves the value of the designated column in the current row
  457. * of this <code>ResultSet</code> object as
  458. * a <code>long</code> in the Java programming language.
  459. *
  460. * @param columnName the SQL name of the column
  461. * @return the column value; if the value is SQL <code>NULL</code>, the
  462. * value returned is <code>0</code>
  463. * @exception SQLException if a database access error occurs
  464. */
  465. long getLong(String columnName) throws SQLException;
  466. /**
  467. * Retrieves the value of the designated column in the current row
  468. * of this <code>ResultSet</code> object as
  469. * a <code>float</code> in the Java programming language.
  470. *
  471. * @param columnName the SQL name of the column
  472. * @return the column value; if the value is SQL <code>NULL</code>, the
  473. * value returned is <code>0</code>
  474. * @exception SQLException if a database access error occurs
  475. */
  476. float getFloat(String columnName) throws SQLException;
  477. /**
  478. * Retrieves the value of the designated column in the current row
  479. * of this <code>ResultSet</code> object as
  480. * a <code>double</code> in the Java programming language.
  481. *
  482. * @param columnName the SQL name of the column
  483. * @return the column value; if the value is SQL <code>NULL</code>, the
  484. * value returned is <code>0</code>
  485. * @exception SQLException if a database access error occurs
  486. */
  487. double getDouble(String columnName) throws SQLException;
  488. /**
  489. * Retrieves the value of the designated column in the current row
  490. * of this <code>ResultSet</code> object as
  491. * a <code>java.math.BigDecimal</code> in the Java programming language.
  492. *
  493. * @param columnName the SQL name of the column
  494. * @param scale the number of digits to the right of the decimal point
  495. * @return the column value; if the value is SQL <code>NULL</code>, the
  496. * value returned is <code>null</code>
  497. * @exception SQLException if a database access error occurs
  498. * @deprecated
  499. */
  500. BigDecimal getBigDecimal(String columnName, int scale) throws SQLException;
  501. /**
  502. * Retrieves the value of the designated column in the current row
  503. * of this <code>ResultSet</code> object as
  504. * a <code>byte</code> array in the Java programming language.
  505. * The bytes represent the raw values returned by the driver.
  506. *
  507. * @param columnName the SQL name of the column
  508. * @return the column value; if the value is SQL <code>NULL</code>, the
  509. * value returned is <code>null</code>
  510. * @exception SQLException if a database access error occurs
  511. */
  512. byte[] getBytes(String columnName) throws SQLException;
  513. /**
  514. * Retrieves the value of the designated column in the current row
  515. * of this <code>ResultSet</code> object as
  516. * a <code>java.sql.Date</code> object in the Java programming language.
  517. *
  518. * @param columnName the SQL name of the column
  519. * @return the column value; if the value is SQL <code>NULL</code>, the
  520. * value returned is <code>null</code>
  521. * @exception SQLException if a database access error occurs
  522. */
  523. java.sql.Date getDate(String columnName) throws SQLException;
  524. /**
  525. * Retrieves the value of the designated column in the current row
  526. * of this <code>ResultSet</code> object as
  527. * a <code>java.sql.Time</code> object in the Java programming language.
  528. *
  529. * @param columnName the SQL name of the column
  530. * @return the column value;
  531. * if the value is SQL <code>NULL</code>,
  532. * the value returned is <code>null</code>
  533. * @exception SQLException if a database access error occurs
  534. */
  535. java.sql.Time getTime(String columnName) throws SQLException;
  536. /**
  537. * Retrieves the value of the designated column in the current row
  538. * of this <code>ResultSet</code> object as
  539. * a <code>java.sql.Timestamp</code> object.
  540. *
  541. * @param columnName the SQL name of the column
  542. * @return the column value; if the value is SQL <code>NULL</code>, the
  543. * value returned is <code>null</code>
  544. * @exception SQLException if a database access error occurs
  545. */
  546. java.sql.Timestamp getTimestamp(String columnName) throws SQLException;
  547. /**
  548. * Retrieves the value of the designated column in the current row
  549. * of this <code>ResultSet</code> object as a stream of
  550. * ASCII characters. The value can then be read in chunks from the
  551. * stream. This method is particularly
  552. * suitable for retrieving large <code>LONGVARCHAR</code> values.
  553. * The JDBC driver will
  554. * do any necessary conversion from the database format into ASCII.
  555. *
  556. * <P><B>Note:</B> All the data in the returned stream must be
  557. * read prior to getting the value of any other column. The next
  558. * call to a getter method implicitly closes the stream. Also, a
  559. * stream may return <code>0</code> when the method <code>available</code>
  560. * is called whether there is data available or not.
  561. *
  562. * @param columnName the SQL name of the column
  563. * @return a Java input stream that delivers the database column value
  564. * as a stream of one-byte ASCII characters.
  565. * If the value is SQL <code>NULL</code>,
  566. * the value returned is <code>null</code>.
  567. * @exception SQLException if a database access error occurs
  568. */
  569. java.io.InputStream getAsciiStream(String columnName) throws SQLException;
  570. /**
  571. * Retrieves the value of the designated column in the current row
  572. * of this <code>ResultSet</code> object as a stream of two-byte
  573. * Unicode characters. The first byte is the high byte; the second
  574. * byte is the low byte.
  575. *
  576. * 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 technology-enabled driver will
  580. * do any necessary conversion from the database format into Unicode.
  581. *
  582. * <P><B>Note:</B> All the data in the returned stream must be
  583. * read prior to getting the value of any other column. The next
  584. * call to a getter method implicitly closes the stream.
  585. * Also, a stream may return <code>0</code> when the method
  586. * <code>InputStream.available</code> is called, whether there
  587. * is data available or not.
  588. *
  589. * @param columnName the SQL name of the column
  590. * @return a Java input stream that delivers the database column value
  591. * as a stream of two-byte Unicode characters.
  592. * If the value is SQL <code>NULL</code>, the value returned
  593. * is <code>null</code>.
  594. * @exception SQLException if a database access error occurs
  595. * @deprecated use <code>getCharacterStream</code> instead
  596. */
  597. java.io.InputStream getUnicodeStream(String columnName) throws SQLException;
  598. /**
  599. * Retrieves the value of the designated column in the current row
  600. * of this <code>ResultSet</code> object as a stream of uninterpreted
  601. * <code>byte</code>s.
  602. * The value can then be read in chunks from the
  603. * stream. This method is particularly
  604. * suitable for retrieving large <code>LONGVARBINARY</code>
  605. * values.
  606. *
  607. * <P><B>Note:</B> All the data in the returned stream must be
  608. * read prior to getting the value of any other column. The next
  609. * call to a getter method implicitly closes the stream. Also, a
  610. * stream may return <code>0</code> when the method <code>available</code>
  611. * is called whether there is data available or not.
  612. *
  613. * @param columnName the SQL name of the column
  614. * @return a Java input stream that delivers the database column value
  615. * as a stream of uninterpreted bytes;
  616. * if the value is SQL <code>NULL</code>, the result is <code>null</code>
  617. * @exception SQLException if a database access error occurs
  618. */
  619. java.io.InputStream getBinaryStream(String columnName)
  620. throws SQLException;
  621. //=====================================================================
  622. // Advanced features:
  623. //=====================================================================
  624. /**
  625. * Retrieves the first warning reported by calls on this
  626. * <code>ResultSet</code> object.
  627. * Subsequent warnings on this <code>ResultSet</code> object
  628. * will be chained to the <code>SQLWarning</code> object that
  629. * this method returns.
  630. *
  631. * <P>The warning chain is automatically cleared each time a new
  632. * row is read. This method may not be called on a <code>ResultSet</code>
  633. * object that has been closed; doing so will cause an
  634. * <code>SQLException</code> to be thrown.
  635. * <P>
  636. * <B>Note:</B> This warning chain only covers warnings caused
  637. * by <code>ResultSet</code> methods. Any warning caused by
  638. * <code>Statement</code> methods
  639. * (such as reading OUT parameters) will be chained on the
  640. * <code>Statement</code> object.
  641. *
  642. * @return the first <code>SQLWarning</code> object reported or
  643. * <code>null</code> if there are none
  644. * @exception SQLException if a database access error occurs or this method is
  645. * called on a closed result set
  646. */
  647. SQLWarning getWarnings() throws SQLException;
  648. /**
  649. * Clears all warnings reported on this <code>ResultSet</code> object.
  650. * After this method is called, the method <code>getWarnings</code>
  651. * returns <code>null</code> until a new warning is
  652. * reported for this <code>ResultSet</code> object.
  653. *
  654. * @exception SQLException if a database access error occurs
  655. */
  656. void clearWarnings() throws SQLException;
  657. /**
  658. * Retrieves the name of the SQL cursor used by this <code>ResultSet</code>
  659. * object.
  660. *
  661. * <P>In SQL, a result table is retrieved through a cursor that is
  662. * named. The current row of a result set can be updated or deleted
  663. * using a positioned update/delete statement that references the
  664. * cursor name. To insure that the cursor has the proper isolation
  665. * level to support update, the cursor's <code>SELECT</code> statement
  666. * should be of the form <code>SELECT FOR UPDATE</code>. If
  667. * <code>FOR UPDATE</code> is omitted, the positioned updates may fail.
  668. *
  669. * <P>The JDBC API supports this SQL feature by providing the name of the
  670. * SQL cursor used by a <code>ResultSet</code> object.
  671. * The current row of a <code>ResultSet</code> object
  672. * is also the current row of this SQL cursor.
  673. *
  674. * <P><B>Note:</B> If positioned update is not supported, a
  675. * <code>SQLException</code> is thrown.
  676. *
  677. * @return the SQL name for this <code>ResultSet</code> object's cursor
  678. * @exception SQLException if a database access error occurs
  679. */
  680. String getCursorName() throws SQLException;
  681. /**
  682. * Retrieves the number, types and properties of
  683. * this <code>ResultSet</code> object's columns.
  684. *
  685. * @return the description of this <code>ResultSet</code> object's columns
  686. * @exception SQLException if a database access error occurs
  687. */
  688. ResultSetMetaData getMetaData() throws SQLException;
  689. /**
  690. * <p>Gets the value of the designated column in the current row
  691. * of this <code>ResultSet</code> object as
  692. * an <code>Object</code> in the Java programming language.
  693. *
  694. * <p>This method will return the value of the given column as a
  695. * Java object. The type of the Java object will be the default
  696. * Java object type corresponding to the column's SQL type,
  697. * following the mapping for built-in types specified in the JDBC
  698. * specification. If the value is an SQL <code>NULL</code>,
  699. * the driver returns a Java <code>null</code>.
  700. *
  701. * <p>This method may also be used to read database-specific
  702. * abstract data types.
  703. *
  704. * In the JDBC 2.0 API, the behavior of method
  705. * <code>getObject</code> is extended to materialize
  706. * data of SQL user-defined types. When a column contains
  707. * a structured or distinct value, the behavior of this method is as
  708. * if it were a call to: <code>getObject(columnIndex,
  709. * this.getStatement().getConnection().getTypeMap())</code>.
  710. *
  711. * @param columnIndex the first column is 1, the second is 2, ...
  712. * @return a <code>java.lang.Object</code> holding the column value
  713. * @exception SQLException if a database access error occurs
  714. */
  715. Object getObject(int columnIndex) throws SQLException;
  716. /**
  717. * <p>Gets the value of the designated column in the current row
  718. * of this <code>ResultSet</code> object as
  719. * an <code>Object</code> in the Java programming language.
  720. *
  721. * <p>This method will return the value of the given column as a
  722. * Java object. The type of the Java object will be the default
  723. * Java object type corresponding to the column's SQL type,
  724. * following the mapping for built-in types specified in the JDBC
  725. * specification. If the value is an SQL <code>NULL</code>,
  726. * the driver returns a Java <code>null</code>.
  727. * <P>
  728. * This method may also be used to read database-specific
  729. * abstract data types.
  730. * <P>
  731. * In the JDBC 2.0 API, the behavior of the method
  732. * <code>getObject</code> is extended to materialize
  733. * data of SQL user-defined types. When a column contains
  734. * a structured or distinct value, the behavior of this method is as
  735. * if it were a call to: <code>getObject(columnIndex,
  736. * this.getStatement().getConnection().getTypeMap())</code>.
  737. *
  738. * @param columnName the SQL name of the column
  739. * @return a <code>java.lang.Object</code> holding the column value
  740. * @exception SQLException if a database access error occurs
  741. */
  742. Object getObject(String columnName) throws SQLException;
  743. //----------------------------------------------------------------
  744. /**
  745. * Maps the given <code>ResultSet</code> column name to its
  746. * <code>ResultSet</code> column index.
  747. *
  748. * @param columnName the name of the column
  749. * @return the column index of the given column name
  750. * @exception SQLException if the <code>ResultSet</code> object
  751. * does not contain <code>columnName</code> or a database access error occurs
  752. */
  753. int findColumn(String columnName) throws SQLException;
  754. //--------------------------JDBC 2.0-----------------------------------
  755. //---------------------------------------------------------------------
  756. // Getters and Setters
  757. //---------------------------------------------------------------------
  758. /**
  759. * Retrieves the value of the designated column in the current row
  760. * of this <code>ResultSet</code> object as a
  761. * <code>java.io.Reader</code> object.
  762. * @return a <code>java.io.Reader</code> object that contains the column
  763. * value; if the value is SQL <code>NULL</code>, the value returned is
  764. * <code>null</code> in the Java programming language.
  765. * @param columnIndex the first column is 1, the second is 2, ...
  766. * @exception SQLException if a database access error occurs
  767. * @since 1.2
  768. */
  769. java.io.Reader getCharacterStream(int columnIndex) throws SQLException;
  770. /**
  771. * Retrieves the value of the designated column in the current row
  772. * of this <code>ResultSet</code> object as a
  773. * <code>java.io.Reader</code> object.
  774. *
  775. * @param columnName the name of the column
  776. * @return a <code>java.io.Reader</code> object that contains the column
  777. * value; if the value is SQL <code>NULL</code>, the value returned is
  778. * <code>null</code> in the Java programming language
  779. * @exception SQLException if a database access error occurs
  780. * @since 1.2
  781. */
  782. java.io.Reader getCharacterStream(String columnName) throws SQLException;
  783. /**
  784. * Retrieves the value of the designated column in the current row
  785. * of this <code>ResultSet</code> object as a
  786. * <code>java.math.BigDecimal</code> with full precision.
  787. *
  788. * @param columnIndex the first column is 1, the second is 2, ...
  789. * @return the column value (full precision);
  790. * if the value is SQL <code>NULL</code>, the value returned is
  791. * <code>null</code> in the Java programming language.
  792. * @exception SQLException if a database access error occurs
  793. * @since 1.2
  794. */
  795. BigDecimal getBigDecimal(int columnIndex) throws SQLException;
  796. /**
  797. * Retrieves the value of the designated column in the current row
  798. * of this <code>ResultSet</code> object as a
  799. * <code>java.math.BigDecimal</code> with full precision.
  800. *
  801. * @param columnName the column name
  802. * @return the column value (full precision);
  803. * if the value is SQL <code>NULL</code>, the value returned is
  804. * <code>null</code> in the Java programming language.
  805. * @exception SQLException if a database access error occurs
  806. * @since 1.2
  807. *
  808. */
  809. BigDecimal getBigDecimal(String columnName) throws SQLException;
  810. //---------------------------------------------------------------------
  811. // Traversal/Positioning
  812. //---------------------------------------------------------------------
  813. /**
  814. * Retrieves whether the cursor is before the first row in
  815. * this <code>ResultSet</code> object.
  816. *
  817. * @return <code>true</code> if the cursor is before the first row;
  818. * <code>false</code> if the cursor is at any other position or the
  819. * result set contains no rows
  820. * @exception SQLException if a database access error occurs
  821. * @since 1.2
  822. */
  823. boolean isBeforeFirst() throws SQLException;
  824. /**
  825. * Retrieves whether the cursor is after the last row in
  826. * this <code>ResultSet</code> object.
  827. *
  828. * @return <code>true</code> if the cursor is after the last row;
  829. * <code>false</code> if the cursor is at any other position or the
  830. * result set contains no rows
  831. * @exception SQLException if a database access error occurs
  832. * @since 1.2
  833. */
  834. boolean isAfterLast() throws SQLException;
  835. /**
  836. * Retrieves whether the cursor is on the first row of
  837. * this <code>ResultSet</code> object.
  838. *
  839. * @return <code>true</code> if the cursor is on the first row;
  840. * <code>false</code> otherwise
  841. * @exception SQLException if a database access error occurs
  842. * @since 1.2
  843. */
  844. boolean isFirst() throws SQLException;
  845. /**
  846. * Retrieves whether the cursor is on the last row of
  847. * this <code>ResultSet</code> object.
  848. * Note: Calling the method <code>isLast</code> may be expensive
  849. * because the JDBC driver
  850. * might need to fetch ahead one row in order to determine
  851. * whether the current row is the last row in the result set.
  852. *
  853. * @return <code>true</code> if the cursor is on the last row;
  854. * <code>false</code> otherwise
  855. * @exception SQLException if a database access error occurs
  856. * @since 1.2
  857. */
  858. boolean isLast() throws SQLException;
  859. /**
  860. * Moves the cursor to the front of
  861. * this <code>ResultSet</code> object, just before the
  862. * first row. This method has no effect if the result set contains no rows.
  863. *
  864. * @exception SQLException if a database access error
  865. * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
  866. * @since 1.2
  867. */
  868. void beforeFirst() throws SQLException;
  869. /**
  870. * Moves the cursor to the end of
  871. * this <code>ResultSet</code> object, just after the
  872. * last row. This method has no effect if the result set contains no rows.
  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. */
  877. void afterLast() throws SQLException;
  878. /**
  879. * Moves the cursor to the first row in
  880. * this <code>ResultSet</code> object.
  881. *
  882. * @return <code>true</code> if the cursor is on a valid row;
  883. * <code>false</code> if there are no rows in the result set
  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. */
  888. boolean first() throws SQLException;
  889. /**
  890. * Moves the cursor to the last row in
  891. * this <code>ResultSet</code> object.
  892. *
  893. * @return <code>true</code> if the cursor is on a valid row;
  894. * <code>false</code> if there are no rows in the result set
  895. * @exception SQLException if a database access error
  896. * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
  897. * @since 1.2
  898. */
  899. boolean last() throws SQLException;
  900. /**
  901. * Retrieves the current row number. The first row is number 1, the
  902. * second number 2, and so on.
  903. *
  904. * @return the current row number; <code>0</code> if there is no current row
  905. * @exception SQLException if a database access error occurs
  906. * @since 1.2
  907. */
  908. int getRow() throws SQLException;
  909. /**
  910. * Moves the cursor to the given row number in
  911. * this <code>ResultSet</code> object.
  912. *
  913. * <p>If the row number is positive, the cursor moves to
  914. * the given row number with respect to the
  915. * beginning of the result set. The first row is row 1, the second
  916. * is row 2, and so on.
  917. *
  918. * <p>If the given row number is negative, the cursor moves to
  919. * an absolute row position with respect to
  920. * the end of the result set. For example, calling the method
  921. * <code>absolute(-1)</code> positions the
  922. * cursor on the last row; calling the method <code>absolute(-2)</code>
  923. * moves the cursor to the next-to-last row, and so on.
  924. *
  925. * <p>An attempt to position the cursor beyond the first/last row in
  926. * the result set leaves the cursor before the first row or after
  927. * the last row.
  928. *
  929. * <p><B>Note:</B> Calling <code>absolute(1)</code> is the same
  930. * as calling <code>first()</code>. Calling <code>absolute(-1)</code>
  931. * is the same as calling <code>last()</code>.
  932. *
  933. * @param row the number of the row to which the cursor should move.
  934. * A positive number indicates the row number counting from the
  935. * beginning of the result set; a negative number indicates the
  936. * row number counting from the end of the result set
  937. * @return <code>true</code> if the cursor is on the result set;
  938. * <code>false</code> otherwise
  939. * @exception SQLException if a database access error
  940. * occurs, or the result set type is <code>TYPE_FORWARD_ONLY</code>
  941. * @since 1.2
  942. */
  943. boolean absolute( int row ) throws SQLException;
  944. /**
  945. * Moves the cursor a relative number of rows, either positive or negative.
  946. * Attempting to move beyond the first/last row in the
  947. * result set positions the cursor before/after the
  948. * the first/last row. Calling <code>relative(0)</code> is valid, but does
  949. * not change the cursor position.
  950. *
  951. * <p>Note: Calling the method <code>relative(1)</code>
  952. * is identical to calling the method <code>next()</code> and
  953. * calling the method <code>relative(-1)</code> is identical
  954. * to calling the method <code>previous()</code>.
  955. *
  956. * @param rows an <code>int</code> specifying the number of rows to
  957. * move from the current row; a positive number moves the cursor
  958. * forward; a negative number moves the cursor backward
  959. * @return <code>true</code> if the cursor is on a row;
  960. * <code>false</code> otherwise
  961. * @exception SQLException if a database access error occurs,
  962. * there is no current row, or the result set type is
  963. * <code>TYPE_FORWARD_ONLY</code>
  964. * @since 1.2
  965. */
  966. boolean relative( int rows ) throws SQLException;
  967. /**
  968. * Moves the cursor to the previous row in this
  969. * <code>ResultSet</code> object.
  970. *
  971. * @return <code>true</code> if the cursor is on a valid row;
  972. * <code>false</code> if it is off the result set
  973. * @exception SQLException if a database access error
  974. * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
  975. * @since 1.2
  976. */
  977. boolean previous() throws SQLException;
  978. //---------------------------------------------------------------------
  979. // Properties
  980. //---------------------------------------------------------------------
  981. /**
  982. * The constant indicating that the rows in a result set will be
  983. * processed in a forward direction; first-to-last.
  984. * This constant is used by the method <code>setFetchDirection</code>
  985. * as a hint to the driver, which the driver may ignore.
  986. * @since 1.2
  987. */
  988. int FETCH_FORWARD = 1000;
  989. /**
  990. * The constant indicating that the rows in a result set will be
  991. * processed in a reverse direction; last-to-first.
  992. * This constant is used by the method <code>setFetchDirection</code>
  993. * as a hint to the driver, which the driver may ignore.
  994. * @since 1.2
  995. */
  996. int FETCH_REVERSE = 1001;
  997. /**
  998. * The constant indicating that the order in which rows in a
  999. * result set will be processed is unknown.
  1000. * This constant is used by the method <code>setFetchDirection</code>
  1001. * as a hint to the driver, which the driver may ignore.
  1002. */
  1003. int FETCH_UNKNOWN = 1002;
  1004. /**
  1005. * Gives a hint as to the direction in which the rows in this
  1006. * <code>ResultSet</code> object will be processed.
  1007. * The initial value is determined by the
  1008. * <code>Statement</code> object
  1009. * that produced this <code>ResultSet</code> object.
  1010. * The fetch direction may be changed at any time.
  1011. *
  1012. * @param direction an <code>int</code> specifying the suggested
  1013. * fetch direction; one of <code>ResultSet.FETCH_FORWARD</code>,
  1014. * <code>ResultSet.FETCH_REVERSE</code>, or
  1015. * <code>ResultSet.FETCH_UNKNOWN</code>
  1016. * @exception SQLException if a database access error occurs or
  1017. * the result set type is <code>TYPE_FORWARD_ONLY</code> and the fetch
  1018. * direction is not <code>FETCH_FORWARD</code>
  1019. * @since 1.2
  1020. * @see Statement#setFetchDirection
  1021. * @see #getFetchDirection
  1022. */
  1023. void setFetchDirection(int direction) throws SQLException;
  1024. /**
  1025. * Retrieves the fetch direction for this
  1026. * <code>ResultSet</code> object.
  1027. *
  1028. * @return the current fetch direction for this <code>ResultSet</code> object
  1029. * @exception SQLException if a database access error occurs
  1030. * @since 1.2
  1031. * @see #setFetchDirection
  1032. */
  1033. int getFetchDirection() throws SQLException;
  1034. /**
  1035. * Gives the JDBC driver a hint as to the number of rows that should
  1036. * be fetched from the database when more rows are needed for this
  1037. * <code>ResultSet</code> object.
  1038. * If the fetch size specified is zero, the JDBC driver
  1039. * ignores the value and is free to make its own best guess as to what
  1040. * the fetch size should be. The default value is set by the
  1041. * <code>Statement</code> object
  1042. * that created the result set. The fetch size may be changed at any time.
  1043. *
  1044. * @param rows the number of rows to fetch
  1045. * @exception SQLException if a database access error occurs or the
  1046. * condition <code>0 <= rows <= Statement.getMaxRows()</code> is not satisfied
  1047. * @since 1.2
  1048. * @see #getFetchSize
  1049. */
  1050. void setFetchSize(int rows) throws SQLException;
  1051. /**
  1052. * Retrieves the fetch size for this
  1053. * <code>ResultSet</code> object.
  1054. *
  1055. * @return the current fetch size for this <code>ResultSet</code> object
  1056. * @exception SQLException if a database access error occurs
  1057. * @since 1.2
  1058. * @see #setFetchSize
  1059. */
  1060. int getFetchSize() throws SQLException;
  1061. /**
  1062. * The constant indicating the type for a <code>ResultSet</code> object
  1063. * whose cursor may move only forward.
  1064. * @since 1.2
  1065. */
  1066. int TYPE_FORWARD_ONLY = 1003;
  1067. /**
  1068. * The constant indicating the type for a <code>ResultSet</code> object
  1069. * that is scrollable but generally not sensitive to changes made by others.
  1070. * @since 1.2
  1071. */
  1072. int TYPE_SCROLL_INSENSITIVE = 1004;
  1073. /**
  1074. * The constant indicating the type for a <code>ResultSet</code> object
  1075. * that is scrollable and generally sensitive to changes made by others.
  1076. * @since 1.2
  1077. */
  1078. int TYPE_SCROLL_SENSITIVE = 1005;
  1079. /**
  1080. * Retrieves the type of this <code>ResultSet</code> object.
  1081. * The type is determined by the <code>Statement</code> object
  1082. * that created the result set.
  1083. *
  1084. * @return <code>ResultSet.TYPE_FORWARD_ONLY</code>,
  1085. * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>,
  1086. * or <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
  1087. * @exception SQLException if a database access error occurs
  1088. * @since 1.2
  1089. */
  1090. int getType() throws SQLException;
  1091. /**
  1092. * The constant indicating the concurrency mode for a
  1093. * <code>ResultSet</code> object that may NOT be updated.
  1094. * @since 1.2
  1095. */
  1096. int CONCUR_READ_ONLY = 1007;
  1097. /**
  1098. * The constant indicating the concurrency mode for a
  1099. * <code>ResultSet</code> object that may be updated.
  1100. * @since 1.2
  1101. */
  1102. int CONCUR_UPDATABLE = 1008;
  1103. /**
  1104. * Retrieves the concurrency mode of this <code>ResultSet</code> object.
  1105. * The concurrency used is determined by the
  1106. * <code>Statement</code> object that created the result set.
  1107. *
  1108. * @return the concurrency type, either
  1109. * <code>ResultSet.CONCUR_READ_ONLY</code>
  1110. * or <code>ResultSet.CONCUR_UPDATABLE</code>
  1111. * @exception SQLException if a database access error occurs
  1112. * @since 1.2
  1113. */
  1114. int getConcurrency() throws SQLException;
  1115. //---------------------------------------------------------------------
  1116. // Updates
  1117. //---------------------------------------------------------------------
  1118. /**
  1119. * Retrieves whether the current row has been updated. The value returned
  1120. * depends on whether or not the result set can detect updates.
  1121. *
  1122. * @return <code>true</code> if both (1) the row has been visibly updated
  1123. * by the owner or another and (2) updates are detected
  1124. * @exception SQLException if a database access error occurs
  1125. * @see DatabaseMetaData#updatesAreDetected
  1126. * @since 1.2
  1127. */
  1128. boolean rowUpdated() throws SQLException;
  1129. /**
  1130. * Retrieves whether the current row has had an insertion.
  1131. * The value returned depends on whether or not this
  1132. * <code>ResultSet</code> object can detect visible inserts.
  1133. *
  1134. * @return <code>true</code> if a row has had an insertion
  1135. * and insertions are detected; <code>false</code> otherwise
  1136. * @exception SQLException if a database access error occurs
  1137. *
  1138. * @see DatabaseMetaData#insertsAreDetected
  1139. * @since 1.2
  1140. */
  1141. boolean rowInserted() throws SQLException;
  1142. /**
  1143. * Retrieves whether a row has been deleted. A deleted row may leave
  1144. * a visible "hole" in a result set. This method can be used to
  1145. * detect holes in a result set. The value returned depends on whether
  1146. * or not this <code>ResultSet</code> object can detect deletions.
  1147. *
  1148. * @return <code>true</code> if a row was deleted and deletions are detected;
  1149. * <code>false</code> otherwise
  1150. * @exception SQLException if a database access error occurs
  1151. *
  1152. * @see DatabaseMetaData#deletesAreDetected
  1153. * @since 1.2
  1154. */
  1155. boolean rowDeleted() throws SQLException;
  1156. /**
  1157. * Gives a nullable column a null value.
  1158. *
  1159. * The updater methods are used to update column values in the
  1160. * current row or the insert row. The updater methods do not
  1161. * update the underlying database; instead the <code>updateRow</code>
  1162. * or <code>insertRow</code> methods are called to update the database.
  1163. *
  1164. * @param columnIndex the first column is 1, the second is 2, ...
  1165. * @exception SQLException if a database access error occurs
  1166. * @since 1.2
  1167. */
  1168. void updateNull(int columnIndex) throws SQLException;
  1169. /**
  1170. * Updates the designated column with a <code>boolean</code> value.
  1171. * The updater methods are used to update column values in the
  1172. * current row or the insert row. The updater methods do not
  1173. * update the underlying database; instead the <code>updateRow</code> or
  1174. * <code>insertRow</code> methods are called to update the database.
  1175. *
  1176. * @param columnIndex the first column is 1, the second is 2, ...
  1177. * @param x the new column value
  1178. * @exception SQLException if a database access error occurs
  1179. * @since 1.2
  1180. */
  1181. void updateBoolean(int columnIndex, boolean x) throws SQLException;
  1182. /**
  1183. * Updates the designated column with a <code>byte</code> value.
  1184. * The updater methods are used to update column values in the
  1185. * current row or the insert row. The updater methods do not
  1186. * update the underlying database; instead the <code>updateRow</code> or
  1187. * <code>insertRow</code> methods are called to update the database.
  1188. *
  1189. *
  1190. * @param columnIndex the first column is 1, the second is 2, ...
  1191. * @param x the new column value
  1192. * @exception SQLException if a database access error occurs
  1193. * @since 1.2
  1194. */
  1195. void updateByte(int columnIndex, byte x) throws SQLException;
  1196. /**
  1197. * Updates the designated column with a <code>short</code> value.
  1198. * The updater methods are used to update column values in the
  1199. * current row or the insert row. The updater methods do not
  1200. * update the underlying database; instead the <code>updateRow</code> or
  1201. * <code>insertRow</code> methods are called to update the database.
  1202. *
  1203. * @param columnIndex the first column is 1, the second is 2, ...
  1204. * @param x the new column value
  1205. * @exception SQLException if a database access error occurs
  1206. * @since 1.2
  1207. */
  1208. void updateShort(int columnIndex, short x) throws SQLException;
  1209. /**
  1210. * Updates the designated column with an <code>int</code> value.
  1211. * The updater methods are used to update column values in the
  1212. * current row or the insert row. The updater methods do not
  1213. * update the underlying database; instead the <code>updateRow</code> or
  1214. * <code>insertRow</code> methods are called to update the database.
  1215. *
  1216. * @param columnIndex the first column is 1, the second is 2, ...
  1217. * @param x the new column value
  1218. * @exception SQLException if a database access error occurs
  1219. * @since 1.2
  1220. */
  1221. void updateInt(int columnIndex, int x) throws SQLException;
  1222. /**
  1223. * Updates the designated column with a <code>long</code> value.
  1224. * The updater methods are used to update column values in the
  1225. * current row or the insert row. The updater methods do not
  1226. * update the underlying database; instead the <code>updateRow</code> or
  1227. * <code>insertRow</code> methods are called to update the database.
  1228. *
  1229. * @param columnIndex the first column is 1, the second is 2, ...
  1230. * @param x the new column value
  1231. * @exception SQLException if a database access error occurs
  1232. * @since 1.2
  1233. */
  1234. void updateLong(int columnIndex, long x) throws SQLException;
  1235. /**
  1236. * Updates the designated column with a <code>float</code> value.
  1237. * The updater methods are used to update column values in the
  1238. * current row or the insert row. The updater methods do not
  1239. * update the underlying database; instead the <code>updateRow</code> or
  1240. * <code>insertRow</code> methods are called to update the database.
  1241. *
  1242. * @param columnIndex the first column is 1, the second is 2, ...
  1243. * @param x the new column value
  1244. * @exception SQLException if a database access error occurs
  1245. * @since 1.2
  1246. */
  1247. void updateFloat(int columnIndex, float x) throws SQLException;
  1248. /**
  1249. * Updates the designated column with a <code>double</code> value.
  1250. * The updater methods are used to update column values in the
  1251. * current row or the insert row. The updater methods do not
  1252. * update the underlying database; instead the <code>updateRow</code> or
  1253. * <code>insertRow</code> methods are called to update the database.
  1254. *
  1255. * @param columnIndex the first column is 1, the second is 2, ...
  1256. * @param x the new column value
  1257. * @exception SQLException if a database access error occurs
  1258. * @since 1.2
  1259. */
  1260. void updateDouble(int columnIndex, double x) throws SQLException;
  1261. /**
  1262. * Updates the designated column with a <code>java.math.BigDecimal</code>
  1263. * value.
  1264. * The updater methods are used to update column values in the
  1265. * current row or the insert row. The updater methods do not
  1266. * update the underlying database; instead the <code>updateRow</code> or
  1267. * <code>insertRow</code> methods are called to update the database.
  1268. *
  1269. * @param columnIndex the first column is 1, the second is 2, ...
  1270. * @param x the new column value
  1271. * @exception SQLException if a database access error occurs
  1272. * @since 1.2
  1273. */
  1274. void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException;
  1275. /**
  1276. * Updates the designated column with a <code>String</code> value.
  1277. * The updater methods are used to update column values in the