1 /* 2 * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package java.sql; 27 28 import java.math.BigDecimal; 29 import java.util.Calendar; 30 import java.io.Reader; 31 import java.io.InputStream; 32 33 /** 34 * A table of data representing a database result set, which 35 * is usually generated by executing a statement that queries the database. 36 * 37 * <P>A <code>ResultSet</code> object maintains a cursor pointing 38 * to its current row of data. Initially the cursor is positioned 39 * before the first row. The <code>next</code> method moves the 40 * cursor to the next row, and because it returns <code>false</code> 41 * when there are no more rows in the <code>ResultSet</code> object, 42 * it can be used in a <code>while</code> loop to iterate through 43 * the result set. 44 * <P> 45 * A default <code>ResultSet</code> object is not updatable and 46 * has a cursor that moves forward only. Thus, you can 47 * iterate through it only once and only from the first row to the 48 * last row. It is possible to 49 * produce <code>ResultSet</code> objects that are scrollable and/or 50 * updatable. The following code fragment, in which <code>con</code> 51 * is a valid <code>Connection</code> object, illustrates how to make 52 * a result set that is scrollable and insensitive to updates by others, and 53 * that is updatable. See <code>ResultSet</code> fields for other 54 * options. 55 * <PRE> 56 * 57 * Statement stmt = con.createStatement( 58 * ResultSet.TYPE_SCROLL_INSENSITIVE, 59 * ResultSet.CONCUR_UPDATABLE); 60 * ResultSet rs = stmt.executeQuery("SELECT a, b FROM TABLE2"); 61 * // rs will be scrollable, will not show changes made by others, 62 * // and will be updatable 63 * 64 * </PRE> 65 * The <code>ResultSet</code> interface provides 66 * <i>getter</i> methods (<code>getBoolean</code>, <code>getLong</code>, and so on) 67 * for retrieving column values from the current row. 68 * Values can be retrieved using either the index number of the 69 * column or the name of the column. In general, using the 70 * column index will be more efficient. Columns are numbered from 1. 71 * For maximum portability, result set columns within each row should be 72 * read in left-to-right order, and each column should be read only once. 73 * 74 * <P>For the getter methods, a JDBC driver attempts 75 * to convert the underlying data to the Java type specified in the 76 * getter method and returns a suitable Java value. The JDBC specification 77 * has a table showing the allowable mappings from SQL types to Java types 78 * that can be used by the <code>ResultSet</code> getter methods. 79 * 80 * <P>Column names used as input to getter methods are case 81 * insensitive. When a getter method is called with 82 * a column name and several columns have the same name, 83 * the value of the first matching column will be returned. 84 * The column name option is 85 * designed to be used when column names are used in the SQL 86 * query that generated the result set. 87 * For columns that are NOT explicitly named in the query, it 88 * is best to use column numbers. If column names are used, the 89 * programmer should take care to guarantee that they uniquely refer to 90 * the intended columns, which can be assured with the SQL <i>AS</i> clause. 91 * <P> 92 * A set of updater methods were added to this interface 93 * in the JDBC 2.0 API (Java™ 2 SDK, 94 * Standard Edition, version 1.2). The comments regarding parameters 95 * to the getter methods also apply to parameters to the 96 * updater methods. 97 *<P> 98 * The updater methods may be used in two ways: 99 * <ol> 100 * <LI>to update a column value in the current row. In a scrollable 101 * <code>ResultSet</code> object, the cursor can be moved backwards 102 * and forwards, to an absolute position, or to a position 103 * relative to the current row. 104 * The following code fragment updates the <code>NAME</code> column 105 * in the fifth row of the <code>ResultSet</code> object 106 * <code>rs</code> and then uses the method <code>updateRow</code> 107 * to update the data source table from which <code>rs</code> was derived. 108 * <PRE> 109 * 110 * rs.absolute(5); // moves the cursor to the fifth row of rs 111 * rs.updateString("NAME", "AINSWORTH"); // updates the 112 * // <code>NAME</code> column of row 5 to be <code>AINSWORTH</code> 113 * rs.updateRow(); // updates the row in the data source 114 * 115 * </PRE> 116 * <LI>to insert column values into the insert row. An updatable 117 * <code>ResultSet</code> object has a special row associated with 118 * it that serves as a staging area for building a row to be inserted. 119 * The following code fragment moves the cursor to the insert row, builds 120 * a three-column row, and inserts it into <code>rs</code> and into 121 * the data source table using the method <code>insertRow</code>. 122 * <PRE> 123 * 124 * rs.moveToInsertRow(); // moves cursor to the insert row 125 * rs.updateString(1, "AINSWORTH"); // updates the 126 * // first column of the insert row to be <code>AINSWORTH</code> 127 * rs.updateInt(2,35); // updates the second column to be <code>35</code> 128 * rs.updateBoolean(3, true); // updates the third column to <code>true</code> 129 * rs.insertRow(); 130 * rs.moveToCurrentRow(); 131 * 132 * </PRE> 133 * </ol> 134 * <P>A <code>ResultSet</code> object is automatically closed when the 135 * <code>Statement</code> object that 136 * generated it is closed, re-executed, or used 137 * to retrieve the next result from a sequence of multiple results. 138 * 139 * <P>The number, types and properties of a <code>ResultSet</code> 140 * object's columns are provided by the <code>ResultSetMetaData</code> 141 * object returned by the <code>ResultSet.getMetaData</code> method. 142 * 143 * @see Statement#executeQuery 144 * @see Statement#getResultSet 145 * @see ResultSetMetaData 146 */ 147 148 public interface ResultSet extends Wrapper, AutoCloseable { 149 150 /** 151 * Moves the cursor forward one row from its current position. 152 * A <code>ResultSet</code> cursor is initially positioned 153 * before the first row; the first call to the method 154 * <code>next</code> makes the first row the current row; the 155 * second call makes the second row the current row, and so on. 156 * <p> 157 * When a call to the <code>next</code> method returns <code>false</code>, 158 * the cursor is positioned after the last row. Any 159 * invocation of a <code>ResultSet</code> method which requires a 160 * current row will result in a <code>SQLException</code> being thrown. 161 * If the result set type is <code>TYPE_FORWARD_ONLY</code>, it is vendor specified 162 * whether their JDBC driver implementation will return <code>false</code> or 163 * throw an <code>SQLException</code> on a 164 * subsequent call to <code>next</code>. 165 * 166 * <P>If an input stream is open for the current row, a call 167 * to the method <code>next</code> will 168 * implicitly close it. A <code>ResultSet</code> object's 169 * warning chain is cleared when a new row is read. 170 * 171 * @return <code>true</code> if the new current row is valid; 172 * <code>false</code> if there are no more rows 173 * @exception SQLException if a database access error occurs or this method is 174 * called on a closed result set 175 */ 176 boolean next() throws SQLException; 177 178 179 /** 180 * Releases this <code>ResultSet</code> object's database and 181 * JDBC resources immediately instead of waiting for 182 * this to happen when it is automatically closed. 183 * 184 * <P>The closing of a <code>ResultSet</code> object does <strong>not</strong> close the <code>Blob</code>, 185 * <code>Clob</code> or <code>NClob</code> objects created by the <code>ResultSet</code>. <code>Blob</code>, 186 * <code>Clob</code> or <code>NClob</code> objects remain valid for at least the duration of the 187 * transaction in which they are created, unless their <code>free</code> method is invoked. 188 *<p> 189 * When a <code>ResultSet</code> is closed, any <code>ResultSetMetaData</code> 190 * instances that were created by calling the <code>getMetaData</code> 191 * method remain accessible. 192 * 193 * <P><B>Note:</B> A <code>ResultSet</code> object 194 * is automatically closed by the 195 * <code>Statement</code> object that generated it when 196 * that <code>Statement</code> object is closed, 197 * re-executed, or is used to retrieve the next result from a 198 * sequence of multiple results. 199 *<p> 200 * Calling the method <code>close</code> on a <code>ResultSet</code> 201 * object that is already closed is a no-op. 202 * 203 * 204 * @exception SQLException if a database access error occurs 205 */ 206 void close() throws SQLException; 207 208 /** 209 * Reports whether 210 * the last column read had a value of SQL <code>NULL</code>. 211 * Note that you must first call one of the getter methods 212 * on a column to try to read its value and then call 213 * the method <code>wasNull</code> to see if the value read was 214 * SQL <code>NULL</code>. 215 * 216 * @return <code>true</code> if the last column value read was SQL 217 * <code>NULL</code> and <code>false</code> otherwise 218 * @exception SQLException if a database access error occurs or this method is 219 * called on a closed result set 220 */ 221 boolean wasNull() throws SQLException; 222 223 // Methods for accessing results by column index 224 225 /** 226 * Retrieves the value of the designated column in the current row 227 * of this <code>ResultSet</code> object as 228 * a <code>String</code> in the Java programming language. 229 * 230 * @param columnIndex the first column is 1, the second is 2, ... 231 * @return the column value; if the value is SQL <code>NULL</code>, the 232 * value returned is <code>null</code> 233 * @exception SQLException if the columnIndex is not valid; 234 * if a database access error occurs or this method is 235 * called on a closed result set 236 */ 237 String getString(int columnIndex) throws SQLException; 238 239 /** 240 * Retrieves the value of the designated column in the current row 241 * of this <code>ResultSet</code> object as 242 * a <code>boolean</code> in the Java programming language. 243 * 244 * <P>If the designated column has a datatype of CHAR or VARCHAR 245 * and contains a "0" or has a datatype of BIT, TINYINT, SMALLINT, INTEGER or BIGINT 246 * and contains a 0, a value of <code>false</code> is returned. If the designated column has a datatype 247 * of CHAR or VARCHAR 248 * and contains a "1" or has a datatype of BIT, TINYINT, SMALLINT, INTEGER or BIGINT 249 * and contains a 1, a value of <code>true</code> is returned. 250 * 251 * @param columnIndex the first column is 1, the second is 2, ... 252 * @return the column value; if the value is SQL <code>NULL</code>, the 253 * value returned is <code>false</code> 254 * @exception SQLException if the columnIndex is not valid; 255 * if a database access error occurs or this method is 256 * called on a closed result set 257 */ 258 boolean getBoolean(int columnIndex) throws SQLException; 259 260 /** 261 * Retrieves the value of the designated column in the current row 262 * of this <code>ResultSet</code> object as 263 * a <code>byte</code> in the Java programming language. 264 * 265 * @param columnIndex the first column is 1, the second is 2, ... 266 * @return the column value; if the value is SQL <code>NULL</code>, the 267 * value returned is <code>0</code> 268 * @exception SQLException if the columnIndex is not valid; 269 * if a database access error occurs or this method is 270 * called on a closed result set 271 */ 272 byte getByte(int columnIndex) throws SQLException; 273 274 /** 275 * Retrieves the value of the designated column in the current row 276 * of this <code>ResultSet</code> object as 277 * a <code>short</code> in the Java programming language. 278 * 279 * @param columnIndex the first column is 1, the second is 2, ... 280 * @return the column value; if the value is SQL <code>NULL</code>, the 281 * value returned is <code>0</code> 282 * @exception SQLException if the columnIndex is not valid; 283 * if a database access error occurs or this method is 284 * called on a closed result set 285 */ 286 short getShort(int columnIndex) throws SQLException; 287 288 /** 289 * Retrieves the value of the designated column in the current row 290 * of this <code>ResultSet</code> object as 291 * an <code>int</code> in the Java programming language. 292 * 293 * @param columnIndex the first column is 1, the second is 2, ... 294 * @return the column value; if the value is SQL <code>NULL</code>, the 295 * value returned is <code>0</code> 296 * @exception SQLException if the columnIndex is not valid; 297 * if a database access error occurs or this method is 298 * called on a closed result set 299 */ 300 int getInt(int columnIndex) throws SQLException; 301 302 /** 303 * Retrieves the value of the designated column in the current row 304 * of this <code>ResultSet</code> object as 305 * a <code>long</code> in the Java programming language. 306 * 307 * @param columnIndex the first column is 1, the second is 2, ... 308 * @return the column value; if the value is SQL <code>NULL</code>, the 309 * value returned is <code>0</code> 310 * @exception SQLException if the columnIndex is not valid; 311 * if a database access error occurs or this method is 312 * called on a closed result set 313 */ 314 long getLong(int columnIndex) throws SQLException; 315 316 /** 317 * Retrieves the value of the designated column in the current row 318 * of this <code>ResultSet</code> object as 319 * a <code>float</code> in the Java programming language. 320 * 321 * @param columnIndex the first column is 1, the second is 2, ... 322 * @return the column value; if the value is SQL <code>NULL</code>, the 323 * value returned is <code>0</code> 324 * @exception SQLException if the columnIndex is not valid; 325 * if a database access error occurs or this method is 326 * called on a closed result set 327 */ 328 float getFloat(int columnIndex) throws SQLException; 329 330 /** 331 * Retrieves the value of the designated column in the current row 332 * of this <code>ResultSet</code> object as 333 * a <code>double</code> in the Java programming language. 334 * 335 * @param columnIndex the first column is 1, the second is 2, ... 336 * @return the column value; if the value is SQL <code>NULL</code>, the 337 * value returned is <code>0</code> 338 * @exception SQLException if the columnIndex is not valid; 339 * if a database access error occurs or this method is 340 * called on a closed result set 341 */ 342 double getDouble(int columnIndex) throws SQLException; 343 344 /** 345 * Retrieves the value of the designated column in the current row 346 * of this <code>ResultSet</code> object as 347 * a <code>java.sql.BigDecimal</code> in the Java programming language. 348 * 349 * @param columnIndex the first column is 1, the second is 2, ... 350 * @param scale the number of digits to the right of the decimal point 351 * @return the column value; if the value is SQL <code>NULL</code>, the 352 * value returned is <code>null</code> 353 * @exception SQLException if the columnIndex is not valid; 354 * if a database access error occurs or this method is 355 * called on a closed result set 356 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 357 * this method 358 * @deprecated Use {@code getBigDecimal(int columnIndex)} 359 * or {@code getBigDecimal(String columnLabel)} 360 */ 361 @Deprecated 362 BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException; 363 364 /** 365 * Retrieves the value of the designated column in the current row 366 * of this <code>ResultSet</code> object as 367 * a <code>byte</code> array in the Java programming language. 368 * The bytes represent the raw values returned by the driver. 369 * 370 * @param columnIndex the first column is 1, the second is 2, ... 371 * @return the column value; if the value is SQL <code>NULL</code>, the 372 * value returned is <code>null</code> 373 * @exception SQLException if the columnIndex is not valid; 374 * if a database access error occurs or this method is 375 * called on a closed result set 376 */ 377 byte[] getBytes(int columnIndex) throws SQLException; 378 379 /** 380 * Retrieves the value of the designated column in the current row 381 * of this <code>ResultSet</code> object as 382 * a <code>java.sql.Date</code> object in the Java programming language. 383 * 384 * @param columnIndex the first column is 1, the second is 2, ... 385 * @return the column value; if the value is SQL <code>NULL</code>, the 386 * value returned is <code>null</code> 387 * @exception SQLException if the columnIndex is not valid; 388 * if a database access error occurs or this method is 389 * called on a closed result set 390 */ 391 java.sql.Date getDate(int columnIndex) throws SQLException; 392 393 /** 394 * Retrieves the value of the designated column in the current row 395 * of this <code>ResultSet</code> object as 396 * a <code>java.sql.Time</code> object in the Java programming language. 397 * 398 * @param columnIndex the first column is 1, the second is 2, ... 399 * @return the column value; if the value is SQL <code>NULL</code>, the 400 * value returned is <code>null</code> 401 * @exception SQLException if the columnIndex is not valid; 402 * if a database access error occurs or this method is 403 * called on a closed result set 404 */ 405 java.sql.Time getTime(int columnIndex) throws SQLException; 406 407 /** 408 * Retrieves the value of the designated column in the current row 409 * of this <code>ResultSet</code> object as 410 * a <code>java.sql.Timestamp</code> object in the Java programming language. 411 * 412 * @param columnIndex the first column is 1, the second is 2, ... 413 * @return the column value; if the value is SQL <code>NULL</code>, the 414 * value returned is <code>null</code> 415 * @exception SQLException if the columnIndex is not valid; 416 * if a database access error occurs or this method is 417 * called on a closed result set 418 */ 419 java.sql.Timestamp getTimestamp(int columnIndex) throws SQLException; 420 421 /** 422 * Retrieves the value of the designated column in the current row 423 * of this <code>ResultSet</code> object as 424 * a stream of ASCII characters. The value can then be read in chunks from the 425 * stream. This method is particularly 426 * suitable for retrieving large <code>LONGVARCHAR</code> values. 427 * The JDBC driver will 428 * do any necessary conversion from the database format into ASCII. 429 * 430 * <P><B>Note:</B> All the data in the returned stream must be 431 * read prior to getting the value of any other column. The next 432 * call to a getter method implicitly closes the stream. Also, a 433 * stream may return <code>0</code> when the method 434 * <code>InputStream.available</code> 435 * is called whether there is data available or not. 436 * 437 * @param columnIndex the first column is 1, the second is 2, ... 438 * @return a Java input stream that delivers the database column value 439 * as a stream of one-byte ASCII characters; 440 * if the value is SQL <code>NULL</code>, the 441 * value returned is <code>null</code> 442 * @exception SQLException if the columnIndex is not valid; 443 * if a database access error occurs or this method is 444 * called on a closed result set 445 */ 446 java.io.InputStream getAsciiStream(int columnIndex) throws SQLException; 447 448 /** 449 * Retrieves the value of the designated column in the current row 450 * of this <code>ResultSet</code> object as 451 * as a stream of two-byte 3 characters. The first byte is 452 * the high byte; the second byte is the low byte. 453 * 454 * The value can then be read in chunks from the 455 * stream. This method is particularly 456 * suitable for retrieving large <code>LONGVARCHAR</code>values. The 457 * JDBC driver will do any necessary conversion from the database 458 * format into Unicode. 459 * 460 * <P><B>Note:</B> All the data in the returned stream must be 461 * read prior to getting the value of any other column. The next 462 * call to a getter method implicitly closes the stream. 463 * Also, a stream may return <code>0</code> when the method 464 * <code>InputStream.available</code> 465 * is called, whether there is data available or not. 466 * 467 * @param columnIndex the first column is 1, the second is 2, ... 468 * @return a Java input stream that delivers the database column value 469 * as a stream of two-byte Unicode characters; 470 * if the value is SQL <code>NULL</code>, the value returned is 471 * <code>null</code> 472 * 473 * @exception SQLException if the columnIndex is not valid; 474 * if a database access error occurs or this method is 475 * called on a closed result set 476 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 477 * this method 478 * @deprecated use <code>getCharacterStream</code> in place of 479 * <code>getUnicodeStream</code> 480 */ 481 @Deprecated 482 java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException; 483 484 /** 485 * Retrieves the value of the designated column in the current row 486 * of this <code>ResultSet</code> object as a stream of 487 * uninterpreted bytes. The value can then be read in chunks from the 488 * stream. This method is particularly 489 * suitable for retrieving large <code>LONGVARBINARY</code> values. 490 * 491 * <P><B>Note:</B> All the data in the returned stream must be 492 * read prior to getting the value of any other column. The next 493 * call to a getter method implicitly closes the stream. Also, a 494 * stream may return <code>0</code> when the method 495 * <code>InputStream.available</code> 496 * is called whether there is data available or not. 497 * 498 * @param columnIndex the first column is 1, the second is 2, ... 499 * @return a Java input stream that delivers the database column value 500 * as a stream of uninterpreted bytes; 501 * if the value is SQL <code>NULL</code>, the value returned is 502 * <code>null</code> 503 * @exception SQLException if the columnIndex is not valid; 504 * if a database access error occurs or this method is 505 * called on a closed result set 506 */ 507 java.io.InputStream getBinaryStream(int columnIndex) 508 throws SQLException; 509 510 511 // Methods for accessing results by column label 512 513 /** 514 * Retrieves the value of the designated column in the current row 515 * of this <code>ResultSet</code> object as 516 * a <code>String</code> in the Java programming language. 517 * 518 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the 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 the columnLabel is not valid; 522 * if a database access error occurs or this method is 523 * called on a closed result set 524 */ 525 String getString(String columnLabel) throws SQLException; 526 527 /** 528 * Retrieves the value of the designated column in the current row 529 * of this <code>ResultSet</code> object as 530 * a <code>boolean</code> in the Java programming language. 531 * 532 * <P>If the designated column has a datatype of CHAR or VARCHAR 533 * and contains a "0" or has a datatype of BIT, TINYINT, SMALLINT, INTEGER or BIGINT 534 * and contains a 0, a value of <code>false</code> is returned. If the designated column has a datatype 535 * of CHAR or VARCHAR 536 * and contains a "1" or has a datatype of BIT, TINYINT, SMALLINT, INTEGER or BIGINT 537 * and contains a 1, a value of <code>true</code> is returned. 538 * 539 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 540 * @return the column value; if the value is SQL <code>NULL</code>, the 541 * value returned is <code>false</code> 542 * @exception SQLException if the columnLabel is not valid; 543 * if a database access error occurs or this method is 544 * called on a closed result set 545 */ 546 boolean getBoolean(String columnLabel) throws SQLException; 547 548 /** 549 * Retrieves the value of the designated column in the current row 550 * of this <code>ResultSet</code> object as 551 * a <code>byte</code> in the Java programming language. 552 * 553 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 554 * @return the column value; if the value is SQL <code>NULL</code>, the 555 * value returned is <code>0</code> 556 * @exception SQLException if the columnLabel is not valid; 557 * if a database access error occurs or this method is 558 * called on a closed result set 559 */ 560 byte getByte(String columnLabel) throws SQLException; 561 562 /** 563 * Retrieves the value of the designated column in the current row 564 * of this <code>ResultSet</code> object as 565 * a <code>short</code> in the Java programming language. 566 * 567 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 568 * @return the column value; if the value is SQL <code>NULL</code>, the 569 * value returned is <code>0</code> 570 * @exception SQLException if the columnLabel is not valid; 571 * if a database access error occurs or this method is 572 * called on a closed result set 573 */ 574 short getShort(String columnLabel) throws SQLException; 575 576 /** 577 * Retrieves the value of the designated column in the current row 578 * of this <code>ResultSet</code> object as 579 * an <code>int</code> in the Java programming language. 580 * 581 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 582 * @return the column value; if the value is SQL <code>NULL</code>, the 583 * value returned is <code>0</code> 584 * @exception SQLException if the columnLabel is not valid; 585 * if a database access error occurs or this method is 586 * called on a closed result set 587 */ 588 int getInt(String columnLabel) throws SQLException; 589 590 /** 591 * Retrieves the value of the designated column in the current row 592 * of this <code>ResultSet</code> object as 593 * a <code>long</code> in the Java programming language. 594 * 595 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 596 * @return the column value; if the value is SQL <code>NULL</code>, the 597 * value returned is <code>0</code> 598 * @exception SQLException if the columnLabel is not valid; 599 * if a database access error occurs or this method is 600 * called on a closed result set 601 */ 602 long getLong(String columnLabel) throws SQLException; 603 604 /** 605 * Retrieves the value of the designated column in the current row 606 * of this <code>ResultSet</code> object as 607 * a <code>float</code> in the Java programming language. 608 * 609 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 610 * @return the column value; if the value is SQL <code>NULL</code>, the 611 * value returned is <code>0</code> 612 * @exception SQLException if the columnLabel is not valid; 613 * if a database access error occurs or this method is 614 * called on a closed result set 615 */ 616 float getFloat(String columnLabel) throws SQLException; 617 618 /** 619 * Retrieves the value of the designated column in the current row 620 * of this <code>ResultSet</code> object as 621 * a <code>double</code> in the Java programming language. 622 * 623 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 624 * @return the column value; if the value is SQL <code>NULL</code>, the 625 * value returned is <code>0</code> 626 * @exception SQLException if the columnLabel is not valid; 627 * if a database access error occurs or this method is 628 * called on a closed result set 629 */ 630 double getDouble(String columnLabel) throws SQLException; 631 632 /** 633 * Retrieves the value of the designated column in the current row 634 * of this <code>ResultSet</code> object as 635 * a <code>java.math.BigDecimal</code> in the Java programming language. 636 * 637 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 638 * @param scale the number of digits to the right of the decimal point 639 * @return the column value; if the value is SQL <code>NULL</code>, the 640 * value returned is <code>null</code> 641 * @exception SQLException if the columnLabel is not valid; 642 * if a database access error occurs or this method is 643 * called on a closed result set 644 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 645 * this method 646 * @deprecated Use {@code getBigDecimal(int columnIndex)} 647 * or {@code getBigDecimal(String columnLabel)} 648 */ 649 @Deprecated 650 BigDecimal getBigDecimal(String columnLabel, int scale) throws SQLException; 651 652 /** 653 * Retrieves the value of the designated column in the current row 654 * of this <code>ResultSet</code> object as 655 * a <code>byte</code> array in the Java programming language. 656 * The bytes represent the raw values returned by the driver. 657 * 658 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 659 * @return the column value; if the value is SQL <code>NULL</code>, the 660 * value returned is <code>null</code> 661 * @exception SQLException if the columnLabel is not valid; 662 * if a database access error occurs or this method is 663 * called on a closed result set 664 */ 665 byte[] getBytes(String columnLabel) throws SQLException; 666 667 /** 668 * Retrieves the value of the designated column in the current row 669 * of this <code>ResultSet</code> object as 670 * a <code>java.sql.Date</code> object in the Java programming language. 671 * 672 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 673 * @return the column value; if the value is SQL <code>NULL</code>, the 674 * value returned is <code>null</code> 675 * @exception SQLException if the columnLabel is not valid; 676 * if a database access error occurs or this method is 677 * called on a closed result set 678 */ 679 java.sql.Date getDate(String columnLabel) throws SQLException; 680 681 /** 682 * Retrieves the value of the designated column in the current row 683 * of this <code>ResultSet</code> object as 684 * a <code>java.sql.Time</code> object in the Java programming language. 685 * 686 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 687 * @return the column value; 688 * if the value is SQL <code>NULL</code>, 689 * the value returned is <code>null</code> 690 * @exception SQLException if the columnLabel is not valid; 691 * if a database access error occurs or this method is 692 * called on a closed result set 693 */ 694 java.sql.Time getTime(String columnLabel) throws SQLException; 695 696 /** 697 * Retrieves the value of the designated column in the current row 698 * of this <code>ResultSet</code> object as 699 * a <code>java.sql.Timestamp</code> object in the Java programming language. 700 * 701 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 702 * @return the column value; if the value is SQL <code>NULL</code>, the 703 * value returned is <code>null</code> 704 * @exception SQLException if the columnLabel is not valid; 705 * if a database access error occurs or this method is 706 * called on a closed result set 707 */ 708 java.sql.Timestamp getTimestamp(String columnLabel) throws SQLException; 709 710 /** 711 * Retrieves the value of the designated column in the current row 712 * of this <code>ResultSet</code> object as a stream of 713 * ASCII characters. The value can then be read in chunks from the 714 * stream. This method is particularly 715 * suitable for retrieving large <code>LONGVARCHAR</code> values. 716 * The JDBC driver will 717 * do any necessary conversion from the database format into ASCII. 718 * 719 * <P><B>Note:</B> All the data in the returned stream must be 720 * read prior to getting the value of any other column. The next 721 * call to a getter method implicitly closes the stream. Also, a 722 * stream may return <code>0</code> when the method <code>available</code> 723 * is called whether there is data available or not. 724 * 725 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 726 * @return a Java input stream that delivers the database column value 727 * as a stream of one-byte ASCII characters. 728 * If the value is SQL <code>NULL</code>, 729 * the value returned is <code>null</code>. 730 * @exception SQLException if the columnLabel is not valid; 731 * if a database access error occurs or this method is 732 * called on a closed result set 733 */ 734 java.io.InputStream getAsciiStream(String columnLabel) throws SQLException; 735 736 /** 737 * Retrieves the value of the designated column in the current row 738 * of this <code>ResultSet</code> object as a stream of two-byte 739 * Unicode characters. The first byte is the high byte; the second 740 * byte is the low byte. 741 * 742 * The value can then be read in chunks from the 743 * stream. This method is particularly 744 * suitable for retrieving large <code>LONGVARCHAR</code> values. 745 * The JDBC technology-enabled driver will 746 * do any necessary conversion from the database format into Unicode. 747 * 748 * <P><B>Note:</B> All the data in the returned stream must be 749 * read prior to getting the value of any other column. The next 750 * call to a getter method implicitly closes the stream. 751 * Also, a stream may return <code>0</code> when the method 752 * <code>InputStream.available</code> is called, whether there 753 * is data available or not. 754 * 755 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 756 * @return a Java input stream that delivers the database column value 757 * as a stream of two-byte Unicode characters. 758 * If the value is SQL <code>NULL</code>, the value returned 759 * is <code>null</code>. 760 * @exception SQLException if the columnLabel is not valid; 761 * if a database access error occurs or this method is 762 * called on a closed result set 763 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 764 * this method 765 * @deprecated use <code>getCharacterStream</code> instead 766 */ 767 @Deprecated 768 java.io.InputStream getUnicodeStream(String columnLabel) throws SQLException; 769 770 /** 771 * Retrieves the value of the designated column in the current row 772 * of this <code>ResultSet</code> object as a stream of uninterpreted 773 * <code>byte</code>s. 774 * The value can then be read in chunks from the 775 * stream. This method is particularly 776 * suitable for retrieving large <code>LONGVARBINARY</code> 777 * values. 778 * 779 * <P><B>Note:</B> All the data in the returned stream must be 780 * read prior to getting the value of any other column. The next 781 * call to a getter method implicitly closes the stream. Also, a 782 * stream may return <code>0</code> when the method <code>available</code> 783 * is called whether there is data available or not. 784 * 785 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 786 * @return a Java input stream that delivers the database column value 787 * as a stream of uninterpreted bytes; 788 * if the value is SQL <code>NULL</code>, the result is <code>null</code> 789 * @exception SQLException if the columnLabel is not valid; 790 * if a database access error occurs or this method is 791 * called on a closed result set 792 */ 793 java.io.InputStream getBinaryStream(String columnLabel) 794 throws SQLException; 795 796 797 // Advanced features: 798 799 /** 800 * Retrieves the first warning reported by calls on this 801 * <code>ResultSet</code> object. 802 * Subsequent warnings on this <code>ResultSet</code> object 803 * will be chained to the <code>SQLWarning</code> object that 804 * this method returns. 805 * 806 * <P>The warning chain is automatically cleared each time a new 807 * row is read. This method may not be called on a <code>ResultSet</code> 808 * object that has been closed; doing so will cause an 809 * <code>SQLException</code> to be thrown. 810 * <P> 811 * <B>Note:</B> This warning chain only covers warnings caused 812 * by <code>ResultSet</code> methods. Any warning caused by 813 * <code>Statement</code> methods 814 * (such as reading OUT parameters) will be chained on the 815 * <code>Statement</code> object. 816 * 817 * @return the first <code>SQLWarning</code> object reported or 818 * <code>null</code> if there are none 819 * @exception SQLException if a database access error occurs or this method is 820 * called on a closed result set 821 */ 822 SQLWarning getWarnings() throws SQLException; 823 824 /** 825 * Clears all warnings reported on this <code>ResultSet</code> object. 826 * After this method is called, the method <code>getWarnings</code> 827 * returns <code>null</code> until a new warning is 828 * reported for this <code>ResultSet</code> object. 829 * 830 * @exception SQLException if a database access error occurs or this method is 831 * called on a closed result set 832 */ 833 void clearWarnings() throws SQLException; 834 835 /** 836 * Retrieves the name of the SQL cursor used by this <code>ResultSet</code> 837 * object. 838 * 839 * <P>In SQL, a result table is retrieved through a cursor that is 840 * named. The current row of a result set can be updated or deleted 841 * using a positioned update/delete statement that references the 842 * cursor name. To insure that the cursor has the proper isolation 843 * level to support update, the cursor's <code>SELECT</code> statement 844 * should be of the form <code>SELECT FOR UPDATE</code>. If 845 * <code>FOR UPDATE</code> is omitted, the positioned updates may fail. 846 * 847 * <P>The JDBC API supports this SQL feature by providing the name of the 848 * SQL cursor used by a <code>ResultSet</code> object. 849 * The current row of a <code>ResultSet</code> object 850 * is also the current row of this SQL cursor. 851 * 852 * @return the SQL name for this <code>ResultSet</code> object's cursor 853 * @exception SQLException if a database access error occurs or this method is called on a closed result set 854 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 855 * this method 856 */ 857 String getCursorName() throws SQLException; 858 859 /** 860 * Retrieves the number, types and properties of 861 * this <code>ResultSet</code> object's columns. 862 * 863 * @return the description of this <code>ResultSet</code> object's columns 864 * @exception SQLException if a database access error occurs or this method is 865 * called on a closed result set 866 */ 867 ResultSetMetaData getMetaData() throws SQLException; 868 869 /** 870 * <p>Gets the value of the designated column in the current row 871 * of this <code>ResultSet</code> object as 872 * an <code>Object</code> in the Java programming language. 873 * 874 * <p>This method will return the value of the given column as a 875 * Java object. The type of the Java object will be the default 876 * Java object type corresponding to the column's SQL type, 877 * following the mapping for built-in types specified in the JDBC 878 * specification. If the value is an SQL <code>NULL</code>, 879 * the driver returns a Java <code>null</code>. 880 * 881 * <p>This method may also be used to read database-specific 882 * abstract data types. 883 * 884 * In the JDBC 2.0 API, the behavior of method 885 * <code>getObject</code> is extended to materialize 886 * data of SQL user-defined types. 887 * <p> 888 * If <code>Connection.getTypeMap</code> does not throw a 889 * <code>SQLFeatureNotSupportedException</code>, 890 * then when a column contains a structured or distinct value, 891 * the behavior of this method is as 892 * if it were a call to: <code>getObject(columnIndex, 893 * this.getStatement().getConnection().getTypeMap())</code>. 894 * 895 * If <code>Connection.getTypeMap</code> does throw a 896 * <code>SQLFeatureNotSupportedException</code>, 897 * then structured values are not supported, and distinct values 898 * are mapped to the default Java class as determined by the 899 * underlying SQL type of the DISTINCT type. 900 * 901 * @param columnIndex the first column is 1, the second is 2, ... 902 * @return a <code>java.lang.Object</code> holding the column value 903 * @exception SQLException if the columnIndex is not valid; 904 * if a database access error occurs or this method is 905 * called on a closed result set 906 */ 907 Object getObject(int columnIndex) throws SQLException; 908 909 /** 910 * <p>Gets the value of the designated column in the current row 911 * of this <code>ResultSet</code> object as 912 * an <code>Object</code> in the Java programming language. 913 * 914 * <p>This method will return the value of the given column as a 915 * Java object. The type of the Java object will be the default 916 * Java object type corresponding to the column's SQL type, 917 * following the mapping for built-in types specified in the JDBC 918 * specification. If the value is an SQL <code>NULL</code>, 919 * the driver returns a Java <code>null</code>. 920 * <P> 921 * This method may also be used to read database-specific 922 * abstract data types. 923 * <P> 924 * In the JDBC 2.0 API, the behavior of the method 925 * <code>getObject</code> is extended to materialize 926 * data of SQL user-defined types. When a column contains 927 * a structured or distinct value, the behavior of this method is as 928 * if it were a call to: <code>getObject(columnIndex, 929 * this.getStatement().getConnection().getTypeMap())</code>. 930 * 931 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 932 * @return a <code>java.lang.Object</code> holding the column value 933 * @exception SQLException if the columnLabel is not valid; 934 * if a database access error occurs or this method is 935 * called on a closed result set 936 */ 937 Object getObject(String columnLabel) throws SQLException; 938 939 //---------------------------------------------------------------- 940 941 /** 942 * Maps the given <code>ResultSet</code> column label to its 943 * <code>ResultSet</code> column index. 944 * 945 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 946 * @return the column index of the given column name 947 * @exception SQLException if the <code>ResultSet</code> object 948 * does not contain a column labeled <code>columnLabel</code>, a database access error occurs 949 * or this method is called on a closed result set 950 */ 951 int findColumn(String columnLabel) throws SQLException; 952 953 954 //--------------------------JDBC 2.0----------------------------------- 955 956 //--------------------------------------------------------------------- 957 // Getters and Setters 958 //--------------------------------------------------------------------- 959 960 /** 961 * Retrieves the value of the designated column in the current row 962 * of this <code>ResultSet</code> object as a 963 * <code>java.io.Reader</code> object. 964 * @return a <code>java.io.Reader</code> object that contains the column 965 * value; if the value is SQL <code>NULL</code>, the value returned is 966 * <code>null</code> in the Java programming language. 967 * @param columnIndex the first column is 1, the second is 2, ... 968 * @exception SQLException if the columnIndex is not valid; 969 * if a database access error occurs or this method is 970 * called on a closed result set 971 * @since 1.2 972 */ 973 java.io.Reader getCharacterStream(int columnIndex) throws SQLException; 974 975 /** 976 * Retrieves the value of the designated column in the current row 977 * of this <code>ResultSet</code> object as a 978 * <code>java.io.Reader</code> object. 979 * 980 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 981 * @return a <code>java.io.Reader</code> object that contains the column 982 * value; if the value is SQL <code>NULL</code>, the value returned is 983 * <code>null</code> in the Java programming language 984 * @exception SQLException if the columnLabel is not valid; 985 * if a database access error occurs or this method is 986 * called on a closed result set 987 * @since 1.2 988 */ 989 java.io.Reader getCharacterStream(String columnLabel) throws SQLException; 990 991 /** 992 * Retrieves the value of the designated column in the current row 993 * of this <code>ResultSet</code> object as a 994 * <code>java.math.BigDecimal</code> with full precision. 995 * 996 * @param columnIndex the first column is 1, the second is 2, ... 997 * @return the column value (full precision); 998 * if the value is SQL <code>NULL</code>, the value returned is 999 * <code>null</code> in the Java programming language. 1000 * @exception SQLException if the columnIndex is not valid; 1001 * if a database access error occurs or this method is 1002 * called on a closed result set 1003 * @since 1.2 1004 */ 1005 BigDecimal getBigDecimal(int columnIndex) throws SQLException; 1006 1007 /** 1008 * Retrieves the value of the designated column in the current row 1009 * of this <code>ResultSet</code> object as a 1010 * <code>java.math.BigDecimal</code> with full precision. 1011 * 1012 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 1013 * @return the column value (full precision); 1014 * if the value is SQL <code>NULL</code>, the value returned is 1015 * <code>null</code> in the Java programming language. 1016 * @exception SQLException if the columnLabel is not valid; 1017 * if a database access error occurs or this method is 1018 * called on a closed result set 1019 * @since 1.2 1020 * 1021 */ 1022 BigDecimal getBigDecimal(String columnLabel) throws SQLException; 1023 1024 //--------------------------------------------------------------------- 1025 // Traversal/Positioning 1026 //--------------------------------------------------------------------- 1027 1028 /** 1029 * Retrieves whether the cursor is before the first row in 1030 * this <code>ResultSet</code> object. 1031 * <p> 1032 * <strong>Note:</strong>Support for the <code>isBeforeFirst</code> method 1033 * is optional for <code>ResultSet</code>s with a result 1034 * set type of <code>TYPE_FORWARD_ONLY</code> 1035 * 1036 * @return <code>true</code> if the cursor is before the first row; 1037 * <code>false</code> if the cursor is at any other position or the 1038 * result set contains no rows 1039 * @exception SQLException if a database access error occurs or this method is 1040 * called on a closed result set 1041 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1042 * this method 1043 * @since 1.2 1044 */ 1045 boolean isBeforeFirst() throws SQLException; 1046 1047 /** 1048 * Retrieves whether the cursor is after the last row in 1049 * this <code>ResultSet</code> object. 1050 * <p> 1051 * <strong>Note:</strong>Support for the <code>isAfterLast</code> method 1052 * is optional for <code>ResultSet</code>s with a result 1053 * set type of <code>TYPE_FORWARD_ONLY</code> 1054 * 1055 * @return <code>true</code> if the cursor is after the last row; 1056 * <code>false</code> if the cursor is at any other position or the 1057 * result set contains no rows 1058 * @exception SQLException if a database access error occurs or this method is 1059 * called on a closed result set 1060 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1061 * this method 1062 * @since 1.2 1063 */ 1064 boolean isAfterLast() throws SQLException; 1065 1066 /** 1067 * Retrieves whether the cursor is on the first row of 1068 * this <code>ResultSet</code> object. 1069 * <p> 1070 * <strong>Note:</strong>Support for the <code>isFirst</code> method 1071 * is optional for <code>ResultSet</code>s with a result 1072 * set type of <code>TYPE_FORWARD_ONLY</code> 1073 * 1074 * @return <code>true</code> if the cursor is on the first row; 1075 * <code>false</code> otherwise 1076 * @exception SQLException if a database access error occurs or this method is 1077 * called on a closed result set 1078 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1079 * this method 1080 * @since 1.2 1081 */ 1082 boolean isFirst() throws SQLException; 1083 1084 /** 1085 * Retrieves whether the cursor is on the last row of 1086 * this <code>ResultSet</code> object. 1087 * <strong>Note:</strong> Calling the method <code>isLast</code> may be expensive 1088 * because the JDBC driver 1089 * might need to fetch ahead one row in order to determine 1090 * whether the current row is the last row in the result set. 1091 * <p> 1092 * <strong>Note:</strong> Support for the <code>isLast</code> method 1093 * is optional for <code>ResultSet</code>s with a result 1094 * set type of <code>TYPE_FORWARD_ONLY</code> 1095 * @return <code>true</code> if the cursor is on the last row; 1096 * <code>false</code> otherwise 1097 * @exception SQLException if a database access error occurs or this method is 1098 * called on a closed result set 1099 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1100 * this method 1101 * @since 1.2 1102 */ 1103 boolean isLast() throws SQLException; 1104 1105 /** 1106 * Moves the cursor to the front of 1107 * this <code>ResultSet</code> object, just before the 1108 * first row. This method has no effect if the result set contains no rows. 1109 * 1110 * @exception SQLException if a database access error 1111 * occurs; this method is called on a closed result set or the 1112 * result set type is <code>TYPE_FORWARD_ONLY</code> 1113 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1114 * this method 1115 * @since 1.2 1116 */ 1117 void beforeFirst() throws SQLException; 1118 1119 /** 1120 * Moves the cursor to the end of 1121 * this <code>ResultSet</code> object, just after the 1122 * last row. This method has no effect if the result set contains no rows. 1123 * @exception SQLException if a database access error 1124 * occurs; this method is called on a closed result set 1125 * or the result set type is <code>TYPE_FORWARD_ONLY</code> 1126 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1127 * this method 1128 * @since 1.2 1129 */ 1130 void afterLast() throws SQLException; 1131 1132 /** 1133 * Moves the cursor to the first row in 1134 * this <code>ResultSet</code> object. 1135 * 1136 * @return <code>true</code> if the cursor is on a valid row; 1137 * <code>false</code> if there are no rows in the result set 1138 * @exception SQLException if a database access error 1139 * occurs; this method is called on a closed result set 1140 * or the result set type is <code>TYPE_FORWARD_ONLY</code> 1141 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1142 * this method 1143 * @since 1.2 1144 */ 1145 boolean first() throws SQLException; 1146 1147 /** 1148 * Moves the cursor to the last row in 1149 * this <code>ResultSet</code> object. 1150 * 1151 * @return <code>true</code> if the cursor is on a valid row; 1152 * <code>false</code> if there are no rows in the result set 1153 * @exception SQLException if a database access error 1154 * occurs; this method is called on a closed result set 1155 * or the result set type is <code>TYPE_FORWARD_ONLY</code> 1156 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1157 * this method 1158 * @since 1.2 1159 */ 1160 boolean last() throws SQLException; 1161 1162 /** 1163 * Retrieves the current row number. The first row is number 1, the 1164 * second number 2, and so on. 1165 * <p> 1166 * <strong>Note:</strong>Support for the <code>getRow</code> method 1167 * is optional for <code>ResultSet</code>s with a result 1168 * set type of <code>TYPE_FORWARD_ONLY</code> 1169 * 1170 * @return the current row number; <code>0</code> if there is no current row 1171 * @exception SQLException if a database access error occurs 1172 * or this method is called on a closed result set 1173 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1174 * this method 1175 * @since 1.2 1176 */ 1177 int getRow() throws SQLException; 1178 1179 /** 1180 * Moves the cursor to the given row number in 1181 * this <code>ResultSet</code> object. 1182 * 1183 * <p>If the row number is positive, the cursor moves to 1184 * the given row number with respect to the 1185 * beginning of the result set. The first row is row 1, the second 1186 * is row 2, and so on. 1187 * 1188 * <p>If the given row number is negative, the cursor moves to 1189 * an absolute row position with respect to 1190 * the end of the result set. For example, calling the method 1191 * <code>absolute(-1)</code> positions the 1192 * cursor on the last row; calling the method <code>absolute(-2)</code> 1193 * moves the cursor to the next-to-last row, and so on. 1194 * 1195 * <p>If the row number specified is zero, the cursor is moved to 1196 * before the first row. 1197 * 1198 * <p>An attempt to position the cursor beyond the first/last row in 1199 * the result set leaves the cursor before the first row or after 1200 * the last row. 1201 * 1202 * <p><B>Note:</B> Calling <code>absolute(1)</code> is the same 1203 * as calling <code>first()</code>. Calling <code>absolute(-1)</code> 1204 * is the same as calling <code>last()</code>. 1205 * 1206 * @param row the number of the row to which the cursor should move. 1207 * A value of zero indicates that the cursor will be positioned 1208 * before the first row; a positive number indicates the row number 1209 * counting from the beginning of the result set; a negative number 1210 * indicates the row number counting from the end of the result set 1211 * @return <code>true</code> if the cursor is moved to a position in this 1212 * <code>ResultSet</code> object; 1213 * <code>false</code> if the cursor is before the first row or after the 1214 * last row 1215 * @exception SQLException if a database access error 1216 * occurs; this method is called on a closed result set 1217 * or the result set type is <code>TYPE_FORWARD_ONLY</code> 1218 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1219 * this method 1220 * @since 1.2 1221 */ 1222 boolean absolute( int row ) throws SQLException; 1223 1224 /** 1225 * Moves the cursor a relative number of rows, either positive or negative. 1226 * Attempting to move beyond the first/last row in the 1227 * result set positions the cursor before/after the 1228 * the first/last row. Calling <code>relative(0)</code> is valid, but does 1229 * not change the cursor position. 1230 * 1231 * <p>Note: Calling the method <code>relative(1)</code> 1232 * is identical to calling the method <code>next()</code> and 1233 * calling the method <code>relative(-1)</code> is identical 1234 * to calling the method <code>previous()</code>. 1235 * 1236 * @param rows an <code>int</code> specifying the number of rows to 1237 * move from the current row; a positive number moves the cursor 1238 * forward; a negative number moves the cursor backward 1239 * @return <code>true</code> if the cursor is on a row; 1240 * <code>false</code> otherwise 1241 * @exception SQLException if a database access error occurs; this method 1242 * is called on a closed result set or the result set type is 1243 * <code>TYPE_FORWARD_ONLY</code> 1244 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1245 * this method 1246 * @since 1.2 1247 */ 1248 boolean relative( int rows ) throws SQLException; 1249 1250 /** 1251 * Moves the cursor to the previous row in this 1252 * <code>ResultSet</code> object. 1253 *<p> 1254 * When a call to the <code>previous</code> method returns <code>false</code>, 1255 * the cursor is positioned before the first row. Any invocation of a 1256 * <code>ResultSet</code> method which requires a current row will result in a 1257 * <code>SQLException</code> being thrown. 1258 *<p> 1259 * If an input stream is open for the current row, a call to the method 1260 * <code>previous</code> will implicitly close it. A <code>ResultSet</code> 1261 * object's warning change is cleared when a new row is read. 1262 *<p> 1263 * 1264 * @return <code>true</code> if the cursor is now positioned on a valid row; 1265 * <code>false</code> if the cursor is positioned before the first row 1266 * @exception SQLException if a database access error 1267 * occurs; this method is called on a closed result set 1268 * or the result set type is <code>TYPE_FORWARD_ONLY</code> 1269 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1270 * this method 1271 * @since 1.2 1272 */ 1273 boolean previous() throws SQLException; 1274 1275 //--------------------------------------------------------------------- 1276 // Properties 1277 //--------------------------------------------------------------------- 1278 1279 /** 1280 * The constant indicating that the rows in a result set will be 1281 * processed in a forward direction; first-to-last. 1282 * This constant is used by the method <code>setFetchDirection</code> 1283 * as a hint to the driver, which the driver may ignore. 1284 * @since 1.2 1285 */ 1286 int FETCH_FORWARD = 1000; 1287 1288 /** 1289 * The constant indicating that the rows in a result set will be 1290 * processed in a reverse direction; last-to-first. 1291 * This constant is used by the method <code>setFetchDirection</code> 1292 * as a hint to the driver, which the driver may ignore. 1293 * @since 1.2 1294 */ 1295 int FETCH_REVERSE = 1001; 1296 1297 /** 1298 * The constant indicating that the order in which rows in a 1299 * result set will be processed is unknown. 1300 * This constant is used by the method <code>setFetchDirection</code> 1301 * as a hint to the driver, which the driver may ignore. 1302 */ 1303 int FETCH_UNKNOWN = 1002; 1304 1305 /** 1306 * Gives a hint as to the direction in which the rows in this 1307 * <code>ResultSet</code> object will be processed. 1308 * The initial value is determined by the 1309 * <code>Statement</code> object 1310 * that produced this <code>ResultSet</code> object. 1311 * The fetch direction may be changed at any time. 1312 * 1313 * @param direction an <code>int</code> specifying the suggested 1314 * fetch direction; one of <code>ResultSet.FETCH_FORWARD</code>, 1315 * <code>ResultSet.FETCH_REVERSE</code>, or 1316 * <code>ResultSet.FETCH_UNKNOWN</code> 1317 * @exception SQLException if a database access error occurs; this 1318 * method is called on a closed result set or 1319 * the result set type is <code>TYPE_FORWARD_ONLY</code> and the fetch 1320 * direction is not <code>FETCH_FORWARD</code> 1321 * @since 1.2 1322 * @see Statement#setFetchDirection 1323 * @see #getFetchDirection 1324 */ 1325 void setFetchDirection(int direction) throws SQLException; 1326 1327 /** 1328 * Retrieves the fetch direction for this 1329 * <code>ResultSet</code> object. 1330 * 1331 * @return the current fetch direction for this <code>ResultSet</code> object 1332 * @exception SQLException if a database access error occurs 1333 * or this method is called on a closed result set 1334 * @since 1.2 1335 * @see #setFetchDirection 1336 */ 1337 int getFetchDirection() throws SQLException; 1338 1339 /** 1340 * Gives the JDBC driver a hint as to the number of rows that should 1341 * be fetched from the database when more rows are needed for this 1342 * <code>ResultSet</code> object. 1343 * If the fetch size specified is zero, the JDBC driver 1344 * ignores the value and is free to make its own best guess as to what 1345 * the fetch size should be. The default value is set by the 1346 * <code>Statement</code> object 1347 * that created the result set. The fetch size may be changed at any time. 1348 * 1349 * @param rows the number of rows to fetch 1350 * @exception SQLException if a database access error occurs; this method 1351 * is called on a closed result set or the 1352 * condition {@code rows >= 0} is not satisfied 1353 * @since 1.2 1354 * @see #getFetchSize 1355 */ 1356 void setFetchSize(int rows) throws SQLException; 1357 1358 /** 1359 * Retrieves the fetch size for this 1360 * <code>ResultSet</code> object. 1361 * 1362 * @return the current fetch size for this <code>ResultSet</code> object 1363 * @exception SQLException if a database access error occurs 1364 * or this method is called on a closed result set 1365 * @since 1.2 1366 * @see #setFetchSize 1367 */ 1368 int getFetchSize() throws SQLException; 1369 1370 /** 1371 * The constant indicating the type for a <code>ResultSet</code> object 1372 * whose cursor may move only forward. 1373 * @since 1.2 1374 */ 1375 int TYPE_FORWARD_ONLY = 1003; 1376 1377 /** 1378 * The constant indicating the type for a <code>ResultSet</code> object 1379 * that is scrollable but generally not sensitive to changes to the data 1380 * that underlies the <code>ResultSet</code>. 1381 * @since 1.2 1382 */ 1383 int TYPE_SCROLL_INSENSITIVE = 1004; 1384 1385 /** 1386 * The constant indicating the type for a <code>ResultSet</code> object 1387 * that is scrollable and generally sensitive to changes to the data 1388 * that underlies the <code>ResultSet</code>. 1389 * @since 1.2 1390 */ 1391 int TYPE_SCROLL_SENSITIVE = 1005; 1392 1393 /** 1394 * Retrieves the type of this <code>ResultSet</code> object. 1395 * The type is determined by the <code>Statement</code> object 1396 * that created the result set. 1397 * 1398 * @return <code>ResultSet.TYPE_FORWARD_ONLY</code>, 1399 * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, 1400 * or <code>ResultSet.TYPE_SCROLL_SENSITIVE</code> 1401 * @exception SQLException if a database access error occurs 1402 * or this method is called on a closed result set 1403 * @since 1.2 1404 */ 1405 int getType() throws SQLException; 1406 1407 /** 1408 * The constant indicating the concurrency mode for a 1409 * <code>ResultSet</code> object that may NOT be updated. 1410 * @since 1.2 1411 */ 1412 int CONCUR_READ_ONLY = 1007; 1413 1414 /** 1415 * The constant indicating the concurrency mode for a 1416 * <code>ResultSet</code> object that may be updated. 1417 * @since 1.2 1418 */ 1419 int CONCUR_UPDATABLE = 1008; 1420 1421 /** 1422 * Retrieves the concurrency mode of this <code>ResultSet</code> object. 1423 * The concurrency used is determined by the 1424 * <code>Statement</code> object that created the result set. 1425 * 1426 * @return the concurrency type, either 1427 * <code>ResultSet.CONCUR_READ_ONLY</code> 1428 * or <code>ResultSet.CONCUR_UPDATABLE</code> 1429 * @exception SQLException if a database access error occurs 1430 * or this method is called on a closed result set 1431 * @since 1.2 1432 */ 1433 int getConcurrency() throws SQLException; 1434 1435 //--------------------------------------------------------------------- 1436 // Updates 1437 //--------------------------------------------------------------------- 1438 1439 /** 1440 * Retrieves whether the current row has been updated. The value returned 1441 * depends on whether or not the result set can detect updates. 1442 * <p> 1443 * <strong>Note:</strong> Support for the <code>rowUpdated</code> method is optional with a result set 1444 * concurrency of <code>CONCUR_READ_ONLY</code> 1445 * @return <code>true</code> if the current row is detected to 1446 * have been visibly updated by the owner or another; <code>false</code> otherwise 1447 * @exception SQLException if a database access error occurs 1448 * or this method is called on a closed result set 1449 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1450 * this method 1451 * @see DatabaseMetaData#updatesAreDetected 1452 * @since 1.2 1453 */ 1454 boolean rowUpdated() throws SQLException; 1455 1456 /** 1457 * Retrieves whether the current row has had an insertion. 1458 * The value returned depends on whether or not this 1459 * <code>ResultSet</code> object can detect visible inserts. 1460 * <p> 1461 * <strong>Note:</strong> Support for the <code>rowInserted</code> method is optional with a result set 1462 * concurrency of <code>CONCUR_READ_ONLY</code> 1463 * @return <code>true</code> if the current row is detected to 1464 * have been inserted; <code>false</code> otherwise 1465 * @exception SQLException if a database access error occurs 1466 * or this method is called on a closed result set 1467 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1468 * this method 1469 * 1470 * @see DatabaseMetaData#insertsAreDetected 1471 * @since 1.2 1472 */ 1473 boolean rowInserted() throws SQLException; 1474 1475 /** 1476 * Retrieves whether a row has been deleted. A deleted row may leave 1477 * a visible "hole" in a result set. This method can be used to 1478 * detect holes in a result set. The value returned depends on whether 1479 * or not this <code>ResultSet</code> object can detect deletions. 1480 * <p> 1481 * <strong>Note:</strong> Support for the <code>rowDeleted</code> method is optional with a result set 1482 * concurrency of <code>CONCUR_READ_ONLY</code> 1483 * @return <code>true</code> if the current row is detected to 1484 * have been deleted by the owner or another; <code>false</code> otherwise 1485 * @exception SQLException if a database access error occurs 1486 * or this method is called on a closed result set 1487 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1488 * this method 1489 * 1490 * @see DatabaseMetaData#deletesAreDetected 1491 * @since 1.2 1492 */ 1493 boolean rowDeleted() throws SQLException; 1494 1495 /** 1496 * Updates the designated column with a <code>null</code> value. 1497 * 1498 * The updater methods are used to update column values in the 1499 * current row or the insert row. The updater methods do not 1500 * update the underlying database; instead the <code>updateRow</code> 1501 * or <code>insertRow</code> methods are called to update the database. 1502 * 1503 * @param columnIndex the first column is 1, the second is 2, ... 1504 * @exception SQLException if the columnIndex is not valid; 1505 * if a database access error occurs; 1506 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1507 * or this method is called on a closed result set 1508 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1509 * this method 1510 * @since 1.2 1511 */ 1512 void updateNull(int columnIndex) throws SQLException; 1513 1514 /** 1515 * Updates the designated column with a <code>boolean</code> value. 1516 * The updater methods are used to update column values in the 1517 * current row or the insert row. The updater methods do not 1518 * update the underlying database; instead the <code>updateRow</code> or 1519 * <code>insertRow</code> methods are called to update the database. 1520 * 1521 * @param columnIndex the first column is 1, the second is 2, ... 1522 * @param x the new column value 1523 * @exception SQLException if the columnIndex is not valid; 1524 * if a database access error occurs; 1525 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1526 * or this method is called on a closed result set 1527 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1528 * this method 1529 * @since 1.2 1530 */ 1531 void updateBoolean(int columnIndex, boolean x) throws SQLException; 1532 1533 /** 1534 * Updates the designated column with a <code>byte</code> value. 1535 * The updater methods are used to update column values in the 1536 * current row or the insert row. The updater methods do not 1537 * update the underlying database; instead the <code>updateRow</code> or 1538 * <code>insertRow</code> methods are called to update the database. 1539 * 1540 * 1541 * @param columnIndex the first column is 1, the second is 2, ... 1542 * @param x the new column value 1543 * @exception SQLException if the columnIndex is not valid; 1544 * if a database access error occurs; 1545 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1546 * or this method is called on a closed result set 1547 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1548 * this method 1549 * @since 1.2 1550 */ 1551 void updateByte(int columnIndex, byte x) throws SQLException; 1552 1553 /** 1554 * Updates the designated column with a <code>short</code> value. 1555 * The updater methods are used to update column values in the 1556 * current row or the insert row. The updater methods do not 1557 * update the underlying database; instead the <code>updateRow</code> or 1558 * <code>insertRow</code> methods are called to update the database. 1559 * 1560 * @param columnIndex the first column is 1, the second is 2, ... 1561 * @param x the new column value 1562 * @exception SQLException if the columnIndex is not valid; 1563 * if a database access error occurs; 1564 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1565 * or this method is called on a closed result set 1566 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1567 * this method 1568 * @since 1.2 1569 */ 1570 void updateShort(int columnIndex, short x) throws SQLException; 1571 1572 /** 1573 * Updates the designated column with an <code>int</code> value. 1574 * The updater methods are used to update column values in the 1575 * current row or the insert row. The updater methods do not 1576 * update the underlying database; instead the <code>updateRow</code> or 1577 * <code>insertRow</code> methods are called to update the database. 1578 * 1579 * @param columnIndex the first column is 1, the second is 2, ... 1580 * @param x the new column value 1581 * @exception SQLException if the columnIndex is not valid; 1582 * if a database access error occurs; 1583 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1584 * or this method is called on a closed result set 1585 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1586 * this method 1587 * @since 1.2 1588 */ 1589 void updateInt(int columnIndex, int x) throws SQLException; 1590 1591 /** 1592 * Updates the designated column with a <code>long</code> value. 1593 * The updater methods are used to update column values in the 1594 * current row or the insert row. The updater methods do not 1595 * update the underlying database; instead the <code>updateRow</code> or 1596 * <code>insertRow</code> methods are called to update the database. 1597 * 1598 * @param columnIndex the first column is 1, the second is 2, ... 1599 * @param x the new column value 1600 * @exception SQLException if the columnIndex is not valid; 1601 * if a database access error occurs; 1602 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1603 * or this method is called on a closed result set 1604 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1605 * this method 1606 * @since 1.2 1607 */ 1608 void updateLong(int columnIndex, long x) throws SQLException; 1609 1610 /** 1611 * Updates the designated column with a <code>float</code> value. 1612 * The updater methods are used to update column values in the 1613 * current row or the insert row. The updater methods do not 1614 * update the underlying database; instead the <code>updateRow</code> or 1615 * <code>insertRow</code> methods are called to update the database. 1616 * 1617 * @param columnIndex the first column is 1, the second is 2, ... 1618 * @param x the new column value 1619 * @exception SQLException if the columnIndex is not valid; 1620 * if a database access error occurs; 1621 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1622 * or this method is called on a closed result set 1623 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1624 * this method 1625 * @since 1.2 1626 */ 1627 void updateFloat(int columnIndex, float x) throws SQLException; 1628 1629 /** 1630 * Updates the designated column with a <code>double</code> value. 1631 * The updater methods are used to update column values in the 1632 * current row or the insert row. The updater methods do not 1633 * update the underlying database; instead the <code>updateRow</code> or 1634 * <code>insertRow</code> methods are called to update the database. 1635 * 1636 * @param columnIndex the first column is 1, the second is 2, ... 1637 * @param x the new column value 1638 * @exception SQLException if the columnIndex is not valid; 1639 * if a database access error occurs; 1640 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1641 * or this method is called on a closed result set 1642 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1643 * this method 1644 * @since 1.2 1645 */ 1646 void updateDouble(int columnIndex, double x) throws SQLException; 1647 1648 /** 1649 * Updates the designated column with a <code>java.math.BigDecimal</code> 1650 * value. 1651 * The updater methods are used to update column values in the 1652 * current row or the insert row. The updater methods do not 1653 * update the underlying database; instead the <code>updateRow</code> or 1654 * <code>insertRow</code> methods are called to update the database. 1655 * 1656 * @param columnIndex the first column is 1, the second is 2, ... 1657 * @param x the new column value 1658 * @exception SQLException if the columnIndex is not valid; 1659 * if a database access error occurs; 1660 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1661 * or this method is called on a closed result set 1662 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1663 * this method 1664 * @since 1.2 1665 */ 1666 void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException; 1667 1668 /** 1669 * Updates the designated column with a <code>String</code> value. 1670 * The updater methods are used to update column values in the 1671 * current row or the insert row. The updater methods do not 1672 * update the underlying database; instead the <code>updateRow</code> or 1673 * <code>insertRow</code> methods are called to update the database. 1674 * 1675 * @param columnIndex the first column is 1, the second is 2, ... 1676 * @param x the new column value 1677 * @exception SQLException if the columnIndex is not valid; 1678 * if a database access error occurs; 1679 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1680 * or this method is called on a closed result set 1681 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1682 * this method 1683 * @since 1.2 1684 */ 1685 void updateString(int columnIndex, String x) throws SQLException; 1686 1687 /** 1688 * Updates the designated column with a <code>byte</code> array value. 1689 * The updater methods are used to update column values in the 1690 * current row or the insert row. The updater methods do not 1691 * update the underlying database; instead the <code>updateRow</code> or 1692 * <code>insertRow</code> methods are called to update the database. 1693 * 1694 * @param columnIndex the first column is 1, the second is 2, ... 1695 * @param x the new column value 1696 * @exception SQLException if the columnIndex is not valid; 1697 * if a database access error occurs; 1698 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1699 * or this method is called on a closed result set 1700 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1701 * this method 1702 * @since 1.2 1703 */ 1704 void updateBytes(int columnIndex, byte x[]) throws SQLException; 1705 1706 /** 1707 * Updates the designated column with a <code>java.sql.Date</code> value. 1708 * The updater methods are used to update column values in the 1709 * current row or the insert row. The updater methods do not 1710 * update the underlying database; instead the <code>updateRow</code> or 1711 * <code>insertRow</code> methods are called to update the database. 1712 * 1713 * @param columnIndex the first column is 1, the second is 2, ... 1714 * @param x the new column value 1715 * @exception SQLException if the columnIndex is not valid; 1716 * if a database access error occurs; 1717 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1718 * or this method is called on a closed result set 1719 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1720 * this method 1721 * @since 1.2 1722 */ 1723 void updateDate(int columnIndex, java.sql.Date x) throws SQLException; 1724 1725 /** 1726 * Updates the designated column with a <code>java.sql.Time</code> value. 1727 * The updater methods are used to update column values in the 1728 * current row or the insert row. The updater methods do not 1729 * update the underlying database; instead the <code>updateRow</code> or 1730 * <code>insertRow</code> methods are called to update the database. 1731 * 1732 * @param columnIndex the first column is 1, the second is 2, ... 1733 * @param x the new column value 1734 * @exception SQLException if the columnIndex is not valid; 1735 * if a database access error occurs; 1736 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1737 * or this method is called on a closed result set 1738 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1739 * this method 1740 * @since 1.2 1741 */ 1742 void updateTime(int columnIndex, java.sql.Time x) throws SQLException; 1743 1744 /** 1745 * Updates the designated column with a <code>java.sql.Timestamp</code> 1746 * value. 1747 * The updater methods are used to update column values in the 1748 * current row or the insert row. The updater methods do not 1749 * update the underlying database; instead the <code>updateRow</code> or 1750 * <code>insertRow</code> methods are called to update the database. 1751 * 1752 * @param columnIndex the first column is 1, the second is 2, ... 1753 * @param x the new column value 1754 * @exception SQLException if the columnIndex is not valid; 1755 * if a database access error occurs; 1756 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1757 * or this method is called on a closed result set 1758 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1759 * this method 1760 * @since 1.2 1761 */ 1762 void updateTimestamp(int columnIndex, java.sql.Timestamp x) 1763 throws SQLException; 1764 1765 /** 1766 * Updates the designated column with an ascii stream value, which will have 1767 * the specified number of bytes. 1768 * The updater methods are used to update column values in the 1769 * current row or the insert row. The updater methods do not 1770 * update the underlying database; instead the <code>updateRow</code> or 1771 * <code>insertRow</code> methods are called to update the database. 1772 * 1773 * @param columnIndex the first column is 1, the second is 2, ... 1774 * @param x the new column value 1775 * @param length the length of the stream 1776 * @exception SQLException if the columnIndex is not valid; 1777 * if a database access error occurs; 1778 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1779 * or this method is called on a closed result set 1780 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1781 * this method 1782 * @since 1.2 1783 */ 1784 void updateAsciiStream(int columnIndex, 1785 java.io.InputStream x, 1786 int length) throws SQLException; 1787 1788 /** 1789 * Updates the designated column with a binary stream value, which will have 1790 * the specified number of bytes. 1791 * The updater methods are used to update column values in the 1792 * current row or the insert row. The updater methods do not 1793 * update the underlying database; instead the <code>updateRow</code> or 1794 * <code>insertRow</code> methods are called to update the database. 1795 * 1796 * @param columnIndex the first column is 1, the second is 2, ... 1797 * @param x the new column value 1798 * @param length the length of the stream 1799 * @exception SQLException if the columnIndex is not valid; 1800 * if a database access error occurs; 1801 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1802 * or this method is called on a closed result set 1803 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1804 * this method 1805 * @since 1.2 1806 */ 1807 void updateBinaryStream(int columnIndex, 1808 java.io.InputStream x, 1809 int length) throws SQLException; 1810 1811 /** 1812 * Updates the designated column with a character stream value, which will have 1813 * the specified number of bytes. 1814 * The updater methods are used to update column values in the 1815 * current row or the insert row. The updater methods do not 1816 * update the underlying database; instead the <code>updateRow</code> or 1817 * <code>insertRow</code> methods are called to update the database. 1818 * 1819 * @param columnIndex the first column is 1, the second is 2, ... 1820 * @param x the new column value 1821 * @param length the length of the stream 1822 * @exception SQLException if the columnIndex is not valid; 1823 * if a database access error occurs; 1824 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1825 * or this method is called on a closed result set 1826 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1827 * this method 1828 * @since 1.2 1829 */ 1830 void updateCharacterStream(int columnIndex, 1831 java.io.Reader x, 1832 int length) throws SQLException; 1833 1834 /** 1835 * Updates the designated column with an <code>Object</code> value. 1836 * 1837 * The updater methods are used to update column values in the 1838 * current row or the insert row. The updater methods do not 1839 * update the underlying database; instead the <code>updateRow</code> or 1840 * <code>insertRow</code> methods are called to update the database. 1841 *<p> 1842 * If the second argument is an <code>InputStream</code> then the stream must contain 1843 * the number of bytes specified by scaleOrLength. If the second argument is a 1844 * <code>Reader</code> then the reader must contain the number of characters specified 1845 * by scaleOrLength. If these conditions are not true the driver will generate a 1846 * <code>SQLException</code> when the statement is executed. 1847 * 1848 * @param columnIndex the first column is 1, the second is 2, ... 1849 * @param x the new column value 1850 * @param scaleOrLength for an object of <code>java.math.BigDecimal</code> , 1851 * this is the number of digits after the decimal point. For 1852 * Java Object types <code>InputStream</code> and <code>Reader</code>, 1853 * this is the length 1854 * of the data in the stream or reader. For all other types, 1855 * this value will be ignored. 1856 * @exception SQLException if the columnIndex is not valid; 1857 * if a database access error occurs; 1858 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1859 * or this method is called on a closed result set 1860 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1861 * this method 1862 * @since 1.2 1863 */ 1864 void updateObject(int columnIndex, Object x, int scaleOrLength) 1865 throws SQLException; 1866 1867 /** 1868 * Updates the designated column with an <code>Object</code> value. 1869 * 1870 * The updater methods are used to update column values in the 1871 * current row or the insert row. The updater methods do not 1872 * update the underlying database; instead the <code>updateRow</code> or 1873 * <code>insertRow</code> methods are called to update the database. 1874 * 1875 * @param columnIndex the first column is 1, the second is 2, ... 1876 * @param x the new column value 1877 * @exception SQLException if the columnIndex is not valid; 1878 * if a database access error occurs; 1879 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1880 * or this method is called on a closed result set 1881 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1882 * this method 1883 * @since 1.2 1884 */ 1885 void updateObject(int columnIndex, Object x) throws SQLException; 1886 1887 /** 1888 * Updates the designated column with a <code>null</code> value. 1889 * The updater methods are used to update column values in the 1890 * current row or the insert row. The updater methods do not 1891 * update the underlying database; instead the <code>updateRow</code> or 1892 * <code>insertRow</code> methods are called to update the database. 1893 * 1894 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 1895 * @exception SQLException if the columnLabel is not valid; 1896 * if a database access error occurs; 1897 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1898 * or this method is called on a closed result set 1899 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1900 * this method 1901 * @since 1.2 1902 */ 1903 void updateNull(String columnLabel) throws SQLException; 1904 1905 /** 1906 * Updates the designated column with a <code>boolean</code> value. 1907 * The updater methods are used to update column values in the 1908 * current row or the insert row. The updater methods do not 1909 * update the underlying database; instead the <code>updateRow</code> or 1910 * <code>insertRow</code> methods are called to update the database. 1911 * 1912 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 1913 * @param x the new column value 1914 * @exception SQLException if the columnLabel is not valid; 1915 * if a database access error occurs; 1916 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1917 * or this method is called on a closed result set 1918 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1919 * this method 1920 * @since 1.2 1921 */ 1922 void updateBoolean(String columnLabel, boolean x) throws SQLException; 1923 1924 /** 1925 * Updates the designated column with a <code>byte</code> value. 1926 * The updater methods are used to update column values in the 1927 * current row or the insert row. The updater methods do not 1928 * update the underlying database; instead the <code>updateRow</code> or 1929 * <code>insertRow</code> methods are called to update the database. 1930 * 1931 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 1932 * @param x the new column value 1933 * @exception SQLException if the columnLabel is not valid; 1934 * if a database access error occurs; 1935 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1936 * or this method is called on a closed result set 1937 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1938 * this method 1939 * @since 1.2 1940 */ 1941 void updateByte(String columnLabel, byte x) throws SQLException; 1942 1943 /** 1944 * Updates the designated column with a <code>short</code> value. 1945 * The updater methods are used to update column values in the 1946 * current row or the insert row. The updater methods do not 1947 * update the underlying database; instead the <code>updateRow</code> or 1948 * <code>insertRow</code> methods are called to update the database. 1949 * 1950 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 1951 * @param x the new column value 1952 * @exception SQLException if the columnLabel is not valid; 1953 * if a database access error occurs; 1954 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1955 * or this method is called on a closed result set 1956 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1957 * this method 1958 * @since 1.2 1959 */ 1960 void updateShort(String columnLabel, short x) throws SQLException; 1961 1962 /** 1963 * Updates the designated column with an <code>int</code> value. 1964 * The updater methods are used to update column values in the 1965 * current row or the insert row. The updater methods do not 1966 * update the underlying database; instead the <code>updateRow</code> or 1967 * <code>insertRow</code> methods are called to update the database. 1968 * 1969 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 1970 * @param x the new column value 1971 * @exception SQLException if the columnLabel is not valid; 1972 * if a database access error occurs; 1973 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1974 * or this method is called on a closed result set 1975 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1976 * this method 1977 * @since 1.2 1978 */ 1979 void updateInt(String columnLabel, int x) throws SQLException; 1980 1981 /** 1982 * Updates the designated column with a <code>long</code> value. 1983 * The updater methods are used to update column values in the 1984 * current row or the insert row. The updater methods do not 1985 * update the underlying database; instead the <code>updateRow</code> or 1986 * <code>insertRow</code> methods are called to update the database. 1987 * 1988 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 1989 * @param x the new column value 1990 * @exception SQLException if the columnLabel is not valid; 1991 * if a database access error occurs; 1992 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 1993 * or this method is called on a closed result set 1994 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 1995 * this method 1996 * @since 1.2 1997 */ 1998 void updateLong(String columnLabel, long x) throws SQLException; 1999 2000 /** 2001 * Updates the designated column with a <code>float </code> value. 2002 * The updater methods are used to update column values in the 2003 * current row or the insert row. The updater methods do not 2004 * update the underlying database; instead the <code>updateRow</code> or 2005 * <code>insertRow</code> methods are called to update the database. 2006 * 2007 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2008 * @param x the new column value 2009 * @exception SQLException if the columnLabel is not valid; 2010 * if a database access error occurs; 2011 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 2012 * or this method is called on a closed result set 2013 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2014 * this method 2015 * @since 1.2 2016 */ 2017 void updateFloat(String columnLabel, float x) throws SQLException; 2018 2019 /** 2020 * Updates the designated column with a <code>double</code> value. 2021 * The updater methods are used to update column values in the 2022 * current row or the insert row. The updater methods do not 2023 * update the underlying database; instead the <code>updateRow</code> or 2024 * <code>insertRow</code> methods are called to update the database. 2025 * 2026 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2027 * @param x the new column value 2028 * @exception SQLException if the columnLabel is not valid; 2029 * if a database access error occurs; 2030 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 2031 * or this method is called on a closed result set 2032 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2033 * this method 2034 * @since 1.2 2035 */ 2036 void updateDouble(String columnLabel, double x) throws SQLException; 2037 2038 /** 2039 * Updates the designated column with a <code>java.sql.BigDecimal</code> 2040 * value. 2041 * The updater methods are used to update column values in the 2042 * current row or the insert row. The updater methods do not 2043 * update the underlying database; instead the <code>updateRow</code> or 2044 * <code>insertRow</code> methods are called to update the database. 2045 * 2046 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2047 * @param x the new column value 2048 * @exception SQLException if the columnLabel is not valid; 2049 * if a database access error occurs; 2050 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 2051 * or this method is called on a closed result set 2052 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2053 * this method 2054 * @since 1.2 2055 */ 2056 void updateBigDecimal(String columnLabel, BigDecimal x) throws SQLException; 2057 2058 /** 2059 * Updates the designated column with a <code>String</code> value. 2060 * The updater methods are used to update column values in the 2061 * current row or the insert row. The updater methods do not 2062 * update the underlying database; instead the <code>updateRow</code> or 2063 * <code>insertRow</code> methods are called to update the database. 2064 * 2065 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2066 * @param x the new column value 2067 * @exception SQLException if the columnLabel is not valid; 2068 * if a database access error occurs; 2069 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 2070 * or this method is called on a closed result set 2071 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2072 * this method 2073 * @since 1.2 2074 */ 2075 void updateString(String columnLabel, String x) throws SQLException; 2076 2077 /** 2078 * Updates the designated column with a byte array value. 2079 * 2080 * The updater methods are used to update column values in the 2081 * current row or the insert row. The updater methods do not 2082 * update the underlying database; instead the <code>updateRow</code> 2083 * or <code>insertRow</code> methods are called to update the database. 2084 * 2085 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2086 * @param x the new column value 2087 * @exception SQLException if the columnLabel is not valid; 2088 * if a database access error occurs; 2089 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 2090 * or this method is called on a closed result set 2091 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2092 * this method 2093 * @since 1.2 2094 */ 2095 void updateBytes(String columnLabel, byte x[]) throws SQLException; 2096 2097 /** 2098 * Updates the designated column with a <code>java.sql.Date</code> value. 2099 * The updater methods are used to update column values in the 2100 * current row or the insert row. The updater methods do not 2101 * update the underlying database; instead the <code>updateRow</code> or 2102 * <code>insertRow</code> methods are called to update the database. 2103 * 2104 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2105 * @param x the new column value 2106 * @exception SQLException if the columnLabel is not valid; 2107 * if a database access error occurs; 2108 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 2109 * or this method is called on a closed result set 2110 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2111 * this method 2112 * @since 1.2 2113 */ 2114 void updateDate(String columnLabel, java.sql.Date x) throws SQLException; 2115 2116 /** 2117 * Updates the designated column with a <code>java.sql.Time</code> value. 2118 * The updater methods are used to update column values in the 2119 * current row or the insert row. The updater methods do not 2120 * update the underlying database; instead the <code>updateRow</code> or 2121 * <code>insertRow</code> methods are called to update the database. 2122 * 2123 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2124 * @param x the new column value 2125 * @exception SQLException if the columnLabel is not valid; 2126 * if a database access error occurs; 2127 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 2128 * or this method is called on a closed result set 2129 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2130 * this method 2131 * @since 1.2 2132 */ 2133 void updateTime(String columnLabel, java.sql.Time x) throws SQLException; 2134 2135 /** 2136 * Updates the designated column with a <code>java.sql.Timestamp</code> 2137 * value. 2138 * The updater methods are used to update column values in the 2139 * current row or the insert row. The updater methods do not 2140 * update the underlying database; instead the <code>updateRow</code> or 2141 * <code>insertRow</code> methods are called to update the database. 2142 * 2143 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2144 * @param x the new column value 2145 * @exception SQLException if the columnLabel is not valid; 2146 * if a database access error occurs; 2147 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 2148 * or this method is called on a closed result set 2149 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2150 * this method 2151 * @since 1.2 2152 */ 2153 void updateTimestamp(String columnLabel, java.sql.Timestamp x) 2154 throws SQLException; 2155 2156 /** 2157 * Updates the designated column with an ascii stream value, which will have 2158 * the specified number of bytes. 2159 * The updater methods are used to update column values in the 2160 * current row or the insert row. The updater methods do not 2161 * update the underlying database; instead the <code>updateRow</code> or 2162 * <code>insertRow</code> methods are called to update the database. 2163 * 2164 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2165 * @param x the new column value 2166 * @param length the length of the stream 2167 * @exception SQLException if the columnLabel is not valid; 2168 * if a database access error occurs; 2169 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 2170 * or this method is called on a closed result set 2171 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2172 * this method 2173 * @since 1.2 2174 */ 2175 void updateAsciiStream(String columnLabel, 2176 java.io.InputStream x, 2177 int length) throws SQLException; 2178 2179 /** 2180 * Updates the designated column with a binary stream value, which will have 2181 * the specified number of bytes. 2182 * The updater methods are used to update column values in the 2183 * current row or the insert row. The updater methods do not 2184 * update the underlying database; instead the <code>updateRow</code> or 2185 * <code>insertRow</code> methods are called to update the database. 2186 * 2187 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2188 * @param x the new column value 2189 * @param length the length of the stream 2190 * @exception SQLException if the columnLabel is not valid; 2191 * if a database access error occurs; 2192 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 2193 * or this method is called on a closed result set 2194 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2195 * this method 2196 * @since 1.2 2197 */ 2198 void updateBinaryStream(String columnLabel, 2199 java.io.InputStream x, 2200 int length) throws SQLException; 2201 2202 /** 2203 * Updates the designated column with a character stream value, which will have 2204 * the specified number of bytes. 2205 * The updater methods are used to update column values in the 2206 * current row or the insert row. The updater methods do not 2207 * update the underlying database; instead the <code>updateRow</code> or 2208 * <code>insertRow</code> methods are called to update the database. 2209 * 2210 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2211 * @param reader the <code>java.io.Reader</code> object containing 2212 * the new column value 2213 * @param length the length of the stream 2214 * @exception SQLException if the columnLabel is not valid; 2215 * if a database access error occurs; 2216 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 2217 * or this method is called on a closed result set 2218 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2219 * this method 2220 * @since 1.2 2221 */ 2222 void updateCharacterStream(String columnLabel, 2223 java.io.Reader reader, 2224 int length) throws SQLException; 2225 2226 /** 2227 * Updates the designated column with an <code>Object</code> value. 2228 * 2229 * The updater methods are used to update column values in the 2230 * current row or the insert row. The updater methods do not 2231 * update the underlying database; instead the <code>updateRow</code> or 2232 * <code>insertRow</code> methods are called to update the database. 2233 *<p> 2234 * If the second argument is an <code>InputStream</code> then the stream must contain 2235 * the number of bytes specified by scaleOrLength. If the second argument is a 2236 * <code>Reader</code> then the reader must contain the number of characters specified 2237 * by scaleOrLength. If these conditions are not true the driver will generate a 2238 * <code>SQLException</code> when the statement is executed. 2239 * 2240 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2241 * @param x the new column value 2242 * @param scaleOrLength for an object of <code>java.math.BigDecimal</code> , 2243 * this is the number of digits after the decimal point. For 2244 * Java Object types <code>InputStream</code> and <code>Reader</code>, 2245 * this is the length 2246 * of the data in the stream or reader. For all other types, 2247 * this value will be ignored. 2248 * @exception SQLException if the columnLabel is not valid; 2249 * if a database access error occurs; 2250 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 2251 * or this method is called on a closed result set 2252 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2253 * this method 2254 * @since 1.2 2255 */ 2256 void updateObject(String columnLabel, Object x, int scaleOrLength) 2257 throws SQLException; 2258 2259 /** 2260 * Updates the designated column with an <code>Object</code> value. 2261 * 2262 * The updater methods are used to update column values in the 2263 * current row or the insert row. The updater methods do not 2264 * update the underlying database; instead the <code>updateRow</code> or 2265 * <code>insertRow</code> methods are called to update the database. 2266 * 2267 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2268 * @param x the new column value 2269 * @exception SQLException if the columnLabel is not valid; 2270 * if a database access error occurs; 2271 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 2272 * or this method is called on a closed result set 2273 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2274 * this method 2275 * @since 1.2 2276 */ 2277 void updateObject(String columnLabel, Object x) throws SQLException; 2278 2279 /** 2280 * Inserts the contents of the insert row into this 2281 * <code>ResultSet</code> object and into the database. 2282 * The cursor must be on the insert row when this method is called. 2283 * 2284 * @exception SQLException if a database access error occurs; 2285 * the result set concurrency is <code>CONCUR_READ_ONLY</code>, 2286 * this method is called on a closed result set, 2287 * if this method is called when the cursor is not on the insert row, 2288 * or if not all of non-nullable columns in 2289 * the insert row have been given a non-null value 2290 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2291 * this method 2292 * @since 1.2 2293 */ 2294 void insertRow() throws SQLException; 2295 2296 /** 2297 * Updates the underlying database with the new contents of the 2298 * current row of this <code>ResultSet</code> object. 2299 * This method cannot be called when the cursor is on the insert row. 2300 * 2301 * @exception SQLException if a database access error occurs; 2302 * the result set concurrency is <code>CONCUR_READ_ONLY</code>; 2303 * this method is called on a closed result set or 2304 * if this method is called when the cursor is on the insert row 2305 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2306 * this method 2307 * @since 1.2 2308 */ 2309 void updateRow() throws SQLException; 2310 2311 /** 2312 * Deletes the current row from this <code>ResultSet</code> object 2313 * and from the underlying database. This method cannot be called when 2314 * the cursor is on the insert row. 2315 * 2316 * @exception SQLException if a database access error occurs; 2317 * the result set concurrency is <code>CONCUR_READ_ONLY</code>; 2318 * this method is called on a closed result set 2319 * or if this method is called when the cursor is on the insert row 2320 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2321 * this method 2322 * @since 1.2 2323 */ 2324 void deleteRow() throws SQLException; 2325 2326 /** 2327 * Refreshes the current row with its most recent value in 2328 * the database. This method cannot be called when 2329 * the cursor is on the insert row. 2330 * 2331 * <P>The <code>refreshRow</code> method provides a way for an 2332 * application to 2333 * explicitly tell the JDBC driver to refetch a row(s) from the 2334 * database. An application may want to call <code>refreshRow</code> when 2335 * caching or prefetching is being done by the JDBC driver to 2336 * fetch the latest value of a row from the database. The JDBC driver 2337 * may actually refresh multiple rows at once if the fetch size is 2338 * greater than one. 2339 * 2340 * <P> All values are refetched subject to the transaction isolation 2341 * level and cursor sensitivity. If <code>refreshRow</code> is called after 2342 * calling an updater method, but before calling 2343 * the method <code>updateRow</code>, then the 2344 * updates made to the row are lost. Calling the method 2345 * <code>refreshRow</code> frequently will likely slow performance. 2346 * 2347 * @exception SQLException if a database access error 2348 * occurs; this method is called on a closed result set; 2349 * the result set type is <code>TYPE_FORWARD_ONLY</code> or if this 2350 * method is called when the cursor is on the insert row 2351 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2352 * this method or this method is not supported for the specified result 2353 * set type and result set concurrency. 2354 * @since 1.2 2355 */ 2356 void refreshRow() throws SQLException; 2357 2358 /** 2359 * Cancels the updates made to the current row in this 2360 * <code>ResultSet</code> object. 2361 * This method may be called after calling an 2362 * updater method(s) and before calling 2363 * the method <code>updateRow</code> to roll back 2364 * the updates made to a row. If no updates have been made or 2365 * <code>updateRow</code> has already been called, this method has no 2366 * effect. 2367 * 2368 * @exception SQLException if a database access error 2369 * occurs; this method is called on a closed result set; 2370 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 2371 * or if this method is called when the cursor is 2372 * on the insert row 2373 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2374 * this method 2375 * @since 1.2 2376 */ 2377 void cancelRowUpdates() throws SQLException; 2378 2379 /** 2380 * Moves the cursor to the insert row. The current cursor position is 2381 * remembered while the cursor is positioned on the insert row. 2382 * 2383 * The insert row is a special row associated with an updatable 2384 * result set. It is essentially a buffer where a new row may 2385 * be constructed by calling the updater methods prior to 2386 * inserting the row into the result set. 2387 * 2388 * Only the updater, getter, 2389 * and <code>insertRow</code> methods may be 2390 * called when the cursor is on the insert row. All of the columns in 2391 * a result set must be given a value each time this method is 2392 * called before calling <code>insertRow</code>. 2393 * An updater method must be called before a 2394 * getter method can be called on a column value. 2395 * 2396 * @exception SQLException if a database access error occurs; this 2397 * method is called on a closed result set 2398 * or the result set concurrency is <code>CONCUR_READ_ONLY</code> 2399 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2400 * this method 2401 * @since 1.2 2402 */ 2403 void moveToInsertRow() throws SQLException; 2404 2405 /** 2406 * Moves the cursor to the remembered cursor position, usually the 2407 * current row. This method has no effect if the cursor is not on 2408 * the insert row. 2409 * 2410 * @exception SQLException if a database access error occurs; this 2411 * method is called on a closed result set 2412 * or the result set concurrency is <code>CONCUR_READ_ONLY</code> 2413 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2414 * this method 2415 * @since 1.2 2416 */ 2417 void moveToCurrentRow() throws SQLException; 2418 2419 /** 2420 * Retrieves the <code>Statement</code> object that produced this 2421 * <code>ResultSet</code> object. 2422 * If the result set was generated some other way, such as by a 2423 * <code>DatabaseMetaData</code> method, this method may return 2424 * <code>null</code>. 2425 * 2426 * @return the <code>Statement</code> object that produced 2427 * this <code>ResultSet</code> object or <code>null</code> 2428 * if the result set was produced some other way 2429 * @exception SQLException if a database access error occurs 2430 * or this method is called on a closed result set 2431 * @since 1.2 2432 */ 2433 Statement getStatement() throws SQLException; 2434 2435 /** 2436 * Retrieves the value of the designated column in the current row 2437 * of this <code>ResultSet</code> object as an <code>Object</code> 2438 * in the Java programming language. 2439 * If the value is an SQL <code>NULL</code>, 2440 * the driver returns a Java <code>null</code>. 2441 * This method uses the given <code>Map</code> object 2442 * for the custom mapping of the 2443 * SQL structured or distinct type that is being retrieved. 2444 * 2445 * @param columnIndex the first column is 1, the second is 2, ... 2446 * @param map a <code>java.util.Map</code> object that contains the mapping 2447 * from SQL type names to classes in the Java programming language 2448 * @return an <code>Object</code> in the Java programming language 2449 * representing the SQL value 2450 * @exception SQLException if the columnIndex is not valid; 2451 * if a database access error occurs 2452 * or this method is called on a closed result set 2453 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2454 * this method 2455 * @since 1.2 2456 */ 2457 Object getObject(int columnIndex, java.util.Map<String,Class<?>> map) 2458 throws SQLException; 2459 2460 /** 2461 * Retrieves the value of the designated column in the current row 2462 * of this <code>ResultSet</code> object as a <code>Ref</code> object 2463 * in the Java programming language. 2464 * 2465 * @param columnIndex the first column is 1, the second is 2, ... 2466 * @return a <code>Ref</code> object representing an SQL <code>REF</code> 2467 * value 2468 * @exception SQLException if the columnIndex is not valid; 2469 * if a database access error occurs 2470 * or this method is called on a closed result set 2471 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2472 * this method 2473 * @since 1.2 2474 */ 2475 Ref getRef(int columnIndex) throws SQLException; 2476 2477 /** 2478 * Retrieves the value of the designated column in the current row 2479 * of this <code>ResultSet</code> object as a <code>Blob</code> object 2480 * in the Java programming language. 2481 * 2482 * @param columnIndex the first column is 1, the second is 2, ... 2483 * @return a <code>Blob</code> object representing the SQL 2484 * <code>BLOB</code> value in the specified column 2485 * @exception SQLException if the columnIndex is not valid; 2486 * if a database access error occurs 2487 * or this method is called on a closed result set 2488 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2489 * this method 2490 * @since 1.2 2491 */ 2492 Blob getBlob(int columnIndex) throws SQLException; 2493 2494 /** 2495 * Retrieves the value of the designated column in the current row 2496 * of this <code>ResultSet</code> object as a <code>Clob</code> object 2497 * in the Java programming language. 2498 * 2499 * @param columnIndex the first column is 1, the second is 2, ... 2500 * @return a <code>Clob</code> object representing the SQL 2501 * <code>CLOB</code> value in the specified column 2502 * @exception SQLException if the columnIndex is not valid; 2503 * if a database access error occurs 2504 * or this method is called on a closed result set 2505 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2506 * this method 2507 * @since 1.2 2508 */ 2509 Clob getClob(int columnIndex) throws SQLException; 2510 2511 /** 2512 * Retrieves the value of the designated column in the current row 2513 * of this <code>ResultSet</code> object as an <code>Array</code> object 2514 * in the Java programming language. 2515 * 2516 * @param columnIndex the first column is 1, the second is 2, ... 2517 * @return an <code>Array</code> object representing the SQL 2518 * <code>ARRAY</code> value in the specified column 2519 * @exception SQLException if the columnIndex is not valid; 2520 * if a database access error occurs 2521 * or this method is called on a closed result set 2522 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2523 * this method 2524 * @since 1.2 2525 */ 2526 Array getArray(int columnIndex) throws SQLException; 2527 2528 /** 2529 * Retrieves the value of the designated column in the current row 2530 * of this <code>ResultSet</code> object as an <code>Object</code> 2531 * in the Java programming language. 2532 * If the value is an SQL <code>NULL</code>, 2533 * the driver returns a Java <code>null</code>. 2534 * This method uses the specified <code>Map</code> object for 2535 * custom mapping if appropriate. 2536 * 2537 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2538 * @param map a <code>java.util.Map</code> object that contains the mapping 2539 * from SQL type names to classes in the Java programming language 2540 * @return an <code>Object</code> representing the SQL value in the 2541 * specified column 2542 * @exception SQLException if the columnLabel is not valid; 2543 * if a database access error occurs 2544 * or this method is called on a closed result set 2545 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2546 * this method 2547 * @since 1.2 2548 */ 2549 Object getObject(String columnLabel, java.util.Map<String,Class<?>> map) 2550 throws SQLException; 2551 2552 /** 2553 * Retrieves the value of the designated column in the current row 2554 * of this <code>ResultSet</code> object as a <code>Ref</code> object 2555 * in the Java programming language. 2556 * 2557 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2558 * @return a <code>Ref</code> object representing the SQL <code>REF</code> 2559 * value in the specified column 2560 * @exception SQLException if the columnLabel is not valid; 2561 * if a database access error occurs 2562 * or this method is called on a closed result set 2563 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2564 * this method 2565 * @since 1.2 2566 */ 2567 Ref getRef(String columnLabel) throws SQLException; 2568 2569 /** 2570 * Retrieves the value of the designated column in the current row 2571 * of this <code>ResultSet</code> object as a <code>Blob</code> object 2572 * in the Java programming language. 2573 * 2574 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2575 * @return a <code>Blob</code> object representing the SQL <code>BLOB</code> 2576 * value in the specified column 2577 * @exception SQLException if the columnLabel is not valid; 2578 * if a database access error occurs 2579 * or this method is called on a closed result set 2580 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2581 * this method 2582 * @since 1.2 2583 */ 2584 Blob getBlob(String columnLabel) throws SQLException; 2585 2586 /** 2587 * Retrieves the value of the designated column in the current row 2588 * of this <code>ResultSet</code> object as a <code>Clob</code> object 2589 * in the Java programming language. 2590 * 2591 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2592 * @return a <code>Clob</code> object representing the SQL <code>CLOB</code> 2593 * value in the specified column 2594 * @exception SQLException if the columnLabel is not valid; 2595 * if a database access error occurs 2596 * or this method is called on a closed result set 2597 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2598 * this method 2599 * @since 1.2 2600 */ 2601 Clob getClob(String columnLabel) throws SQLException; 2602 2603 /** 2604 * Retrieves the value of the designated column in the current row 2605 * of this <code>ResultSet</code> object as an <code>Array</code> object 2606 * in the Java programming language. 2607 * 2608 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2609 * @return an <code>Array</code> object representing the SQL <code>ARRAY</code> value in 2610 * the specified column 2611 * @exception SQLException if the columnLabel is not valid; 2612 * if a database access error occurs 2613 * or this method is called on a closed result set 2614 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2615 * this method 2616 * @since 1.2 2617 */ 2618 Array getArray(String columnLabel) throws SQLException; 2619 2620 /** 2621 * Retrieves the value of the designated column in the current row 2622 * of this <code>ResultSet</code> object as a <code>java.sql.Date</code> object 2623 * in the Java programming language. 2624 * This method uses the given calendar to construct an appropriate millisecond 2625 * value for the date if the underlying database does not store 2626 * timezone information. 2627 * 2628 * @param columnIndex the first column is 1, the second is 2, ... 2629 * @param cal the <code>java.util.Calendar</code> object 2630 * to use in constructing the date 2631 * @return the column value as a <code>java.sql.Date</code> object; 2632 * if the value is SQL <code>NULL</code>, 2633 * the value returned is <code>null</code> in the Java programming language 2634 * @exception SQLException if the columnIndex is not valid; 2635 * if a database access error occurs 2636 * or this method is called on a closed result set 2637 * @since 1.2 2638 */ 2639 java.sql.Date getDate(int columnIndex, Calendar cal) throws SQLException; 2640 2641 /** 2642 * Retrieves the value of the designated column in the current row 2643 * of this <code>ResultSet</code> object as a <code>java.sql.Date</code> object 2644 * in the Java programming language. 2645 * This method uses the given calendar to construct an appropriate millisecond 2646 * value for the date if the underlying database does not store 2647 * timezone information. 2648 * 2649 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2650 * @param cal the <code>java.util.Calendar</code> object 2651 * to use in constructing the date 2652 * @return the column value as a <code>java.sql.Date</code> object; 2653 * if the value is SQL <code>NULL</code>, 2654 * the value returned is <code>null</code> in the Java programming language 2655 * @exception SQLException if the columnLabel is not valid; 2656 * if a database access error occurs 2657 * or this method is called on a closed result set 2658 * @since 1.2 2659 */ 2660 java.sql.Date getDate(String columnLabel, Calendar cal) throws SQLException; 2661 2662 /** 2663 * Retrieves the value of the designated column in the current row 2664 * of this <code>ResultSet</code> object as a <code>java.sql.Time</code> object 2665 * in the Java programming language. 2666 * This method uses the given calendar to construct an appropriate millisecond 2667 * value for the time if the underlying database does not store 2668 * timezone information. 2669 * 2670 * @param columnIndex the first column is 1, the second is 2, ... 2671 * @param cal the <code>java.util.Calendar</code> object 2672 * to use in constructing the time 2673 * @return the column value as a <code>java.sql.Time</code> object; 2674 * if the value is SQL <code>NULL</code>, 2675 * the value returned is <code>null</code> in the Java programming language 2676 * @exception SQLException if the columnIndex is not valid; 2677 * if a database access error occurs 2678 * or this method is called on a closed result set 2679 * @since 1.2 2680 */ 2681 java.sql.Time getTime(int columnIndex, Calendar cal) throws SQLException; 2682 2683 /** 2684 * Retrieves the value of the designated column in the current row 2685 * of this <code>ResultSet</code> object as a <code>java.sql.Time</code> object 2686 * in the Java programming language. 2687 * This method uses the given calendar to construct an appropriate millisecond 2688 * value for the time if the underlying database does not store 2689 * timezone information. 2690 * 2691 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2692 * @param cal the <code>java.util.Calendar</code> object 2693 * to use in constructing the time 2694 * @return the column value as a <code>java.sql.Time</code> object; 2695 * if the value is SQL <code>NULL</code>, 2696 * the value returned is <code>null</code> in the Java programming language 2697 * @exception SQLException if the columnLabel is not valid; 2698 * if a database access error occurs 2699 * or this method is called on a closed result set 2700 * @since 1.2 2701 */ 2702 java.sql.Time getTime(String columnLabel, Calendar cal) throws SQLException; 2703 2704 /** 2705 * Retrieves the value of the designated column in the current row 2706 * of this <code>ResultSet</code> object as a <code>java.sql.Timestamp</code> object 2707 * in the Java programming language. 2708 * This method uses the given calendar to construct an appropriate millisecond 2709 * value for the timestamp if the underlying database does not store 2710 * timezone information. 2711 * 2712 * @param columnIndex the first column is 1, the second is 2, ... 2713 * @param cal the <code>java.util.Calendar</code> object 2714 * to use in constructing the timestamp 2715 * @return the column value as a <code>java.sql.Timestamp</code> object; 2716 * if the value is SQL <code>NULL</code>, 2717 * the value returned is <code>null</code> in the Java programming language 2718 * @exception SQLException if the columnIndex is not valid; 2719 * if a database access error occurs 2720 * or this method is called on a closed result set 2721 * @since 1.2 2722 */ 2723 java.sql.Timestamp getTimestamp(int columnIndex, Calendar cal) 2724 throws SQLException; 2725 2726 /** 2727 * Retrieves the value of the designated column in the current row 2728 * of this <code>ResultSet</code> object as a <code>java.sql.Timestamp</code> object 2729 * in the Java programming language. 2730 * This method uses the given calendar to construct an appropriate millisecond 2731 * value for the timestamp if the underlying database does not store 2732 * timezone information. 2733 * 2734 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2735 * @param cal the <code>java.util.Calendar</code> object 2736 * to use in constructing the date 2737 * @return the column value as a <code>java.sql.Timestamp</code> object; 2738 * if the value is SQL <code>NULL</code>, 2739 * the value returned is <code>null</code> in the Java programming language 2740 * @exception SQLException if the columnLabel is not valid or 2741 * if a database access error occurs 2742 * or this method is called on a closed result set 2743 * @since 1.2 2744 */ 2745 java.sql.Timestamp getTimestamp(String columnLabel, Calendar cal) 2746 throws SQLException; 2747 2748 //-------------------------- JDBC 3.0 ---------------------------------------- 2749 2750 /** 2751 * The constant indicating that open <code>ResultSet</code> objects with this 2752 * holdability will remain open when the current transaction is committed. 2753 * 2754 * @since 1.4 2755 */ 2756 int HOLD_CURSORS_OVER_COMMIT = 1; 2757 2758 /** 2759 * The constant indicating that open <code>ResultSet</code> objects with this 2760 * holdability will be closed when the current transaction is committed. 2761 * 2762 * @since 1.4 2763 */ 2764 int CLOSE_CURSORS_AT_COMMIT = 2; 2765 2766 /** 2767 * Retrieves the value of the designated column in the current row 2768 * of this <code>ResultSet</code> object as a <code>java.net.URL</code> 2769 * object in the Java programming language. 2770 * 2771 * @param columnIndex the index of the column 1 is the first, 2 is the second,... 2772 * @return the column value as a <code>java.net.URL</code> object; 2773 * if the value is SQL <code>NULL</code>, 2774 * the value returned is <code>null</code> in the Java programming language 2775 * @exception SQLException if the columnIndex is not valid; 2776 * if a database access error occurs; this method 2777 * is called on a closed result set or if a URL is malformed 2778 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2779 * this method 2780 * @since 1.4 2781 */ 2782 java.net.URL getURL(int columnIndex) throws SQLException; 2783 2784 /** 2785 * Retrieves the value of the designated column in the current row 2786 * of this <code>ResultSet</code> object as a <code>java.net.URL</code> 2787 * object in the Java programming language. 2788 * 2789 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2790 * @return the column value as a <code>java.net.URL</code> object; 2791 * if the value is SQL <code>NULL</code>, 2792 * the value returned is <code>null</code> in the Java programming language 2793 * @exception SQLException if the columnLabel is not valid; 2794 * if a database access error occurs; this method 2795 * is called on a closed result set or if a URL is malformed 2796 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2797 * this method 2798 * @since 1.4 2799 */ 2800 java.net.URL getURL(String columnLabel) throws SQLException; 2801 2802 /** 2803 * Updates the designated column with a <code>java.sql.Ref</code> value. 2804 * The updater methods are used to update column values in the 2805 * current row or the insert row. The updater methods do not 2806 * update the underlying database; instead the <code>updateRow</code> or 2807 * <code>insertRow</code> methods are called to update the database. 2808 * 2809 * @param columnIndex the first column is 1, the second is 2, ... 2810 * @param x the new column value 2811 * @exception SQLException if the columnIndex is not valid; 2812 * if a database access error occurs; 2813 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 2814 * or this method is called on a closed result set 2815 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2816 * this method 2817 * @since 1.4 2818 */ 2819 void updateRef(int columnIndex, java.sql.Ref x) throws SQLException; 2820 2821 /** 2822 * Updates the designated column with a <code>java.sql.Ref</code> value. 2823 * The updater methods are used to update column values in the 2824 * current row or the insert row. The updater methods do not 2825 * update the underlying database; instead the <code>updateRow</code> or 2826 * <code>insertRow</code> methods are called to update the database. 2827 * 2828 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2829 * @param x the new column value 2830 * @exception SQLException if the columnLabel is not valid; 2831 * if a database access error occurs; 2832 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 2833 * or this method is called on a closed result set 2834 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2835 * this method 2836 * @since 1.4 2837 */ 2838 void updateRef(String columnLabel, java.sql.Ref x) throws SQLException; 2839 2840 /** 2841 * Updates the designated column with a <code>java.sql.Blob</code> value. 2842 * The updater methods are used to update column values in the 2843 * current row or the insert row. The updater methods do not 2844 * update the underlying database; instead the <code>updateRow</code> or 2845 * <code>insertRow</code> methods are called to update the database. 2846 * 2847 * @param columnIndex the first column is 1, the second is 2, ... 2848 * @param x the new column value 2849 * @exception SQLException if the columnIndex is not valid; 2850 * if a database access error occurs; 2851 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 2852 * or this method is called on a closed result set 2853 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2854 * this method 2855 * @since 1.4 2856 */ 2857 void updateBlob(int columnIndex, java.sql.Blob x) throws SQLException; 2858 2859 /** 2860 * Updates the designated column with a <code>java.sql.Blob</code> value. 2861 * The updater methods are used to update column values in the 2862 * current row or the insert row. The updater methods do not 2863 * update the underlying database; instead the <code>updateRow</code> or 2864 * <code>insertRow</code> methods are called to update the database. 2865 * 2866 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2867 * @param x the new column value 2868 * @exception SQLException if the columnLabel is not valid; 2869 * if a database access error occurs; 2870 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 2871 * or this method is called on a closed result set 2872 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2873 * this method 2874 * @since 1.4 2875 */ 2876 void updateBlob(String columnLabel, java.sql.Blob x) throws SQLException; 2877 2878 /** 2879 * Updates the designated column with a <code>java.sql.Clob</code> value. 2880 * The updater methods are used to update column values in the 2881 * current row or the insert row. The updater methods do not 2882 * update the underlying database; instead the <code>updateRow</code> or 2883 * <code>insertRow</code> methods are called to update the database. 2884 * 2885 * @param columnIndex the first column is 1, the second is 2, ... 2886 * @param x the new column value 2887 * @exception SQLException if the columnIndex is not valid; 2888 * if a database access error occurs; 2889 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 2890 * or this method is called on a closed result set 2891 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2892 * this method 2893 * @since 1.4 2894 */ 2895 void updateClob(int columnIndex, java.sql.Clob x) throws SQLException; 2896 2897 /** 2898 * Updates the designated column with a <code>java.sql.Clob</code> value. 2899 * The updater methods are used to update column values in the 2900 * current row or the insert row. The updater methods do not 2901 * update the underlying database; instead the <code>updateRow</code> or 2902 * <code>insertRow</code> methods are called to update the database. 2903 * 2904 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2905 * @param x the new column value 2906 * @exception SQLException if the columnLabel is not valid; 2907 * if a database access error occurs; 2908 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 2909 * or this method is called on a closed result set 2910 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2911 * this method 2912 * @since 1.4 2913 */ 2914 void updateClob(String columnLabel, java.sql.Clob x) throws SQLException; 2915 2916 /** 2917 * Updates the designated column with a <code>java.sql.Array</code> value. 2918 * The updater methods are used to update column values in the 2919 * current row or the insert row. The updater methods do not 2920 * update the underlying database; instead the <code>updateRow</code> or 2921 * <code>insertRow</code> methods are called to update the database. 2922 * 2923 * @param columnIndex the first column is 1, the second is 2, ... 2924 * @param x the new column value 2925 * @exception SQLException if the columnIndex is not valid; 2926 * if a database access error occurs; 2927 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 2928 * or this method is called on a closed result set 2929 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2930 * this method 2931 * @since 1.4 2932 */ 2933 void updateArray(int columnIndex, java.sql.Array x) throws SQLException; 2934 2935 /** 2936 * Updates the designated column with a <code>java.sql.Array</code> value. 2937 * The updater methods are used to update column values in the 2938 * current row or the insert row. The updater methods do not 2939 * update the underlying database; instead the <code>updateRow</code> or 2940 * <code>insertRow</code> methods are called to update the database. 2941 * 2942 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2943 * @param x the new column value 2944 * @exception SQLException if the columnLabel is not valid; 2945 * if a database access error occurs; 2946 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 2947 * or this method is called on a closed result set 2948 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2949 * this method 2950 * @since 1.4 2951 */ 2952 void updateArray(String columnLabel, java.sql.Array x) throws SQLException; 2953 2954 //------------------------- JDBC 4.0 ----------------------------------- 2955 2956 /** 2957 * Retrieves the value of the designated column in the current row of this 2958 * <code>ResultSet</code> object as a <code>java.sql.RowId</code> object in the Java 2959 * programming language. 2960 * 2961 * @param columnIndex the first column is 1, the second 2, ... 2962 * @return the column value; if the value is a SQL <code>NULL</code> the 2963 * value returned is <code>null</code> 2964 * @throws SQLException if the columnIndex is not valid; 2965 * if a database access error occurs 2966 * or this method is called on a closed result set 2967 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2968 * this method 2969 * @since 1.6 2970 */ 2971 RowId getRowId(int columnIndex) throws SQLException; 2972 2973 /** 2974 * Retrieves the value of the designated column in the current row of this 2975 * <code>ResultSet</code> object as a <code>java.sql.RowId</code> object in the Java 2976 * programming language. 2977 * 2978 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 2979 * @return the column value ; if the value is a SQL <code>NULL</code> the 2980 * value returned is <code>null</code> 2981 * @throws SQLException if the columnLabel is not valid; 2982 * if a database access error occurs 2983 * or this method is called on a closed result set 2984 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 2985 * this method 2986 * @since 1.6 2987 */ 2988 RowId getRowId(String columnLabel) throws SQLException; 2989 2990 /** 2991 * Updates the designated column with a <code>RowId</code> value. The updater 2992 * methods are used to update column values in the current row or the insert 2993 * row. The updater methods do not update the underlying database; instead 2994 * the <code>updateRow</code> or <code>insertRow</code> methods are called 2995 * to update the database. 2996 * 2997 * @param columnIndex the first column is 1, the second 2, ... 2998 * @param x the column value 2999 * @exception SQLException if the columnIndex is not valid; 3000 * if a database access error occurs; 3001 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3002 * or this method is called on a closed result set 3003 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3004 * this method 3005 * @since 1.6 3006 */ 3007 void updateRowId(int columnIndex, RowId x) throws SQLException; 3008 3009 /** 3010 * Updates the designated column with a <code>RowId</code> value. The updater 3011 * methods are used to update column values in the current row or the insert 3012 * row. The updater methods do not update the underlying database; instead 3013 * the <code>updateRow</code> or <code>insertRow</code> methods are called 3014 * to update the database. 3015 * 3016 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 3017 * @param x the column value 3018 * @exception SQLException if the columnLabel is not valid; 3019 * if a database access error occurs; 3020 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3021 * or this method is called on a closed result set 3022 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3023 * this method 3024 * @since 1.6 3025 */ 3026 void updateRowId(String columnLabel, RowId x) throws SQLException; 3027 3028 /** 3029 * Retrieves the holdability of this <code>ResultSet</code> object 3030 * @return either <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code> or <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code> 3031 * @throws SQLException if a database access error occurs 3032 * or this method is called on a closed result set 3033 * @since 1.6 3034 */ 3035 int getHoldability() throws SQLException; 3036 3037 /** 3038 * Retrieves whether this <code>ResultSet</code> object has been closed. A <code>ResultSet</code> is closed if the 3039 * method close has been called on it, or if it is automatically closed. 3040 * 3041 * @return true if this <code>ResultSet</code> object is closed; false if it is still open 3042 * @throws SQLException if a database access error occurs 3043 * @since 1.6 3044 */ 3045 boolean isClosed() throws SQLException; 3046 3047 /** 3048 * Updates the designated column with a <code>String</code> value. 3049 * It is intended for use when updating <code>NCHAR</code>,<code>NVARCHAR</code> 3050 * and <code>LONGNVARCHAR</code> columns. 3051 * The updater methods are used to update column values in the 3052 * current row or the insert row. The updater methods do not 3053 * update the underlying database; instead the <code>updateRow</code> or 3054 * <code>insertRow</code> methods are called to update the database. 3055 * 3056 * @param columnIndex the first column is 1, the second 2, ... 3057 * @param nString the value for the column to be updated 3058 * @throws SQLException if the columnIndex is not valid; 3059 * if the driver does not support national 3060 * character sets; if the driver can detect that a data conversion 3061 * error could occur; this method is called on a closed result set; 3062 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3063 * or if a database access error occurs 3064 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3065 * this method 3066 * @since 1.6 3067 */ 3068 void updateNString(int columnIndex, String nString) throws SQLException; 3069 3070 /** 3071 * Updates the designated column with a <code>String</code> value. 3072 * It is intended for use when updating <code>NCHAR</code>,<code>NVARCHAR</code> 3073 * and <code>LONGNVARCHAR</code> columns. 3074 * The updater methods are used to update column values in the 3075 * current row or the insert row. The updater methods do not 3076 * update the underlying database; instead the <code>updateRow</code> or 3077 * <code>insertRow</code> methods are called to update the database. 3078 * 3079 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 3080 * @param nString the value for the column to be updated 3081 * @throws SQLException if the columnLabel is not valid; 3082 * if the driver does not support national 3083 * character sets; if the driver can detect that a data conversion 3084 * error could occur; this method is called on a closed result set; 3085 * the result set concurrency is <CODE>CONCUR_READ_ONLY</code> 3086 * or if a database access error occurs 3087 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3088 * this method 3089 * @since 1.6 3090 */ 3091 void updateNString(String columnLabel, String nString) throws SQLException; 3092 3093 /** 3094 * Updates the designated column with a <code>java.sql.NClob</code> value. 3095 * The updater methods are used to update column values in the 3096 * current row or the insert row. The updater methods do not 3097 * update the underlying database; instead the <code>updateRow</code> or 3098 * <code>insertRow</code> methods are called to update the database. 3099 * 3100 * @param columnIndex the first column is 1, the second 2, ... 3101 * @param nClob the value for the column to be updated 3102 * @throws SQLException if the columnIndex is not valid; 3103 * if the driver does not support national 3104 * character sets; if the driver can detect that a data conversion 3105 * error could occur; this method is called on a closed result set; 3106 * if a database access error occurs or 3107 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3108 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3109 * this method 3110 * @since 1.6 3111 */ 3112 void updateNClob(int columnIndex, NClob nClob) throws SQLException; 3113 3114 /** 3115 * Updates the designated column with a <code>java.sql.NClob</code> value. 3116 * The updater methods are used to update column values in the 3117 * current row or the insert row. The updater methods do not 3118 * update the underlying database; instead the <code>updateRow</code> or 3119 * <code>insertRow</code> methods are called to update the database. 3120 * 3121 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 3122 * @param nClob the value for the column to be updated 3123 * @throws SQLException if the columnLabel is not valid; 3124 * if the driver does not support national 3125 * character sets; if the driver can detect that a data conversion 3126 * error could occur; this method is called on a closed result set; 3127 * if a database access error occurs or 3128 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3129 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3130 * this method 3131 * @since 1.6 3132 */ 3133 void updateNClob(String columnLabel, NClob nClob) throws SQLException; 3134 3135 /** 3136 * Retrieves the value of the designated column in the current row 3137 * of this <code>ResultSet</code> object as a <code>NClob</code> object 3138 * in the Java programming language. 3139 * 3140 * @param columnIndex the first column is 1, the second is 2, ... 3141 * @return a <code>NClob</code> object representing the SQL 3142 * <code>NCLOB</code> value in the specified column 3143 * @exception SQLException if the columnIndex is not valid; 3144 * if the driver does not support national 3145 * character sets; if the driver can detect that a data conversion 3146 * error could occur; this method is called on a closed result set 3147 * or if a database access error occurs 3148 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3149 * this method 3150 * @since 1.6 3151 */ 3152 NClob getNClob(int columnIndex) throws SQLException; 3153 3154 /** 3155 * Retrieves the value of the designated column in the current row 3156 * of this <code>ResultSet</code> object as a <code>NClob</code> object 3157 * in the Java programming language. 3158 * 3159 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 3160 * @return a <code>NClob</code> object representing the SQL <code>NCLOB</code> 3161 * value in the specified column 3162 * @exception SQLException if the columnLabel is not valid; 3163 * if the driver does not support national 3164 * character sets; if the driver can detect that a data conversion 3165 * error could occur; this method is called on a closed result set 3166 * or if a database access error occurs 3167 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3168 * this method 3169 * @since 1.6 3170 */ 3171 NClob getNClob(String columnLabel) throws SQLException; 3172 3173 /** 3174 * Retrieves the value of the designated column in the current row of 3175 * this <code>ResultSet</code> as a 3176 * <code>java.sql.SQLXML</code> object in the Java programming language. 3177 * @param columnIndex the first column is 1, the second is 2, ... 3178 * @return a <code>SQLXML</code> object that maps an <code>SQL XML</code> value 3179 * @throws SQLException if the columnIndex is not valid; 3180 * if a database access error occurs 3181 * or this method is called on a closed result set 3182 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3183 * this method 3184 * @since 1.6 3185 */ 3186 SQLXML getSQLXML(int columnIndex) throws SQLException; 3187 3188 /** 3189 * Retrieves the value of the designated column in the current row of 3190 * this <code>ResultSet</code> as a 3191 * <code>java.sql.SQLXML</code> object in the Java programming language. 3192 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 3193 * @return a <code>SQLXML</code> object that maps an <code>SQL XML</code> value 3194 * @throws SQLException if the columnLabel is not valid; 3195 * if a database access error occurs 3196 * or this method is called on a closed result set 3197 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3198 * this method 3199 * @since 1.6 3200 */ 3201 SQLXML getSQLXML(String columnLabel) throws SQLException; 3202 /** 3203 * Updates the designated column with a <code>java.sql.SQLXML</code> value. 3204 * The updater 3205 * methods are used to update column values in the current row or the insert 3206 * row. The updater methods do not update the underlying database; instead 3207 * the <code>updateRow</code> or <code>insertRow</code> methods are called 3208 * to update the database. 3209 * <p> 3210 * 3211 * @param columnIndex the first column is 1, the second 2, ... 3212 * @param xmlObject the value for the column to be updated 3213 * @throws SQLException if the columnIndex is not valid; 3214 * if a database access error occurs; this method 3215 * is called on a closed result set; 3216 * the <code>java.xml.transform.Result</code>, 3217 * <code>Writer</code> or <code>OutputStream</code> has not been closed 3218 * for the <code>SQLXML</code> object; 3219 * if there is an error processing the XML value or 3220 * the result set concurrency is <code>CONCUR_READ_ONLY</code>. The <code>getCause</code> method 3221 * of the exception may provide a more detailed exception, for example, if the 3222 * stream does not contain valid XML. 3223 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3224 * this method 3225 * @since 1.6 3226 */ 3227 void updateSQLXML(int columnIndex, SQLXML xmlObject) throws SQLException; 3228 /** 3229 * Updates the designated column with a <code>java.sql.SQLXML</code> value. 3230 * The updater 3231 * methods are used to update column values in the current row or the insert 3232 * row. The updater methods do not update the underlying database; instead 3233 * the <code>updateRow</code> or <code>insertRow</code> methods are called 3234 * to update the database. 3235 * <p> 3236 * 3237 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 3238 * @param xmlObject the column value 3239 * @throws SQLException if the columnLabel is not valid; 3240 * if a database access error occurs; this method 3241 * is called on a closed result set; 3242 * the <code>java.xml.transform.Result</code>, 3243 * <code>Writer</code> or <code>OutputStream</code> has not been closed 3244 * for the <code>SQLXML</code> object; 3245 * if there is an error processing the XML value or 3246 * the result set concurrency is <code>CONCUR_READ_ONLY</code>. The <code>getCause</code> method 3247 * of the exception may provide a more detailed exception, for example, if the 3248 * stream does not contain valid XML. 3249 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3250 * this method 3251 * @since 1.6 3252 */ 3253 void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLException; 3254 3255 /** 3256 * Retrieves the value of the designated column in the current row 3257 * of this <code>ResultSet</code> object as 3258 * a <code>String</code> in the Java programming language. 3259 * It is intended for use when 3260 * accessing <code>NCHAR</code>,<code>NVARCHAR</code> 3261 * and <code>LONGNVARCHAR</code> columns. 3262 * 3263 * @param columnIndex the first column is 1, the second is 2, ... 3264 * @return the column value; if the value is SQL <code>NULL</code>, the 3265 * value returned is <code>null</code> 3266 * @exception SQLException if the columnIndex is not valid; 3267 * if a database access error occurs 3268 * or this method is called on a closed result set 3269 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3270 * this method 3271 * @since 1.6 3272 */ 3273 String getNString(int columnIndex) throws SQLException; 3274 3275 3276 /** 3277 * Retrieves the value of the designated column in the current row 3278 * of this <code>ResultSet</code> object as 3279 * a <code>String</code> in the Java programming language. 3280 * It is intended for use when 3281 * accessing <code>NCHAR</code>,<code>NVARCHAR</code> 3282 * and <code>LONGNVARCHAR</code> columns. 3283 * 3284 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 3285 * @return the column value; if the value is SQL <code>NULL</code>, the 3286 * value returned is <code>null</code> 3287 * @exception SQLException if the columnLabel is not valid; 3288 * if a database access error occurs 3289 * or this method is called on a closed result set 3290 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3291 * this method 3292 * @since 1.6 3293 */ 3294 String getNString(String columnLabel) throws SQLException; 3295 3296 3297 /** 3298 * Retrieves the value of the designated column in the current row 3299 * of this <code>ResultSet</code> object as a 3300 * <code>java.io.Reader</code> object. 3301 * It is intended for use when 3302 * accessing <code>NCHAR</code>,<code>NVARCHAR</code> 3303 * and <code>LONGNVARCHAR</code> columns. 3304 * 3305 * @return a <code>java.io.Reader</code> object that contains the column 3306 * value; if the value is SQL <code>NULL</code>, the value returned is 3307 * <code>null</code> in the Java programming language. 3308 * @param columnIndex the first column is 1, the second is 2, ... 3309 * @exception SQLException if the columnIndex is not valid; 3310 * if a database access error occurs 3311 * or this method is called on a closed result set 3312 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3313 * this method 3314 * @since 1.6 3315 */ 3316 java.io.Reader getNCharacterStream(int columnIndex) throws SQLException; 3317 3318 /** 3319 * Retrieves the value of the designated column in the current row 3320 * of this <code>ResultSet</code> object as a 3321 * <code>java.io.Reader</code> object. 3322 * It is intended for use when 3323 * accessing <code>NCHAR</code>,<code>NVARCHAR</code> 3324 * and <code>LONGNVARCHAR</code> columns. 3325 * 3326 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 3327 * @return a <code>java.io.Reader</code> object that contains the column 3328 * value; if the value is SQL <code>NULL</code>, the value returned is 3329 * <code>null</code> in the Java programming language 3330 * @exception SQLException if the columnLabel is not valid; 3331 * if a database access error occurs 3332 * or this method is called on a closed result set 3333 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3334 * this method 3335 * @since 1.6 3336 */ 3337 java.io.Reader getNCharacterStream(String columnLabel) throws SQLException; 3338 3339 /** 3340 * Updates the designated column with a character stream value, which will have 3341 * the specified number of bytes. The 3342 * driver does the necessary conversion from Java character format to 3343 * the national character set in the database. 3344 * It is intended for use when 3345 * updating <code>NCHAR</code>,<code>NVARCHAR</code> 3346 * and <code>LONGNVARCHAR</code> columns. 3347 * <p> 3348 * The updater methods are used to update column values in the 3349 * current row or the insert row. The updater methods do not 3350 * update the underlying database; instead the <code>updateRow</code> or 3351 * <code>insertRow</code> methods are called to update the database. 3352 * 3353 * @param columnIndex the first column is 1, the second is 2, ... 3354 * @param x the new column value 3355 * @param length the length of the stream 3356 * @exception SQLException if the columnIndex is not valid; 3357 * if a database access error occurs; 3358 * the result set concurrency is <code>CONCUR_READ_ONLY</code> or this method is called on a closed result set 3359 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3360 * this method 3361 * @since 1.6 3362 */ 3363 void updateNCharacterStream(int columnIndex, 3364 java.io.Reader x, 3365 long length) throws SQLException; 3366 3367 /** 3368 * Updates the designated column with a character stream value, which will have 3369 * the specified number of bytes. The 3370 * driver does the necessary conversion from Java character format to 3371 * the national character set in the database. 3372 * It is intended for use when 3373 * updating <code>NCHAR</code>,<code>NVARCHAR</code> 3374 * and <code>LONGNVARCHAR</code> columns. 3375 * <p> 3376 * The updater methods are used to update column values in the 3377 * current row or the insert row. The updater methods do not 3378 * update the underlying database; instead the <code>updateRow</code> or 3379 * <code>insertRow</code> methods are called to update the database. 3380 * 3381 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 3382 * @param reader the <code>java.io.Reader</code> object containing 3383 * the new column value 3384 * @param length the length of the stream 3385 * @exception SQLException if the columnLabel is not valid; 3386 * if a database access error occurs; 3387 * the result set concurrency is <code>CONCUR_READ_ONLY</code> or this method is called on a closed result set 3388 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3389 * this method 3390 * @since 1.6 3391 */ 3392 void updateNCharacterStream(String columnLabel, 3393 java.io.Reader reader, 3394 long length) throws SQLException; 3395 /** 3396 * Updates the designated column with an ascii stream value, which will have 3397 * the specified number of bytes. 3398 * <p> 3399 * The updater methods are used to update column values in the 3400 * current row or the insert row. The updater methods do not 3401 * update the underlying database; instead the <code>updateRow</code> or 3402 * <code>insertRow</code> methods are called to update the database. 3403 * 3404 * @param columnIndex the first column is 1, the second is 2, ... 3405 * @param x the new column value 3406 * @param length the length of the stream 3407 * @exception SQLException if the columnIndex is not valid; 3408 * if a database access error occurs; 3409 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3410 * or this method is called on a closed result set 3411 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3412 * this method 3413 * @since 1.6 3414 */ 3415 void updateAsciiStream(int columnIndex, 3416 java.io.InputStream x, 3417 long length) throws SQLException; 3418 3419 /** 3420 * Updates the designated column with a binary stream value, which will have 3421 * the specified number of bytes. 3422 * <p> 3423 * The updater methods are used to update column values in the 3424 * current row or the insert row. The updater methods do not 3425 * update the underlying database; instead the <code>updateRow</code> or 3426 * <code>insertRow</code> methods are called to update the database. 3427 * 3428 * @param columnIndex the first column is 1, the second is 2, ... 3429 * @param x the new column value 3430 * @param length the length of the stream 3431 * @exception SQLException if the columnIndex is not valid; 3432 * if a database access error occurs; 3433 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3434 * or this method is called on a closed result set 3435 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3436 * this method 3437 * @since 1.6 3438 */ 3439 void updateBinaryStream(int columnIndex, 3440 java.io.InputStream x, 3441 long length) throws SQLException; 3442 3443 /** 3444 * Updates the designated column with a character stream value, which will have 3445 * the specified number of bytes. 3446 * <p> 3447 * The updater methods are used to update column values in the 3448 * current row or the insert row. The updater methods do not 3449 * update the underlying database; instead the <code>updateRow</code> or 3450 * <code>insertRow</code> methods are called to update the database. 3451 * 3452 * @param columnIndex the first column is 1, the second is 2, ... 3453 * @param x the new column value 3454 * @param length the length of the stream 3455 * @exception SQLException if the columnIndex is not valid; 3456 * if a database access error occurs; 3457 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3458 * or this method is called on a closed result set 3459 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3460 * this method 3461 * @since 1.6 3462 */ 3463 void updateCharacterStream(int columnIndex, 3464 java.io.Reader x, 3465 long length) throws SQLException; 3466 /** 3467 * Updates the designated column with an ascii stream value, which will have 3468 * the specified number of bytes. 3469 * <p> 3470 * The updater methods are used to update column values in the 3471 * current row or the insert row. The updater methods do not 3472 * update the underlying database; instead the <code>updateRow</code> or 3473 * <code>insertRow</code> methods are called to update the database. 3474 * 3475 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 3476 * @param x the new column value 3477 * @param length the length of the stream 3478 * @exception SQLException if the columnLabel is not valid; 3479 * if a database access error occurs; 3480 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3481 * or this method is called on a closed result set 3482 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3483 * this method 3484 * @since 1.6 3485 */ 3486 void updateAsciiStream(String columnLabel, 3487 java.io.InputStream x, 3488 long length) throws SQLException; 3489 3490 /** 3491 * Updates the designated column with a binary stream value, which will have 3492 * the specified number of bytes. 3493 * <p> 3494 * The updater methods are used to update column values in the 3495 * current row or the insert row. The updater methods do not 3496 * update the underlying database; instead the <code>updateRow</code> or 3497 * <code>insertRow</code> methods are called to update the database. 3498 * 3499 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 3500 * @param x the new column value 3501 * @param length the length of the stream 3502 * @exception SQLException if the columnLabel is not valid; 3503 * if a database access error occurs; 3504 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3505 * or this method is called on a closed result set 3506 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3507 * this method 3508 * @since 1.6 3509 */ 3510 void updateBinaryStream(String columnLabel, 3511 java.io.InputStream x, 3512 long length) throws SQLException; 3513 3514 /** 3515 * Updates the designated column with a character stream value, which will have 3516 * the specified number of bytes. 3517 * <p> 3518 * The updater methods are used to update column values in the 3519 * current row or the insert row. The updater methods do not 3520 * update the underlying database; instead the <code>updateRow</code> or 3521 * <code>insertRow</code> methods are called to update the database. 3522 * 3523 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 3524 * @param reader the <code>java.io.Reader</code> object containing 3525 * the new column value 3526 * @param length the length of the stream 3527 * @exception SQLException if the columnLabel is not valid; 3528 * if a database access error occurs; 3529 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3530 * or this method is called on a closed result set 3531 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3532 * this method 3533 * @since 1.6 3534 */ 3535 void updateCharacterStream(String columnLabel, 3536 java.io.Reader reader, 3537 long length) throws SQLException; 3538 /** 3539 * Updates the designated column using the given input stream, which 3540 * will have the specified number of bytes. 3541 * 3542 * <p> 3543 * The updater methods are used to update column values in the 3544 * current row or the insert row. The updater methods do not 3545 * update the underlying database; instead the <code>updateRow</code> or 3546 * <code>insertRow</code> methods are called to update the database. 3547 * 3548 * @param columnIndex the first column is 1, the second is 2, ... 3549 * @param inputStream An object that contains the data to set the parameter 3550 * value to. 3551 * @param length the number of bytes in the parameter data. 3552 * @exception SQLException if the columnIndex is not valid; 3553 * if a database access error occurs; 3554 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3555 * or this method is called on a closed result set 3556 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3557 * this method 3558 * @since 1.6 3559 */ 3560 void updateBlob(int columnIndex, InputStream inputStream, long length) throws SQLException; 3561 3562 /** 3563 * Updates the designated column using the given input stream, which 3564 * will have the specified number of bytes. 3565 * 3566 * <p> 3567 * The updater methods are used to update column values in the 3568 * current row or the insert row. The updater methods do not 3569 * update the underlying database; instead the <code>updateRow</code> or 3570 * <code>insertRow</code> methods are called to update the database. 3571 * 3572 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 3573 * @param inputStream An object that contains the data to set the parameter 3574 * value to. 3575 * @param length the number of bytes in the parameter data. 3576 * @exception SQLException if the columnLabel is not valid; 3577 * if a database access error occurs; 3578 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3579 * or this method is called on a closed result set 3580 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3581 * this method 3582 * @since 1.6 3583 */ 3584 void updateBlob(String columnLabel, InputStream inputStream, long length) throws SQLException; 3585 3586 /** 3587 * Updates the designated column using the given <code>Reader</code> 3588 * object, which is the given number of characters long. 3589 * When a very large UNICODE value is input to a <code>LONGVARCHAR</code> 3590 * parameter, it may be more practical to send it via a 3591 * <code>java.io.Reader</code> object. The JDBC driver will 3592 * do any necessary conversion from UNICODE to the database char format. 3593 * 3594 * <p> 3595 * The updater methods are used to update column values in the 3596 * current row or the insert row. The updater methods do not 3597 * update the underlying database; instead the <code>updateRow</code> or 3598 * <code>insertRow</code> methods are called to update the database. 3599 * 3600 * @param columnIndex the first column is 1, the second is 2, ... 3601 * @param reader An object that contains the data to set the parameter value to. 3602 * @param length the number of characters in the parameter data. 3603 * @exception SQLException if the columnIndex is not valid; 3604 * if a database access error occurs; 3605 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3606 * or this method is called on a closed result set 3607 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3608 * this method 3609 * @since 1.6 3610 */ 3611 void updateClob(int columnIndex, Reader reader, long length) throws SQLException; 3612 3613 /** 3614 * Updates the designated column using the given <code>Reader</code> 3615 * object, which is the given number of characters long. 3616 * When a very large UNICODE value is input to a <code>LONGVARCHAR</code> 3617 * parameter, it may be more practical to send it via a 3618 * <code>java.io.Reader</code> object. The JDBC driver will 3619 * do any necessary conversion from UNICODE to the database char format. 3620 * 3621 * <p> 3622 * The updater methods are used to update column values in the 3623 * current row or the insert row. The updater methods do not 3624 * update the underlying database; instead the <code>updateRow</code> or 3625 * <code>insertRow</code> methods are called to update the database. 3626 * 3627 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 3628 * @param reader An object that contains the data to set the parameter value to. 3629 * @param length the number of characters in the parameter data. 3630 * @exception SQLException if the columnLabel is not valid; 3631 * if a database access error occurs; 3632 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3633 * or this method is called on a closed result set 3634 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3635 * this method 3636 * @since 1.6 3637 */ 3638 void updateClob(String columnLabel, Reader reader, long length) throws SQLException; 3639 /** 3640 * Updates the designated column using the given <code>Reader</code> 3641 * object, which is the given number of characters long. 3642 * When a very large UNICODE value is input to a <code>LONGVARCHAR</code> 3643 * parameter, it may be more practical to send it via a 3644 * <code>java.io.Reader</code> object. The JDBC driver will 3645 * do any necessary conversion from UNICODE to the database char format. 3646 * 3647 * <p> 3648 * The updater methods are used to update column values in the 3649 * current row or the insert row. The updater methods do not 3650 * update the underlying database; instead the <code>updateRow</code> or 3651 * <code>insertRow</code> methods are called to update the database. 3652 * 3653 * @param columnIndex the first column is 1, the second 2, ... 3654 * @param reader An object that contains the data to set the parameter value to. 3655 * @param length the number of characters in the parameter data. 3656 * @throws SQLException if the columnIndex is not valid; 3657 * if the driver does not support national 3658 * character sets; if the driver can detect that a data conversion 3659 * error could occur; this method is called on a closed result set, 3660 * if a database access error occurs or 3661 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3662 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3663 * this method 3664 * @since 1.6 3665 */ 3666 void updateNClob(int columnIndex, Reader reader, long length) throws SQLException; 3667 3668 /** 3669 * Updates the designated column using the given <code>Reader</code> 3670 * object, which is the given number of characters long. 3671 * When a very large UNICODE value is input to a <code>LONGVARCHAR</code> 3672 * parameter, it may be more practical to send it via a 3673 * <code>java.io.Reader</code> object. The JDBC driver will 3674 * do any necessary conversion from UNICODE to the database char format. 3675 * 3676 * <p> 3677 * The updater methods are used to update column values in the 3678 * current row or the insert row. The updater methods do not 3679 * update the underlying database; instead the <code>updateRow</code> or 3680 * <code>insertRow</code> methods are called to update the database. 3681 * 3682 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 3683 * @param reader An object that contains the data to set the parameter value to. 3684 * @param length the number of characters in the parameter data. 3685 * @throws SQLException if the columnLabel is not valid; 3686 * if the driver does not support national 3687 * character sets; if the driver can detect that a data conversion 3688 * error could occur; this method is called on a closed result set; 3689 * if a database access error occurs or 3690 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3691 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3692 * this method 3693 * @since 1.6 3694 */ 3695 void updateNClob(String columnLabel, Reader reader, long length) throws SQLException; 3696 3697 //--- 3698 3699 /** 3700 * Updates the designated column with a character stream value. 3701 * The data will be read from the stream 3702 * as needed until end-of-stream is reached. The 3703 * driver does the necessary conversion from Java character format to 3704 * the national character set in the database. 3705 * It is intended for use when 3706 * updating <code>NCHAR</code>,<code>NVARCHAR</code> 3707 * and <code>LONGNVARCHAR</code> columns. 3708 * <p> 3709 * The updater methods are used to update column values in the 3710 * current row or the insert row. The updater methods do not 3711 * update the underlying database; instead the <code>updateRow</code> or 3712 * <code>insertRow</code> methods are called to update the database. 3713 * 3714 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 3715 * it might be more efficient to use a version of 3716 * <code>updateNCharacterStream</code> which takes a length parameter. 3717 * 3718 * @param columnIndex the first column is 1, the second is 2, ... 3719 * @param x the new column value 3720 * @exception SQLException if the columnIndex is not valid; 3721 * if a database access error occurs; 3722 * the result set concurrency is <code>CONCUR_READ_ONLY</code> or this method is called on a closed result set 3723 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3724 * this method 3725 * @since 1.6 3726 */ 3727 void updateNCharacterStream(int columnIndex, 3728 java.io.Reader x) throws SQLException; 3729 3730 /** 3731 * Updates the designated column with a character stream value. 3732 * The data will be read from the stream 3733 * as needed until end-of-stream is reached. The 3734 * driver does the necessary conversion from Java character format to 3735 * the national character set in the database. 3736 * It is intended for use when 3737 * updating <code>NCHAR</code>,<code>NVARCHAR</code> 3738 * and <code>LONGNVARCHAR</code> columns. 3739 * <p> 3740 * The updater methods are used to update column values in the 3741 * current row or the insert row. The updater methods do not 3742 * update the underlying database; instead the <code>updateRow</code> or 3743 * <code>insertRow</code> methods are called to update the database. 3744 * 3745 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 3746 * it might be more efficient to use a version of 3747 * <code>updateNCharacterStream</code> which takes a length parameter. 3748 * 3749 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 3750 * @param reader the <code>java.io.Reader</code> object containing 3751 * the new column value 3752 * @exception SQLException if the columnLabel is not valid; 3753 * if a database access error occurs; 3754 * the result set concurrency is <code>CONCUR_READ_ONLY</code> or this method is called on a closed result set 3755 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3756 * this method 3757 * @since 1.6 3758 */ 3759 void updateNCharacterStream(String columnLabel, 3760 java.io.Reader reader) throws SQLException; 3761 /** 3762 * Updates the designated column with an ascii stream value. 3763 * The data will be read from the stream 3764 * as needed until end-of-stream is reached. 3765 * <p> 3766 * The updater methods are used to update column values in the 3767 * current row or the insert row. The updater methods do not 3768 * update the underlying database; instead the <code>updateRow</code> or 3769 * <code>insertRow</code> methods are called to update the database. 3770 * 3771 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 3772 * it might be more efficient to use a version of 3773 * <code>updateAsciiStream</code> which takes a length parameter. 3774 * 3775 * @param columnIndex the first column is 1, the second is 2, ... 3776 * @param x the new column value 3777 * @exception SQLException if the columnIndex is not valid; 3778 * if a database access error occurs; 3779 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3780 * or this method is called on a closed result set 3781 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3782 * this method 3783 * @since 1.6 3784 */ 3785 void updateAsciiStream(int columnIndex, 3786 java.io.InputStream x) throws SQLException; 3787 3788 /** 3789 * Updates the designated column with a binary stream value. 3790 * The data will be read from the stream 3791 * as needed until end-of-stream is reached. 3792 * <p> 3793 * The updater methods are used to update column values in the 3794 * current row or the insert row. The updater methods do not 3795 * update the underlying database; instead the <code>updateRow</code> or 3796 * <code>insertRow</code> methods are called to update the database. 3797 * 3798 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 3799 * it might be more efficient to use a version of 3800 * <code>updateBinaryStream</code> which takes a length parameter. 3801 * 3802 * @param columnIndex the first column is 1, the second is 2, ... 3803 * @param x the new column value 3804 * @exception SQLException if the columnIndex is not valid; 3805 * if a database access error occurs; 3806 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3807 * or this method is called on a closed result set 3808 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3809 * this method 3810 * @since 1.6 3811 */ 3812 void updateBinaryStream(int columnIndex, 3813 java.io.InputStream x) throws SQLException; 3814 3815 /** 3816 * Updates the designated column with a character stream value. 3817 * The data will be read from the stream 3818 * as needed until end-of-stream is reached. 3819 * <p> 3820 * The updater methods are used to update column values in the 3821 * current row or the insert row. The updater methods do not 3822 * update the underlying database; instead the <code>updateRow</code> or 3823 * <code>insertRow</code> methods are called to update the database. 3824 * 3825 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 3826 * it might be more efficient to use a version of 3827 * <code>updateCharacterStream</code> which takes a length parameter. 3828 * 3829 * @param columnIndex the first column is 1, the second is 2, ... 3830 * @param x the new column value 3831 * @exception SQLException if the columnIndex is not valid; 3832 * if a database access error occurs; 3833 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3834 * or this method is called on a closed result set 3835 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3836 * this method 3837 * @since 1.6 3838 */ 3839 void updateCharacterStream(int columnIndex, 3840 java.io.Reader x) throws SQLException; 3841 /** 3842 * Updates the designated column with an ascii stream value. 3843 * The data will be read from the stream 3844 * as needed until end-of-stream is reached. 3845 * <p> 3846 * The updater methods are used to update column values in the 3847 * current row or the insert row. The updater methods do not 3848 * update the underlying database; instead the <code>updateRow</code> or 3849 * <code>insertRow</code> methods are called to update the database. 3850 * 3851 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 3852 * it might be more efficient to use a version of 3853 * <code>updateAsciiStream</code> which takes a length parameter. 3854 * 3855 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 3856 * @param x the new column value 3857 * @exception SQLException if the columnLabel is not valid; 3858 * if a database access error occurs; 3859 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3860 * or this method is called on a closed result set 3861 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3862 * this method 3863 * @since 1.6 3864 */ 3865 void updateAsciiStream(String columnLabel, 3866 java.io.InputStream x) throws SQLException; 3867 3868 /** 3869 * Updates the designated column with a binary stream value. 3870 * The data will be read from the stream 3871 * as needed until end-of-stream is reached. 3872 * <p> 3873 * The updater methods are used to update column values in the 3874 * current row or the insert row. The updater methods do not 3875 * update the underlying database; instead the <code>updateRow</code> or 3876 * <code>insertRow</code> methods are called to update the database. 3877 * 3878 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 3879 * it might be more efficient to use a version of 3880 * <code>updateBinaryStream</code> which takes a length parameter. 3881 * 3882 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 3883 * @param x the new column value 3884 * @exception SQLException if the columnLabel is not valid; 3885 * if a database access error occurs; 3886 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3887 * or this method is called on a closed result set 3888 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3889 * this method 3890 * @since 1.6 3891 */ 3892 void updateBinaryStream(String columnLabel, 3893 java.io.InputStream x) throws SQLException; 3894 3895 /** 3896 * Updates the designated column with a character stream value. 3897 * The data will be read from the stream 3898 * as needed until end-of-stream is reached. 3899 * <p> 3900 * The updater methods are used to update column values in the 3901 * current row or the insert row. The updater methods do not 3902 * update the underlying database; instead the <code>updateRow</code> or 3903 * <code>insertRow</code> methods are called to update the database. 3904 * 3905 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 3906 * it might be more efficient to use a version of 3907 * <code>updateCharacterStream</code> which takes a length parameter. 3908 * 3909 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 3910 * @param reader the <code>java.io.Reader</code> object containing 3911 * the new column value 3912 * @exception SQLException if the columnLabel is not valid; if a database access error occurs; 3913 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3914 * or this method is called on a closed result set 3915 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3916 * this method 3917 * @since 1.6 3918 */ 3919 void updateCharacterStream(String columnLabel, 3920 java.io.Reader reader) throws SQLException; 3921 /** 3922 * Updates the designated column using the given input stream. The data will be read from the stream 3923 * as needed until end-of-stream is reached. 3924 * <p> 3925 * The updater methods are used to update column values in the 3926 * current row or the insert row. The updater methods do not 3927 * update the underlying database; instead the <code>updateRow</code> or 3928 * <code>insertRow</code> methods are called to update the database. 3929 * 3930 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 3931 * it might be more efficient to use a version of 3932 * <code>updateBlob</code> which takes a length parameter. 3933 * 3934 * @param columnIndex the first column is 1, the second is 2, ... 3935 * @param inputStream An object that contains the data to set the parameter 3936 * value to. 3937 * @exception SQLException if the columnIndex is not valid; if a database access error occurs; 3938 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3939 * or this method is called on a closed result set 3940 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3941 * this method 3942 * @since 1.6 3943 */ 3944 void updateBlob(int columnIndex, InputStream inputStream) throws SQLException; 3945 3946 /** 3947 * Updates the designated column using the given input stream. The data will be read from the stream 3948 * as needed until end-of-stream is reached. 3949 * <p> 3950 * The updater methods are used to update column values in the 3951 * current row or the insert row. The updater methods do not 3952 * update the underlying database; instead the <code>updateRow</code> or 3953 * <code>insertRow</code> methods are called to update the database. 3954 * 3955 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 3956 * it might be more efficient to use a version of 3957 * <code>updateBlob</code> which takes a length parameter. 3958 * 3959 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 3960 * @param inputStream An object that contains the data to set the parameter 3961 * value to. 3962 * @exception SQLException if the columnLabel is not valid; if a database access error occurs; 3963 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3964 * or this method is called on a closed result set 3965 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3966 * this method 3967 * @since 1.6 3968 */ 3969 void updateBlob(String columnLabel, InputStream inputStream) throws SQLException; 3970 3971 /** 3972 * Updates the designated column using the given <code>Reader</code> 3973 * object. 3974 * The data will be read from the stream 3975 * as needed until end-of-stream is reached. The JDBC driver will 3976 * do any necessary conversion from UNICODE to the database char format. 3977 * 3978 * <p> 3979 * The updater methods are used to update column values in the 3980 * current row or the insert row. The updater methods do not 3981 * update the underlying database; instead the <code>updateRow</code> or 3982 * <code>insertRow</code> methods are called to update the database. 3983 * 3984 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 3985 * it might be more efficient to use a version of 3986 * <code>updateClob</code> which takes a length parameter. 3987 * 3988 * @param columnIndex the first column is 1, the second is 2, ... 3989 * @param reader An object that contains the data to set the parameter value to. 3990 * @exception SQLException if the columnIndex is not valid; 3991 * if a database access error occurs; 3992 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 3993 * or this method is called on a closed result set 3994 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 3995 * this method 3996 * @since 1.6 3997 */ 3998 void updateClob(int columnIndex, Reader reader) throws SQLException; 3999 4000 /** 4001 * Updates the designated column using the given <code>Reader</code> 4002 * object. 4003 * The data will be read from the stream 4004 * as needed until end-of-stream is reached. The JDBC driver will 4005 * do any necessary conversion from UNICODE to the database char format. 4006 * 4007 * <p> 4008 * The updater methods are used to update column values in the 4009 * current row or the insert row. The updater methods do not 4010 * update the underlying database; instead the <code>updateRow</code> or 4011 * <code>insertRow</code> methods are called to update the database. 4012 * 4013 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 4014 * it might be more efficient to use a version of 4015 * <code>updateClob</code> which takes a length parameter. 4016 * 4017 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 4018 * @param reader An object that contains the data to set the parameter value to. 4019 * @exception SQLException if the columnLabel is not valid; if a database access error occurs; 4020 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 4021 * or this method is called on a closed result set 4022 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 4023 * this method 4024 * @since 1.6 4025 */ 4026 void updateClob(String columnLabel, Reader reader) throws SQLException; 4027 /** 4028 * Updates the designated column using the given <code>Reader</code> 4029 * 4030 * The data will be read from the stream 4031 * as needed until end-of-stream is reached. The JDBC driver will 4032 * do any necessary conversion from UNICODE to the database char format. 4033 * 4034 * <p> 4035 * The updater methods are used to update column values in the 4036 * current row or the insert row. The updater methods do not 4037 * update the underlying database; instead the <code>updateRow</code> or 4038 * <code>insertRow</code> methods are called to update the database. 4039 * 4040 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 4041 * it might be more efficient to use a version of 4042 * <code>updateNClob</code> which takes a length parameter. 4043 * 4044 * @param columnIndex the first column is 1, the second 2, ... 4045 * @param reader An object that contains the data to set the parameter value to. 4046 * @throws SQLException if the columnIndex is not valid; 4047 * if the driver does not support national 4048 * character sets; if the driver can detect that a data conversion 4049 * error could occur; this method is called on a closed result set, 4050 * if a database access error occurs or 4051 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 4052 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 4053 * this method 4054 * @since 1.6 4055 */ 4056 void updateNClob(int columnIndex, Reader reader) throws SQLException; 4057 4058 /** 4059 * Updates the designated column using the given <code>Reader</code> 4060 * object. 4061 * The data will be read from the stream 4062 * as needed until end-of-stream is reached. The JDBC driver will 4063 * do any necessary conversion from UNICODE to the database char format. 4064 * 4065 * <p> 4066 * The updater methods are used to update column values in the 4067 * current row or the insert row. The updater methods do not 4068 * update the underlying database; instead the <code>updateRow</code> or 4069 * <code>insertRow</code> methods are called to update the database. 4070 * 4071 * <P><B>Note:</B> Consult your JDBC driver documentation to determine if 4072 * it might be more efficient to use a version of 4073 * <code>updateNClob</code> which takes a length parameter. 4074 * 4075 * @param columnLabel the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column 4076 * @param reader An object that contains the data to set the parameter value to. 4077 * @throws SQLException if the columnLabel is not valid; if the driver does not support national 4078 * character sets; if the driver can detect that a data conversion 4079 * error could occur; this method is called on a closed result set; 4080 * if a database access error occurs or 4081 * the result set concurrency is <code>CONCUR_READ_ONLY</code> 4082 * @exception SQLFeatureNotSupportedException if the JDBC driver does not support 4083 * this method 4084 * @since 1.6 4085 */ 4086 void updateNClob(String columnLabel, Reader reader) throws SQLException; 4087 4088 //------------------------- JDBC 4.1 ----------------------------------- 4089 4090 4091 /** 4092 *<p>Retrieves the value of the designated column in the current row 4093 * of this <code>ResultSet</code> object and will convert from the 4094 * SQL type of the column to the requested Java data type, if the 4095 * conversion is supported. If the conversion is not 4096 * supported or null is specified for the type, a 4097 * <code>SQLException</code> is thrown. 4098 *<p> 4099 * At a minimum, an implementation must support the conversions defined in 4100 * Appendix B, Table B-3 and conversion of appropriate user defined SQL 4101 * types to a Java type which implements {@code SQLData}, or {@code Struct}. 4102 * Additional conversions may be supported and are vendor defined. 4103 * @param <T> the type of the class modeled by this Class object 4104 * @param columnIndex the first column is 1, the second is 2, ... 4105 * @param type Class representing the Java data type to convert the designated 4106 * column to. 4107 * @return an instance of {@code type} holding the column value 4108 * @throws SQLException if conversion is not supported, type is null or 4109 * another error occurs. The getCause() method of the 4110 * exception may provide a more detailed exception, for example, if 4111 * a conversion error occurs 4112 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support 4113 * this method 4114 * @since 1.7 4115 */ 4116 public <T> T getObject(int columnIndex, Class<T> type) throws SQLException; 4117 4118 4119 /** 4120 *<p>Retrieves the value of the designated column in the current row 4121 * of this <code>ResultSet</code> object and will convert from the 4122 * SQL type of the column to the requested Java data type, if the 4123 * conversion is supported. If the conversion is not 4124 * supported or null is specified for the type, a 4125 * <code>SQLException</code> is thrown. 4126 *<p> 4127 * At a minimum, an implementation must support the conversions defined in 4128 * Appendix B, Table B-3 and conversion of appropriate user defined SQL 4129 * types to a Java type which implements {@code SQLData}, or {@code Struct}. 4130 * Additional conversions may be supported and are vendor defined. 4131 * 4132 * @param columnLabel the label for the column specified with the SQL AS clause. 4133 * If the SQL AS clause was not specified, then the label is the name 4134 * of the column 4135 * @param type Class representing the Java data type to convert the designated 4136 * column to. 4137 * @param <T> the type of the class modeled by this Class object 4138 * @return an instance of {@code type} holding the column value 4139 * @throws SQLException if conversion is not supported, type is null or 4140 * another error occurs. The getCause() method of the 4141 * exception may provide a more detailed exception, for example, if 4142 * a conversion error occurs 4143 * @throws SQLFeatureNotSupportedException if the JDBC driver does not support 4144 * this method 4145 * @since 1.7 4146 */ 4147 public <T> T getObject(String columnLabel, Class<T> type) throws SQLException; 4148 4149 //------------------------- JDBC 4.2 ----------------------------------- 4150 4151 /** 4152 * Updates the designated column with an {@code Object} value. 4153 * 4154 * The updater methods are used to update column values in the 4155 * current row or the insert row. The updater methods do not 4156 * update the underlying database; instead the {@code updateRow} or 4157 * {@code insertRow} methods are called to update the database. 4158 *<p> 4159 * If the second argument is an {@code InputStream} then the stream must contain 4160 * the number of bytes specified by scaleOrLength. If the second argument is a 4161 * {@code Reader} then the reader must contain the number of characters specified 4162 * by scaleOrLength. If these conditions are not true the driver will generate a 4163 * {@code SQLException} when the statement is executed. 4164 *<p> 4165 * The default implementation will throw {@code SQLFeatureNotSupportedException} 4166 * 4167 * @param columnIndex the first column is 1, the second is 2, ... 4168 * @param x the new column value 4169 * @param targetSqlType the SQL type to be sent to the database 4170 * @param scaleOrLength for an object of {@code java.math.BigDecimal} , 4171 * this is the number of digits after the decimal point. For 4172 * Java Object types {@code InputStream} and {@code Reader}, 4173 * this is the length 4174 * of the data in the stream or reader. For all other types, 4175 * this value will be ignored. 4176 * @exception SQLException if the columnIndex is not valid; 4177 * if a database access error occurs; 4178 * the result set concurrency is {@code CONCUR_READ_ONLY} 4179 * or this method is called on a closed result set 4180 * @exception SQLFeatureNotSupportedException if the JDBC driver does not 4181 * support this method; if the JDBC driver does not support this data type 4182 * @see JDBCType 4183 * @see SQLType 4184 * @since 1.8 4185 */ 4186 default void updateObject(int columnIndex, Object x, 4187 SQLType targetSqlType, int scaleOrLength) throws SQLException { 4188 throw new SQLFeatureNotSupportedException("updateObject not implemented"); 4189 } 4190 4191 /** 4192 * Updates the designated column with an {@code Object} value. 4193 * 4194 * The updater methods are used to update column values in the 4195 * current row or the insert row. The updater methods do not 4196 * update the underlying database; instead the {@code updateRow} or 4197 * {@code insertRow} methods are called to update the database. 4198 *<p> 4199 * If the second argument is an {@code InputStream} then the stream must 4200 * contain number of bytes specified by scaleOrLength. If the second 4201 * argument is a {@code Reader} then the reader must contain the number 4202 * of characters specified by scaleOrLength. If these conditions are not 4203 * true the driver will generate a 4204 * {@code SQLException} when the statement is executed. 4205 *<p> 4206 * The default implementation will throw {@code SQLFeatureNotSupportedException} 4207 * 4208 * @param columnLabel the label for the column specified with the SQL AS 4209 * clause. If the SQL AS clause was not specified, then the label is 4210 * the name of the column 4211 * @param x the new column value 4212 * @param targetSqlType the SQL type to be sent to the database 4213 * @param scaleOrLength for an object of {@code java.math.BigDecimal} , 4214 * this is the number of digits after the decimal point. For 4215 * Java Object types {@code InputStream} and {@code Reader}, 4216 * this is the length 4217 * of the data in the stream or reader. For all other types, 4218 * this value will be ignored. 4219 * @exception SQLException if the columnLabel is not valid; 4220 * if a database access error occurs; 4221 * the result set concurrency is {@code CONCUR_READ_ONLY} 4222 * or this method is called on a closed result set 4223 * @exception SQLFeatureNotSupportedException if the JDBC driver does not 4224 * support this method; if the JDBC driver does not support this data type 4225 * @see JDBCType 4226 * @see SQLType 4227 * @since 1.8 4228 */ 4229 default void updateObject(String columnLabel, Object x, 4230 SQLType targetSqlType, int scaleOrLength) throws SQLException { 4231 throw new SQLFeatureNotSupportedException("updateObject not implemented"); 4232 } 4233 4234 /** 4235 * Updates the designated column with an {@code Object} value. 4236 * 4237 * The updater methods are used to update column values in the 4238 * current row or the insert row. The updater methods do not 4239 * update the underlying database; instead the {@code updateRow} or 4240 * {@code insertRow} methods are called to update the database. 4241 *<p> 4242 * The default implementation will throw {@code SQLFeatureNotSupportedException} 4243 * 4244 * @param columnIndex the first column is 1, the second is 2, ... 4245 * @param x the new column value 4246 * @param targetSqlType the SQL type to be sent to the database 4247 * @exception SQLException if the columnIndex is not valid; 4248 * if a database access error occurs; 4249 * the result set concurrency is {@code CONCUR_READ_ONLY} 4250 * or this method is called on a closed result set 4251 * @exception SQLFeatureNotSupportedException if the JDBC driver does not 4252 * support this method; if the JDBC driver does not support this data type 4253 * @see JDBCType 4254 * @see SQLType 4255 * @since 1.8 4256 */ 4257 default void updateObject(int columnIndex, Object x, SQLType targetSqlType) 4258 throws SQLException { 4259 throw new SQLFeatureNotSupportedException("updateObject not implemented"); 4260 } 4261 4262 /** 4263 * Updates the designated column with an {@code Object} value. 4264 * 4265 * The updater methods are used to update column values in the 4266 * current row or the insert row. The updater methods do not 4267 * update the underlying database; instead the {@code updateRow} or 4268 * {@code insertRow} methods are called to update the database. 4269 *<p> 4270 * The default implementation will throw {@code SQLFeatureNotSupportedException} 4271 * 4272 * @param columnLabel the label for the column specified with the SQL AS 4273 * clause. If the SQL AS clause was not specified, then the label is 4274 * the name of the column 4275 * @param x the new column value 4276 * @param targetSqlType the SQL type to be sent to the database 4277 * @exception SQLException if the columnLabel is not valid; 4278 * if a database access error occurs; 4279 * the result set concurrency is {@code CONCUR_READ_ONLY} 4280 * or this method is called on a closed result set 4281 * @exception SQLFeatureNotSupportedException if the JDBC driver does not 4282 * support this method; if the JDBC driver does not support this data type 4283 * @see JDBCType 4284 * @see SQLType 4285 * @since 1.8 4286 */ 4287 default void updateObject(String columnLabel, Object x, 4288 SQLType targetSqlType) throws SQLException { 4289 throw new SQLFeatureNotSupportedException("updateObject not implemented"); 4290 } 4291 }