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