2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / libjava / java / sql / ResultSet.java
blob46a6c65c3f705627a8b7ef06c9587a707b02c29e
1 /* ResultSet.java -- A SQL statement result set.
2 Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
39 package java.sql;
41 import java.io.InputStream;
42 import java.io.Reader;
43 import java.math.BigDecimal;
44 import java.net.URL;
45 import java.util.Calendar;
46 import java.util.Map;
48 /**
49 * This interface provides access to the data set returned by a SQL
50 * statement. An instance of this interface is returned by the various
51 * execution methods in the <code>Statement</code.
52 * <p>
53 * This class models a cursor, which can be stepped through one row at a
54 * time. Methods are provided for accessing columns by column name or by
55 * index.
56 * <p>
57 * Note that a result set is invalidated if the statement that returned
58 * it is closed.
60 * @author Aaron M. Renn (arenn@urbanophile.com)
62 public interface ResultSet
64 /**
65 * The rows will be processed in order from first to last.
67 int FETCH_FORWARD = 1000;
69 /**
70 * The rows will be processed in order from last to first.
72 int FETCH_REVERSE = 1001;
74 /**
75 * The rows will be processed in an unknown order
77 int FETCH_UNKNOWN = 1002;
79 /**
80 * This type of result set may only step forward through the rows returned.
82 int TYPE_FORWARD_ONLY = 1003;
84 /**
85 * This type of result set is scrollable and is not sensitive to changes
86 * made by other statements.
88 int TYPE_SCROLL_INSENSITIVE = 1004;
90 /**
91 * This type of result set is scrollable and is also sensitive to changes
92 * made by other statements.
94 int TYPE_SCROLL_SENSITIVE = 1005;
96 /**
97 * The concurrency mode of for the result set may not be modified.
99 int CONCUR_READ_ONLY = 1007;
102 * The concurrency mode of for the result set may be modified.
104 int CONCUR_UPDATABLE = 1008;
106 int HOLD_CURSORS_OVER_COMMIT = 1;
108 int CLOSE_CURSORS_AT_COMMIT = 2;
111 * This method advances to the next row in the result set. Any streams
112 * open on the current row are closed automatically.
114 * @return <code>true</code> if the next row exists, <code>false</code>
115 * otherwise.
116 * @exception SQLException If an error occurs.
118 boolean next() throws SQLException;
121 * This method closes the result set and frees any associated resources.
123 * @exception SQLException If an error occurs.
125 void close() throws SQLException;
128 * This method tests whether the value of the last column that was fetched
129 * was actually a SQL NULL value.
131 * @return <code>true</code> if the last column fetched was a NULL,
132 * <code>false</code> otherwise.
133 * @exception SQLException If an error occurs.
135 boolean wasNull() throws SQLException;
138 * This method returns the value of the specified column as a Java
139 * <code>String</code>.
141 * @param index The index of the column to return.
142 * @return The column value as a <code>String</code>.
143 * @exception SQLException If an error occurs.
145 String getString(int columnIndex) throws SQLException;
148 * This method returns the value of the specified column as a Java
149 * <code>boolean</code>.
151 * @param index The index of the column to return.
152 * @return The column value as a <code>boolean</code>.
153 * @exception SQLException If an error occurs.
155 boolean getBoolean(int columnIndex) throws SQLException;
158 * This method returns the value of the specified column as a Java
159 * <code>byte</code>.
161 * @param index The index of the column to return.
162 * @return The column value as a <code>byte</code>.
163 * @exception SQLException If an error occurs.
165 byte getByte(int columnIndex) throws SQLException;
168 * This method returns the value of the specified column as a Java
169 * <code>short</code>.
171 * @param index The index of the column to return.
172 * @return The column value as a <code>short</code>.
173 * @exception SQLException If an error occurs.
175 short getShort(int columnIndex) throws SQLException;
178 * This method returns the value of the specified column as a Java
179 * <code>int</code>.
181 * @param index The index of the column to return.
182 * @return The column value as a <code>int</code>.
183 * @exception SQLException If an error occurs.
185 int getInt(int columnIndex) throws SQLException;
188 * This method returns the value of the specified column as a Java
189 * <code>long</code>.
191 * @param index The index of the column to return.
192 * @return The column value as a <code>long</code>.
193 * @exception SQLException If an error occurs.
195 long getLong(int columnIndex) throws SQLException;
198 * This method returns the value of the specified column as a Java
199 * <code>float</code>.
201 * @param index The index of the column to return.
202 * @return The column value as a <code>float</code>.
203 * @exception SQLException If an error occurs.
205 float getFloat(int columnIndex) throws SQLException;
208 * This method returns the value of the specified column as a Java
209 * <code>double</code>.
211 * @param index The index of the column to return.
212 * @return The column value as a <code>double</code>.
213 * @exception SQLException If an error occurs.
215 double getDouble(int columnIndex) throws SQLException;
218 * This method returns the value of the specified column as a Java
219 * <code>BigDecimal</code>.
221 * @param index The index of the column to return.
222 * @param scale The number of digits to the right of the decimal to return.
223 * @return The column value as a <code>BigDecimal</code>.
224 * @exception SQLException If an error occurs.
225 * @deprecated
227 BigDecimal getBigDecimal(int columnIndex, int scale)
228 throws SQLException;
231 * This method returns the value of the specified column as a Java
232 * byte array.
234 * @param index The index of the column to return.
235 * @return The column value as a byte array
236 * @exception SQLException If an error occurs.
238 byte[] getBytes(int columnIndex) throws SQLException;
241 * This method returns the value of the specified column as a Java
242 * <code>java.sql.Date</code>.
244 * @param index The index of the column to return.
245 * @return The column value as a <code>java.sql.Date</code>.
246 * @exception SQLException If an error occurs.
248 Date getDate(int columnIndex) throws SQLException;
251 * This method returns the value of the specified column as a Java
252 * <code>java.sql.Time</code>.
254 * @param index The index of the column to return.
255 * @return The column value as a <code>java.sql.Time</code>.
256 * @exception SQLException If an error occurs.
258 Time getTime(int columnIndex) throws SQLException;
261 * This method returns the value of the specified column as a Java
262 * <code>java.sql.Timestamp</code>.
264 * @param index The index of the column to return.
265 * @return The column value as a <code>java.sql.Timestamp</code>.
266 * @exception SQLException If an error occurs.
268 Timestamp getTimestamp(int columnIndex) throws SQLException;
271 * This method returns the value of the specified column as an ASCII
272 * stream. Note that all the data from this stream must be read before
273 * fetching the value of any other column. Please also be aware that
274 * calling <code>next()</code> or <code>close()</code> on this result set
275 * will close this stream as well.
277 * @param index The index of the column to return.
278 * @return The column value as an ASCII <code>InputStream</code>.
279 * @exception SQLException If an error occurs.
281 InputStream getAsciiStream(int columnIndex) throws SQLException;
284 * This method returns the value of the specified column as a Unicode UTF-8
285 * stream. Note that all the data from this stream must be read before
286 * fetching the value of any other column. Please also be aware that
287 * calling <code>next()</code> or <code>close()</code> on this result set
288 * will close this stream as well.
290 * @param index The index of the column to return.
291 * @return The column value as a Unicode UTF-8 <code>InputStream</code>.
292 * @exception SQLException If an error occurs.
293 * @deprecated Use getCharacterStream instead.
295 InputStream getUnicodeStream(int columnIndex) throws SQLException;
298 * This method returns the value of the specified column as a raw byte
299 * stream. Note that all the data from this stream must be read before
300 * fetching the value of any other column. Please also be aware that
301 * calling <code>next()</code> or <code>close()</code> on this result set
302 * will close this stream as well.
304 * @param index The index of the column to return.
305 * @return The column value as a raw byte <code>InputStream</code>.
306 * @exception SQLException If an error occurs.
308 InputStream getBinaryStream(int columnIndex) throws SQLException;
311 * This method returns the value of the specified column as a Java
312 * <code>String</code>.
314 * @param column The name of the column to return.
315 * @return The column value as a <code>String</code>.
316 * @exception SQLException If an error occurs.
318 String getString(String columnName) throws SQLException;
321 * This method returns the value of the specified column as a Java
322 * <code>boolean</code>.
324 * @param column The name of the column to return.
325 * @return The column value as a <code>boolean</code>.
326 * @exception SQLException If an error occurs.
328 boolean getBoolean(String columnName) throws SQLException;
331 * This method returns the value of the specified column as a Java
332 * <code>byte</code>.
334 * @param column The name of the column to return.
335 * @return The column value as a <code>byte</code>.
336 * @exception SQLException If an error occurs.
338 byte getByte(String columnName) throws SQLException;
341 * This method returns the value of the specified column as a Java
342 * <code>short</code>.
344 * @param column The name of the column to return.
345 * @return The column value as a <code>short</code>.
346 * @exception SQLException If an error occurs.
348 short getShort(String columnName) throws SQLException;
351 * This method returns the value of the specified column as a Java
352 * <code>int</code>.
354 * @param column The name of the column to return.
355 * @return The column value as a <code>int</code>.
356 * @exception SQLException If an error occurs.
358 int getInt(String columnName) throws SQLException;
361 * This method returns the value of the specified column as a Java
362 * <code>long</code>.
364 * @param column The name of the column to return.
365 * @return The column value as a <code>long</code>.
366 * @exception SQLException If an error occurs.
368 long getLong(String columnName) throws SQLException;
371 * This method returns the value of the specified column as a Java
372 * <code>float</code>.
374 * @param column The name of the column to return.
375 * @return The column value as a <code>float</code>.
376 * @exception SQLException If an error occurs.
378 float getFloat(String columnName) throws SQLException;
381 * This method returns the value of the specified column as a Java
382 * <code>double</code>.
384 * @param column The name of the column to return.
385 * @return The column value as a <code>double</code>.
386 * @exception SQLException If an error occurs.
388 double getDouble(String columnName) throws SQLException;
391 * This method returns the value of the specified column as a Java
392 * <code>BigDecimal</code>.
394 * @param index The index of the column to return.
395 * @return The column value as a <code>BigDecimal</code>.
396 * @exception SQLException If an error occurs.
397 * @deprecated
399 BigDecimal getBigDecimal(String columnName, int scale)
400 throws SQLException;
403 * This method returns the value of the specified column as a Java
404 * byte array.
406 * @param column The name of the column to return.
407 * @return The column value as a byte array
408 * @exception SQLException If an error occurs.
410 byte[] getBytes(String columnName) throws SQLException;
413 * This method returns the value of the specified column as a Java
414 * <code>java.sql.Date</code>.
416 * @param column The name of the column to return.
417 * @return The column value as a <code>java.sql.Date</code>.
418 * @exception SQLException If an error occurs.
420 Date getDate(String columnName) throws SQLException;
423 * This method returns the value of the specified column as a Java
424 * <code>java.sql.Time</code>.
426 * @param column The name of the column to return.
427 * @return The column value as a <code>java.sql.Time</code>.
428 * @exception SQLException If an error occurs.
430 Time getTime(String columnName) throws SQLException;
433 * This method returns the value of the specified column as a Java
434 * <code>java.sql.Timestamp</code>.
436 * @param column The name of the column to return.
437 * @return The column value as a <code>java.sql.Timestamp</code>.
438 * @exception SQLException If an error occurs.
440 Timestamp getTimestamp(String columnName) throws SQLException;
443 * This method returns the value of the specified column as an ASCII
444 * stream. Note that all the data from this stream must be read before
445 * fetching the value of any other column. Please also be aware that
446 * calling <code>next()</code> or <code>close()</code> on this result set
447 * will close this stream as well.
449 * @param column The name of the column to return.
450 * @return The column value as an ASCII <code>InputStream</code>.
451 * @exception SQLException If an error occurs.
453 InputStream getAsciiStream(String columnName) throws SQLException;
456 * This method returns the value of the specified column as a Unicode UTF-8
457 * stream. Note that all the data from this stream must be read before
458 * fetching the value of any other column. Please also be aware that
459 * calling <code>next()</code> or <code>close()</code> on this result set
460 * will close this stream as well.
462 * @param column The name of the column to return.
463 * @return The column value as a Unicode UTF-8 <code>InputStream</code>.
464 * @exception SQLException If an error occurs.
465 * @deprecated Use getCharacterStream instead.
467 InputStream getUnicodeStream(String columnName) throws SQLException;
470 * This method returns the value of the specified column as a raw byte
471 * stream. Note that all the data from this stream must be read before
472 * fetching the value of any other column. Please also be aware that
473 * calling <code>next()</code> or <code>close()</code> on this result set
474 * will close this stream as well.
476 * @param column The name of the column to return.
477 * @return The column value as a raw byte <code>InputStream</code>.
478 * @exception SQLException If an error occurs.
480 InputStream getBinaryStream(String columnName) throws SQLException;
483 * This method returns the first SQL warning associated with this result
484 * set. Any additional warnings will be chained to this one.
486 * @return The first SQLWarning for this result set, or <code>null</code> if
487 * there are no warnings.
488 * @exception SQLException If an error occurs.
490 SQLWarning getWarnings() throws SQLException;
493 * This method clears all warnings associated with this result set.
495 * @exception SQLException If an error occurs.
497 void clearWarnings() throws SQLException;
500 * This method returns the name of the database cursor used by this
501 * result set.
503 * @return The name of the database cursor used by this result set.
504 * @exception SQLException If an error occurs.
506 String getCursorName() throws SQLException;
509 * This method returns data about the columns returned as part of the
510 * result set as a <code>ResultSetMetaData</code> instance.
512 * @return The <code>ResultSetMetaData</code> instance for this result set.
513 * @exception SQLException If an error occurs.
515 ResultSetMetaData getMetaData() throws SQLException;
518 * This method returns the value of the specified column as a Java
519 * <code>Object</code>.
521 * @param index The index of the column to return.
522 * @return The column value as an <code>Object</code>.
523 * @exception SQLException If an error occurs.
525 Object getObject(int columnIndex) throws SQLException;
528 * This method returns the value of the specified column as a Java
529 * <code>Object</code>.
531 * @param column The name of the column to return.
532 * @return The column value as an <code>Object</code>.
533 * @exception SQLException If an error occurs.
535 Object getObject(String columnName) throws SQLException;
538 * This method returns the column index of the specified named column.
540 * @param column The name of the column.
541 * @return The index of the column.
542 * @exception SQLException If an error occurs.
544 int findColumn(String columnName) throws SQLException;
547 * This method returns the value of the specified column as a character
548 * stream. Note that all the data from this stream must be read before
549 * fetching the value of any other column. Please also be aware that
550 * calling <code>next()</code> or <code>close()</code> on this result set
551 * will close this stream as well.
553 * @param index The index of the column to return.
554 * @return The column value as an character <code>Reader</code>.
555 * @exception SQLException If an error occurs.
557 Reader getCharacterStream(int columnIndex) throws SQLException;
560 * This method returns the value of the specified column as a character
561 * stream. Note that all the data from this stream must be read before
562 * fetching the value of any other column. Please also be aware that
563 * calling <code>next()</code> or <code>close()</code> on this result set
564 * will close this stream as well.
566 * @param column The name of the column to return.
567 * @return The column value as an character <code>Reader</code>.
568 * @exception SQLException If an error occurs.
570 Reader getCharacterStream(String columnName) throws SQLException;
573 * This method returns the value of the specified column as a Java
574 * <code>BigDecimal</code>.
576 * @param index The index of the column to return.
577 * @return The column value as a <code>BigDecimal</code>.
578 * @exception SQLException If an error occurs.
580 BigDecimal getBigDecimal(int columnIndex) throws SQLException;
583 * This method returns the value of the specified column as a Java
584 * <code>BigDecimal</code>.
586 * @param column The name of the column to return.
587 * @return The column value as a <code>BigDecimal</code>.
588 * @exception SQLException If an error occurs.
590 BigDecimal getBigDecimal(String columnName) throws SQLException;
593 * This method tests whether or not the cursor is before the first row
594 * in the result set.
596 * @return <code>true</code> if the cursor is positioned before the first
597 * row, <code>false</code> otherwise.
598 * @exception SQLException If an error occurs.
600 boolean isBeforeFirst() throws SQLException;
603 * This method tests whether or not the cursor is after the last row
604 * in the result set.
606 * @return <code>true</code> if the cursor is positioned after the last
607 * row, <code>false</code> otherwise.
608 * @exception SQLException If an error occurs.
610 boolean isAfterLast() throws SQLException;
613 * This method tests whether or not the cursor is positioned on the first
614 * row in the result set.
616 * @return <code>true</code> if the cursor is positioned on the first
617 * row, <code>false</code> otherwise.
618 * @exception SQLException If an error occurs.
620 boolean isFirst() throws SQLException;
623 * This method tests whether or not the cursor is on the last row
624 * in the result set.
626 * @return <code>true</code> if the cursor is positioned on the last
627 * row, <code>false</code> otherwise.
628 * @exception SQLException If an error occurs.
630 boolean isLast() throws SQLException;
633 * This method repositions the cursor to before the first row in the
634 * result set.
636 * @exception SQLException If an error occurs.
638 void beforeFirst() throws SQLException;
641 * This method repositions the cursor to after the last row in the result
642 * set.
644 * @exception SQLException If an error occurs.
646 void afterLast() throws SQLException;
649 * This method repositions the cursor on the first row in the
650 * result set.
652 * @return <code>true</code> if the cursor is on a valid row;
653 * <code>false</code> if there are no rows in the result set.
654 * @exception SQLException If an error occurs.
656 boolean first() throws SQLException;
659 * This method repositions the cursor on the last row in the result
660 * set.
662 * @return <code>true</code> if the cursor is on a valid row;
663 * <code>false</code> if there are no rows in the result set.
664 * @exception SQLException If an error occurs.
666 boolean last() throws SQLException;
669 * This method returns the current row number in the cursor. Numbering
670 * begins at index 1.
672 * @return The current row number, or 0 if there is not current row.
673 * @exception SQLException If an error occurs.
675 int getRow() throws SQLException;
678 * This method positions the result set to the specified absolute row.
679 * Positive numbers are row offsets from the beginning of the result
680 * set (numbering starts from row 1) and negative numbers are row offsets
681 * from the end of the result set (numbering starts from -1).
683 * @param row The row to position the result set to.
685 * @return <code>true</code> if the current position was changed,
686 * <code>false</code> otherwise.
687 * @exception SQLException If an error occurs.
689 boolean absolute(int row) throws SQLException;
692 * This method moves the result set position relative to the current row.
693 * The offset can be positive or negative.
695 * @param row The relative row position to move to.
696 * @return <code>true</code> if the current position was changed,
697 * <code>false</code> otherwise.
698 * @exception SQLException If an error occurs.
700 boolean relative(int rows) throws SQLException;
703 * This method moves the current position to the previous row in the
704 * result set.
706 * @return <code>true</code> if the previous row exists, <code>false</code>
707 * otherwise.
708 * @exception SQLException If an error occurs.
710 boolean previous() throws SQLException;
713 * This method provides a hint to the driver about which direction the
714 * result set will be processed in.
716 * @param direction The direction in which rows will be processed. (Values?)
717 * @exception SQLException If an error occurs.
719 void setFetchDirection(int direction) throws SQLException;
722 * This method returns the current fetch direction for this result set.
724 * @return The fetch direction for this result set.
725 * @exception SQLException If an error occurs.
727 int getFetchDirection() throws SQLException;
730 * This method provides a hint to the driver about how many rows at a
731 * time it should fetch from the database.
733 * @param rows The number of rows the driver should fetch per call.
734 * @exception SQLException If an error occurs.
736 void setFetchSize(int rows) throws SQLException;
739 * This method returns the current number of rows that will be fetched
740 * from the database at a time.
742 * @return The current fetch size for this result set.
743 * @exception SQLException If an error occurs.
745 int getFetchSize() throws SQLException;
748 * This method returns the result set type of this result set. This will
749 * be one of the TYPE_* constants defined in this interface.
751 * @return The result set type.
752 * @exception SQLException If an error occurs.
754 int getType() throws SQLException;
757 * This method returns the concurrency type of this result set. This will
758 * be one of the CONCUR_* constants defined in this interface.
760 * @return The result set concurrency type.
761 * @exception SQLException If an error occurs.
763 int getConcurrency() throws SQLException;
766 * This method tests whether or not the current row in the result set
767 * has been updated. Updates must be visible in order of this method to
768 * detect the update.
770 * @return <code>true</code> if the row has been updated, <code>false</code>
771 * otherwise.
772 * @exception SQLException If an error occurs.
774 boolean rowUpdated() throws SQLException;
777 * This method tests whether or not the current row in the result set
778 * has been inserted. Inserts must be visible in order of this method to
779 * detect the insert.
781 * @return <code>true</code> if the row has been inserted, <code>false</code>
782 * otherwise.
783 * @exception SQLException If an error occurs.
785 boolean rowInserted() throws SQLException;
788 * This method tests whether or not the current row in the result set
789 * has been deleted. Deletes must be visible in order of this method to
790 * detect the deletion.
792 * @return <code>true</code> if the row has been deleted, <code>false</code>
793 * otherwise.
794 * @exception SQLException If an error occurs.
796 boolean rowDeleted() throws SQLException;
799 * This method updates the specified column to have a NULL value. This
800 * does not update the actual database. <code>updateRow</code> must be
801 * called in order to do that.
803 * @return index The index of the column to update.
804 * @exception SQLException If an error occurs.
806 void updateNull(int columnIndex) throws SQLException;
809 * This method updates the specified column to have a boolean value. This
810 * does not update the actual database. <code>updateRow</code> must be
811 * called in order to do that.
813 * @param index The index of the column to update.
814 * @param value The new value of the column.
815 * @exception SQLException If an error occurs.
817 void updateBoolean(int columnIndex, boolean x) throws SQLException;
820 * This method updates the specified column to have a byte value. This
821 * does not update the actual database. <code>updateRow</code> must be
822 * called in order to do that.
824 * @param index The index of the column to update.
825 * @param value The new value of the column.
826 * @exception SQLException If an error occurs.
828 void updateByte(int columnIndex, byte x) throws SQLException;
831 * This method updates the specified column to have a short value. This
832 * does not update the actual database. <code>updateRow</code> must be
833 * called in order to do that.
835 * @param index The index of the column to update.
836 * @param value The new value of the column.
837 * @exception SQLException If an error occurs.
839 void updateShort(int columnIndex, short x) throws SQLException;
842 * This method updates the specified column to have an int value. This
843 * does not update the actual database. <code>updateRow</code> must be
844 * called in order to do that.
846 * @param index The index of the column to update.
847 * @param value The new value of the column.
848 * @exception SQLException If an error occurs.
850 void updateInt(int columnIndex, int x) throws SQLException;
853 * This method updates the specified column to have a long value. This
854 * does not update the actual database. <code>updateRow</code> must be
855 * called in order to do that.
857 * @param index The index of the column to update.
858 * @param value The new value of the column.
859 * @exception SQLException If an error occurs.
861 void updateLong(int columnIndex, long x) throws SQLException;
864 * This method updates the specified column to have a float value. This
865 * does not update the actual database. <code>updateRow</code> must be
866 * called in order to do that.
868 * @param index The index of the column to update.
869 * @param value The new value of the column.
870 * @exception SQLException If an error occurs.
872 void updateFloat(int columnIndex, float x) throws SQLException;
875 * This method updates the specified column to have a double value. This
876 * does not update the actual database. <code>updateRow</code> must be
877 * called in order to do that.
879 * @param index The index of the column to update.
880 * @param value The new value of the column.
881 * @exception SQLException If an error occurs.
883 void updateDouble(int columnIndex, double x) throws SQLException;
886 * This method updates the specified column to have a BigDecimal value. This
887 * does not update the actual database. <code>updateRow</code> must be
888 * called in order to do that.
890 * @param index The index of the column to update.
891 * @param value The new value of the column.
892 * @exception SQLException If an error occurs.
894 void updateBigDecimal(int columnIndex, BigDecimal x)
895 throws SQLException;
898 * This method updates the specified column to have a String value. This
899 * does not update the actual database. <code>updateRow</code> must be
900 * called in order to do that.
902 * @param index The index of the column to update.
903 * @param value The new value of the column.
904 * @exception SQLException If an error occurs.
906 void updateString(int columnIndex, String x) throws SQLException;
909 * This method updates the specified column to have a byte array value. This
910 * does not update the actual database. <code>updateRow</code> must be
911 * called in order to do that.
913 * @param index The index of the column to update.
914 * @param value The new value of the column.
915 * @exception SQLException If an error occurs.
917 void updateBytes(int columnIndex, byte[] x) throws SQLException;
920 * This method updates the specified column to have a java.sql.Date value. This
921 * does not update the actual database. <code>updateRow</code> must be
922 * called in order to do that.
924 * @param index The index of the column to update.
925 * @param value The new value of the column.
926 * @exception SQLException If an error occurs.
928 void updateDate(int columnIndex, Date x) throws SQLException;
931 * This method updates the specified column to have a java.sql.Time value. This
932 * does not update the actual database. <code>updateRow</code> must be
933 * called in order to do that.
935 * @param index The index of the column to update.
936 * @param value The new value of the column.
937 * @exception SQLException If an error occurs.
939 void updateTime(int columnIndex, Time x) throws SQLException;
942 * This method updates the specified column to have a java.sql.Timestamp value.
943 * This does not update the actual database. <code>updateRow</code> must be
944 * called in order to do that.
946 * @param index The index of the column to update.
947 * @param value The new value of the column.
948 * @exception SQLException If an error occurs.
950 void updateTimestamp(int columnIndex, Timestamp x)
951 throws SQLException;
954 * This method updates the specified column from an ASCII text stream.
955 * This does not update the actual database. <code>updateRow</code> must be
956 * called in order to do that.
958 * @param index The index of the column to update.
959 * @param value The new value of the column.
960 * @param length The length of the stream.
961 * @exception SQLException If an error occurs.
963 void updateAsciiStream(int columnIndex, InputStream x, int length)
964 throws SQLException;
967 * This method updates the specified column from a binary stream.
968 * This does not update the actual database. <code>updateRow</code> must be
969 * called in order to do that.
971 * @param index The index of the column to update.
972 * @param value The new value of the column.
973 * @param length The length of the stream.
974 * @exception SQLException If an error occurs.
976 void updateBinaryStream(int columnIndex, InputStream x, int length)
977 throws SQLException;
980 * This method updates the specified column from a character stream.
981 * This does not update the actual database. <code>updateRow</code> must be
982 * called in order to do that.
984 * @param index The index of the column to update.
985 * @param value The new value of the column.
986 * @param length The length of the stream.
987 * @exception SQLException If an error occurs.
989 void updateCharacterStream(int columnIndex, Reader x, int length)
990 throws SQLException;
993 * This method updates the specified column to have an Object value.
994 * This does not update the actual database. <code>updateRow</code> must be
995 * called in order to do that.
997 * @param index The index of the column to update.
998 * @param value The new value of the column.
1000 * @exception SQLException If an error occurs.
1002 void updateObject(int columnIndex, Object x, int scale)
1003 throws SQLException;
1006 * This method updates the specified column to have an Object value.
1007 * This does not update the actual database. <code>updateRow</code> must be
1008 * called in order to do that.
1010 * @param index The index of the column to update.
1011 * @param value The new value of the column.
1012 * @param scale The scale of the object in question, which is used only
1013 * for numeric type objects.
1014 * @exception SQLException If an error occurs.
1016 void updateObject(int columnIndex, Object x) throws SQLException;
1019 * This method updates the specified column to have a NULL value. This
1020 * does not update the actual database. <code>updateRow</code> must be
1021 * called in order to do that.
1023 * @return name The name of the column to update.
1024 * @exception SQLException If an error occurs.
1026 void updateNull(String columnName) throws SQLException;
1029 * This method updates the specified column to have a boolean value. This
1030 * does not update the actual database. <code>updateRow</code> must be
1031 * called in order to do that.
1033 * @param name The name of the column to update.
1034 * @param value The new value of the column.
1035 * @exception SQLException If an error occurs.
1037 void updateBoolean(String columnName, boolean x) throws SQLException;
1040 * This method updates the specified column to have a byte value. This
1041 * does not update the actual database. <code>updateRow</code> must be
1042 * called in order to do that.
1044 * @param name The name of the column to update.
1045 * @param value The new value of the column.
1046 * @exception SQLException If an error occurs.
1048 void updateByte(String columnName, byte x) throws SQLException;
1051 * This method updates the specified column to have a short value. This
1052 * does not update the actual database. <code>updateRow</code> must be
1053 * called in order to do that.
1055 * @param name The name of the column to update.
1056 * @param value The new value of the column.
1057 * @exception SQLException If an error occurs.
1059 void updateShort(String columnName, short x) throws SQLException;
1062 * This method updates the specified column to have an int value. This
1063 * does not update the actual database. <code>updateRow</code> must be
1064 * called in order to do that.
1066 * @param name The name of the column to update.
1067 * @param value The new value of the column.
1068 * @exception SQLException If an error occurs.
1070 void updateInt(String columnName, int x) throws SQLException;
1073 * This method updates the specified column to have a long value. This
1074 * does not update the actual database. <code>updateRow</code> must be
1075 * called in order to do that.
1077 * @param name The name of the column to update.
1078 * @param value The new value of the column.
1079 * @exception SQLException If an error occurs.
1081 void updateLong(String columnName, long x) throws SQLException;
1084 * This method updates the specified column to have a float value. This
1085 * does not update the actual database. <code>updateRow</code> must be
1086 * called in order to do that.
1088 * @param name The name of the column to update.
1089 * @param value The new value of the column.
1090 * @exception SQLException If an error occurs.
1092 void updateFloat(String columnName, float x) throws SQLException;
1095 * This method updates the specified column to have a double value. This
1096 * does not update the actual database. <code>updateRow</code> must be
1097 * called in order to do that.
1099 * @param name The name of the column to update.
1100 * @param value The new value of the column.
1101 * @exception SQLException If an error occurs.
1103 void updateDouble(String columnName, double x) throws SQLException;
1106 * This method updates the specified column to have a BigDecimal value. This
1107 * does not update the actual database. <code>updateRow</code> must be
1108 * called in order to do that.
1110 * @param name The name of the column to update.
1111 * @param value The new value of the column.
1112 * @exception SQLException If an error occurs.
1114 void updateBigDecimal(String columnName, BigDecimal x)
1115 throws SQLException;
1118 * This method updates the specified column to have a String value. This
1119 * does not update the actual database. <code>updateRow</code> must be
1120 * called in order to do that.
1122 * @param name The name of the column to update.
1123 * @param value The new value of the column.
1124 * @exception SQLException If an error occurs.
1126 void updateString(String columnName, String x) throws SQLException;
1129 * This method updates the specified column to have a byte array value. This
1130 * does not update the actual database. <code>updateRow</code> must be
1131 * called in order to do that.
1133 * @param name The name of the column to update.
1134 * @param value The new value of the column.
1135 * @exception SQLException If an error occurs.
1137 void updateBytes(String columnName, byte[] x) throws SQLException;
1140 * This method updates the specified column to have a java.sql.Date value. This
1141 * does not update the actual database. <code>updateRow</code> must be
1142 * called in order to do that.
1144 * @param name The name of the column to update.
1145 * @param value The new value of the column.
1146 * @exception SQLException If an error occurs.
1148 void updateDate(String columnName, Date x) throws SQLException;
1151 * This method updates the specified column to have a java.sql.Time value. This
1152 * does not update the actual database. <code>updateRow</code> must be
1153 * called in order to do that.
1155 * @param name The name of the column to update.
1156 * @param value The new value of the column.
1157 * @exception SQLException If an error occurs.
1159 void updateTime(String columnName, Time x) throws SQLException;
1162 * This method updates the specified column to have a java.sql.Timestamp value.
1163 * This does not update the actual database. <code>updateRow</code> must be
1164 * called in order to do that.
1166 * @param name The name of the column to update.
1167 * @param value The new value of the column.
1168 * @exception SQLException If an error occurs.
1170 void updateTimestamp(String columnName, Timestamp x)
1171 throws SQLException;
1174 * This method updates the specified column from an ASCII text stream.
1175 * This does not update the actual database. <code>updateRow</code> must be
1176 * called in order to do that.
1178 * @param name The name of the column to update.
1179 * @param value The new value of the column.
1180 * @param length The length of the stream.
1181 * @exception SQLException If an error occurs.
1183 void updateAsciiStream(String columnName, InputStream x, int length)
1184 throws SQLException;
1187 * This method updates the specified column from a binary stream.
1188 * This does not update the actual database. <code>updateRow</code> must be
1189 * called in order to do that.
1191 * @param name The name of the column to update.
1192 * @param value The new value of the column.
1193 * @param length The length of the stream.
1194 * @exception SQLException If an error occurs.
1196 void updateBinaryStream(String columnName, InputStream x, int length)
1197 throws SQLException;
1200 * This method updates the specified column from a character stream.
1201 * This does not update the actual database. <code>updateRow</code> must be
1202 * called in order to do that.
1204 * @param name The name of the column to update.
1205 * @param value The new value of the column.
1206 * @param length The length of the stream.
1208 * @exception SQLException If an error occurs.
1210 void updateCharacterStream(String columnName, Reader reader,
1211 int length) throws SQLException;
1214 * This method updates the specified column to have an Object value.
1215 * This does not update the actual database. <code>updateRow</code> must be
1216 * called in order to do that.
1218 * @param name The name of the column to update.
1219 * @param value The new value of the column.
1220 * @exception SQLException If an error occurs.
1222 void updateObject(String columnName, Object x, int scale)
1223 throws SQLException;
1226 * This method updates the specified column to have an Object value.
1227 * This does not update the actual database. <code>updateRow</code> must be
1228 * called in order to do that.
1230 * @param name The name of the column to update.
1231 * @param value The new value of the column.
1232 * @param scale The scale of the object in question, which is used only
1233 * for numeric type objects.
1234 * @exception SQLException If an error occurs.
1236 void updateObject(String columnName, Object x) throws SQLException;
1239 * This method inserts the current row into the database. The result set
1240 * must be positioned on the insert row in order to call this method
1241 * successfully.
1243 * @exception SQLException If an error occurs.
1245 void insertRow() throws SQLException;
1248 * This method updates the current row in the database.
1250 * @exception SQLException If an error occurs.
1252 void updateRow() throws SQLException;
1255 * This method deletes the current row in the database.
1257 * @exception SQLException If an error occurs.
1259 void deleteRow() throws SQLException;
1262 * This method refreshes the contents of the current row from the database.
1264 * @exception SQLException If an error occurs.
1266 void refreshRow() throws SQLException;
1269 * This method cancels any changes that have been made to a row. If
1270 * the <code>rowUpdate</code> method has been called, then the changes
1271 * cannot be undone.
1273 * @exception SQLException If an error occurs.
1275 void cancelRowUpdates() throws SQLException;
1278 * This method positions the result set to the "insert row", which allows
1279 * a new row to be inserted into the database from the result set.
1281 * @exception SQLException If an error occurs.
1283 void moveToInsertRow() throws SQLException;
1286 * This method moves the result set position from the insert row back to
1287 * the current row that was selected prior to moving to the insert row.
1289 * @exception SQLException If an error occurs.
1291 void moveToCurrentRow() throws SQLException;
1294 * This method returns a the <code>Statement</code> that was used to
1295 * produce this result set.
1297 * @return The <code>Statement</code> used to produce this result set.
1299 * @exception SQLException If an error occurs.
1301 Statement getStatement() throws SQLException;
1304 * This method returns the value of the specified column as a Java
1305 * <code>Object</code> using the specified SQL type to Java type map.
1307 * @param index The index of the column to return.
1308 * @param map The SQL type to Java type map to use.
1309 * @return The value of the column as an <code>Object</code>.
1310 * @exception SQLException If an error occurs.
1312 Object getObject(int i, Map map) throws SQLException;
1315 * This method returns a <code>Ref</code> for the specified column which
1316 * represents the structured type for the column.
1318 * @param index The index of the column to return.
1319 * @return A <code>Ref</code> object for the column
1320 * @exception SQLException If an error occurs.
1322 Ref getRef(int i) throws SQLException;
1325 * This method returns the specified column value as a BLOB.
1327 * @param index The index of the column value to return.
1328 * @return The value of the column as a BLOB.
1329 * @exception SQLException If an error occurs.
1331 Blob getBlob(int i) throws SQLException;
1334 * This method returns the specified column value as a CLOB.
1336 * @param index The index of the column value to return.
1337 * @return The value of the column as a CLOB.
1338 * @exception SQLException If an error occurs.
1340 Clob getClob(int i) throws SQLException;
1343 * This method returns the specified column value as an <code>Array</code>.
1345 * @param index The index of the column value to return.
1346 * @return The value of the column as an <code>Array</code>.
1347 * @exception SQLException If an error occurs.
1349 Array getArray(int i) throws SQLException;
1352 * This method returns the value of the specified column as a Java
1353 * <code>Object</code> using the specified SQL type to Java type map.
1355 * @param name The name of the column to return.
1356 * @param map The SQL type to Java type map to use.
1357 * @return The value of the column as an <code>Object</code>.
1358 * @exception SQLException If an error occurs.
1360 Object getObject(String colName, Map map) throws SQLException;
1363 * This method returns a <code>Ref</code> for the specified column which
1364 * represents the structured type for the column.
1366 * @param index The index of the column to return.
1367 * @return A <code>Ref</code> object for the column
1368 * @exception SQLException If an error occurs.
1370 Ref getRef(String colName) throws SQLException;
1373 * This method returns the specified column value as a BLOB.
1375 * @param name The name of the column value to return.
1376 * @return The value of the column as a BLOB.
1377 * @exception SQLException If an error occurs.
1379 Blob getBlob(String colName) throws SQLException;
1382 * This method returns the specified column value as a CLOB.
1384 * @param name The name of the column value to return.
1385 * @return The value of the column as a CLOB.
1386 * @exception SQLException If an error occurs.
1388 Clob getClob(String colName) throws SQLException;
1391 * This method returns the specified column value as an <code>Array</code>.
1393 * @param name The name of the column value to return.
1394 * @return The value of the column as an <code>Array</code>.
1395 * @exception SQLException If an error occurs.
1397 Array getArray(String colName) throws SQLException;
1400 * This method returns the specified column value as a
1401 * <code>java.sql.Date</code>. The specified <code>Calendar</code> is used
1402 * to generate a value for the date if the database does not support
1403 * timezones.
1405 * @param index The index of the column value to return.
1406 * @param cal The <code>Calendar</code> to use for calculating timezones.
1407 * @return The value of the column as a <code>java.sql.Date</code>.
1408 * @exception SQLException If an error occurs.
1410 Date getDate(int columnIndex, Calendar cal) throws SQLException;
1413 * This method returns the specified column value as a
1414 * <code>java.sql.Date</code>. The specified <code>Calendar</code> is used
1415 * to generate a value for the date if the database does not support
1416 * timezones.
1418 * @param name The name of the column value to return.
1419 * @param cal The <code>Calendar</code> to use for calculating timezones.
1420 * @return The value of the column as a <code>java.sql.Date</code>.
1421 * @exception SQLException If an error occurs.
1423 Date getDate(String columnName, Calendar cal) throws SQLException;
1426 * This method returns the specified column value as a
1427 * <code>java.sql.Time</code>. The specified <code>Calendar</code> is used
1428 * to generate a value for the time if the database does not support
1429 * timezones.
1431 * @param index The index of the column value to return.
1432 * @param cal The <code>Calendar</code> to use for calculating timezones.
1433 * @return The value of the column as a <code>java.sql.Time</code>.
1434 * @exception SQLException If an error occurs.
1436 Time getTime(int columnIndex, Calendar cal) throws SQLException;
1439 * This method returns the specified column value as a
1440 * <code>java.sql.Time</code>. The specified <code>Calendar</code> is used
1441 * to generate a value for the time if the database does not support
1442 * timezones.
1444 * @param name The name of the column value to return.
1445 * @param cal The <code>Calendar</code> to use for calculating timezones.
1446 * @return The value of the column as a <code>java.sql.Time</code>.
1447 * @exception SQLException If an error occurs.
1449 Time getTime(String columnName, Calendar cal) throws SQLException;
1452 * This method returns the specified column value as a
1453 * <code>java.sql.Timestamp</code>. The specified <code>Calendar</code> is used
1454 * to generate a value for the timestamp if the database does not support
1455 * timezones.
1457 * @param index The index of the column value to return.
1458 * @param cal The <code>Calendar</code> to use for calculating timezones.
1459 * @return The value of the column as a <code>java.sql.Timestamp</code>.
1460 * @exception SQLException If an error occurs.
1462 Timestamp getTimestamp(int columnIndex, Calendar cal)
1463 throws SQLException;
1466 * This method returns the specified column value as a
1467 * <code>java.sql.Timestamp</code>. The specified <code>Calendar</code> is used
1468 * to generate a value for the timestamp if the database does not support
1469 * timezones.
1471 * @param name The name of the column value to return.
1472 * @param cal The <code>Calendar</code> to use for calculating timezones.
1474 * @return The value of the column as a <code>java.sql.Timestamp</code>.
1476 * @exception SQLException If an error occurs.
1478 Timestamp getTimestamp(String columnName, Calendar cal)
1479 throws SQLException;
1482 * @since 1.4
1484 URL getURL(int columnIndex) throws SQLException;
1487 * @since 1.4
1489 URL getURL(String columnName) throws SQLException;
1492 * @since 1.4
1494 void updateRef(int columnIndex, Ref x) throws SQLException;
1497 * @since 1.4
1499 void updateRef(String columnName, Ref x) throws SQLException;
1502 * @since 1.4
1504 void updateBlob(int columnIndex, Blob x) throws SQLException;
1507 * @since 1.4
1509 void updateBlob(String columnName, Blob x) throws SQLException;
1512 * @since 1.4
1514 void updateClob(int columnIndex, Clob x) throws SQLException;
1517 * @since 1.4
1519 void updateClob(String columnName, Clob x) throws SQLException;
1522 * @since 1.4
1524 void updateArray(int columnIndex, Array x) throws SQLException;
1527 * @since 1.4
1529 void updateArray(String columnName, Array x) throws SQLException;