Daily bump.
[official-gcc.git] / libjava / java / sql / ResultSet.java
blob69585d5ea9ff76e16048a725b15428acaaefb5f7
1 /* ResultSet.java -- A SQL statement result set.
2 Copyright (C) 1999, 2000 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.util.Calendar;
45 import java.util.Map;
47 /**
48 * This interface provides access to the data set returned by a SQL
49 * statement. An instance of this interface is returned by the various
50 * execution methods in the <code>Statement</code.
51 * <p>
52 * This class models a cursor, which can be stepped through one row at a
53 * time. Methods are provided for accessing columns by column name or by
54 * index.
55 * <p>
56 * Note that a result set is invalidated if the statement that returned
57 * it is closed.
59 * @author Aaron M. Renn (arenn@urbanophile.com)
61 public interface ResultSet
64 /**
65 * The rows will be processed in order from first to last.
67 public static final int FETCH_FORWARD = 0;
69 /**
70 * The rows will be processed in order from last to first.
72 public static final int FETCH_REVERSE = 1;
74 /**
75 * The rows will be processed in an unknown order
77 public static final int FETCH_UNKNOWN = 2;
79 /**
80 * This type of result set may only step forward through the rows returned.
82 public static final int TYPE_FORWARD_ONLY = 0;
84 /**
85 * This type of result set is scrollable and is not sensitive to changes
86 * made by other statements.
88 public static final int TYPE_SCROLL_INSENSITIVE = 1;
90 /**
91 * This type of result set is scrollable and is also sensitive to changes
92 * made by other statements.
94 public static final int TYPE_SCROLL_SENSITIVE = 1;
96 /**
97 * The concurrency mode of for the result set may not be modified.
99 public static final int CONCUR_READ_ONLY = 0;
102 * The concurrency mode of for the result set may be modified.
104 public static final int CONCUR_UPDATABLE = 1;
106 /*************************************************************************/
109 * This method advances to the next row in the result set. Any streams
110 * open on the current row are closed automatically.
112 * @return <code>true</code> if the next row exists, <code>false</code>
113 * otherwise.
115 * @exception SQLException If an error occurs.
117 public abstract boolean
118 next() throws SQLException;
120 /*************************************************************************/
123 * This method moves the current position to the previous row in the
124 * result set.
126 * @return <code>true</code> if the previous row exists, <code>false</code>
127 * otherwise.
129 * @exception SQLException If an error occurs.
131 public abstract boolean
132 previous() throws SQLException;
134 /*************************************************************************/
137 * This method closes the result set and frees any associated resources.
139 * @exception SQLException If an error occurs.
141 public abstract void
142 close() throws SQLException;
144 /*************************************************************************/
147 * This method tests whether the value of the last column that was fetched
148 * was actually a SQL NULL value.
150 * @return <code>true</code> if the last column fetched was a NULL,
151 * <code>false</code> otherwise.
153 * @exception SQLException If an error occurs.
155 public abstract boolean
156 wasNull() throws SQLException;
158 /*************************************************************************/
161 * This method returns the value of the specified column as a Java
162 * <code>String</code>.
164 * @param index The index of the column to return.
166 * @return The column value as a <code>String</code>.
168 * @exception SQLException If an error occurs.
170 public abstract String
171 getString(int index) throws SQLException;
173 /*************************************************************************/
176 * This method returns the value of the specified column as a Java
177 * <code>Object</code>.
179 * @param index The index of the column to return.
181 * @return The column value as an <code>Object</code>.
183 * @exception SQLException If an error occurs.
185 public abstract Object
186 getObject(int index) throws SQLException;
188 /*************************************************************************/
191 * This method returns the value of the specified column as a Java
192 * <code>boolean</code>.
194 * @param index The index of the column to return.
196 * @return The column value as a <code>boolean</code>.
198 * @exception SQLException If an error occurs.
200 public abstract boolean
201 getBoolean(int index) throws SQLException;
203 /*************************************************************************/
206 * This method returns the value of the specified column as a Java
207 * <code>byte</code>.
209 * @param index The index of the column to return.
211 * @return The column value as a <code>byte</code>.
213 * @exception SQLException If an error occurs.
215 public abstract byte
216 getByte(int index) throws SQLException;
218 /*************************************************************************/
221 * This method returns the value of the specified column as a Java
222 * <code>short</code>.
224 * @param index The index of the column to return.
226 * @return The column value as a <code>short</code>.
228 * @exception SQLException If an error occurs.
230 public abstract short
231 getShort(int index) throws SQLException;
233 /*************************************************************************/
236 * This method returns the value of the specified column as a Java
237 * <code>int</code>.
239 * @param index The index of the column to return.
241 * @return The column value as a <code>int</code>.
243 * @exception SQLException If an error occurs.
245 public abstract int
246 getInt(int index) throws SQLException;
248 /*************************************************************************/
251 * This method returns the value of the specified column as a Java
252 * <code>long</code>.
254 * @param index The index of the column to return.
256 * @return The column value as a <code>long</code>.
258 * @exception SQLException If an error occurs.
260 public abstract long
261 getLong(int index) throws SQLException;
263 /*************************************************************************/
266 * This method returns the value of the specified column as a Java
267 * <code>float</code>.
269 * @param index The index of the column to return.
271 * @return The column value as a <code>float</code>.
273 * @exception SQLException If an error occurs.
275 public abstract float
276 getFloat(int index) throws SQLException;
278 /*************************************************************************/
281 * This method returns the value of the specified column as a Java
282 * <code>double</code>.
284 * @param index The index of the column to return.
286 * @return The column value as a <code>double</code>.
288 * @exception SQLException If an error occurs.
290 public abstract double
291 getDouble(int index) throws SQLException;
293 /*************************************************************************/
296 * This method returns the value of the specified column as a Java
297 * <code>BigDecimal</code>.
299 * @param index The index of the column to return.
301 * @return The column value as a <code>BigDecimal</code>.
303 * @exception SQLException If an error occurs.
305 public abstract BigDecimal
306 getBigDecimal(int index) throws SQLException;
308 /*************************************************************************/
311 * This method returns the value of the specified column as a Java
312 * <code>BigDecimal</code>.
314 * @param index The index of the column to return.
315 * @param scale The number of digits to the right of the decimal to return.
317 * @return The column value as a <code>BigDecimal</code>.
319 * @exception SQLException If an error occurs.
321 public abstract BigDecimal
322 getBigDecimal(int index, int scale) throws SQLException;
324 /*************************************************************************/
327 * This method returns the value of the specified column as a Java
328 * byte array.
330 * @param index The index of the column to return.
332 * @return The column value as a byte array
334 * @exception SQLException If an error occurs.
336 public abstract byte[]
337 getBytes(int index) throws SQLException;
339 /*************************************************************************/
342 * This method returns the value of the specified column as a Java
343 * <code>java.sql.Date</code>.
345 * @param index The index of the column to return.
347 * @return The column value as a <code>java.sql.Date</code>.
349 * @exception SQLException If an error occurs.
351 public abstract java.sql.Date
352 getDate(int index) throws SQLException;
354 /*************************************************************************/
357 * This method returns the value of the specified column as a Java
358 * <code>java.sql.Time</code>.
360 * @param index The index of the column to return.
362 * @return The column value as a <code>java.sql.Time</code>.
364 * @exception SQLException If an error occurs.
366 public abstract java.sql.Time
367 getTime(int index) throws SQLException;
369 /*************************************************************************/
372 * This method returns the value of the specified column as a Java
373 * <code>java.sql.Timestamp</code>.
375 * @param index The index of the column to return.
377 * @return The column value as a <code>java.sql.Timestamp</code>.
379 * @exception SQLException If an error occurs.
381 public abstract java.sql.Timestamp
382 getTimestamp(int index) throws SQLException;
384 /*************************************************************************/
387 * This method returns the value of the specified column as an ASCII
388 * stream. Note that all the data from this stream must be read before
389 * fetching the value of any other column. Please also be aware that
390 * calling <code>next()</code> or <code>close()</code> on this result set
391 * will close this stream as well.
393 * @param index The index of the column to return.
395 * @return The column value as an ASCII <code>InputStream</code>.
397 * @exception SQLException If an error occurs.
399 public abstract InputStream
400 getAsciiStream(int index) throws SQLException;
402 /*************************************************************************/
405 * This method returns the value of the specified column as a Unicode UTF-8
406 * stream. Note that all the data from this stream must be read before
407 * fetching the value of any other column. Please also be aware that
408 * calling <code>next()</code> or <code>close()</code> on this result set
409 * will close this stream as well.
411 * @param index The index of the column to return.
413 * @return The column value as a Unicode UTF-8 <code>InputStream</code>.
415 * @exception SQLException If an error occurs.
417 public abstract InputStream
418 getUnicodeStream(int index) throws SQLException;
420 /*************************************************************************/
423 * This method returns the value of the specified column as a raw byte
424 * stream. Note that all the data from this stream must be read before
425 * fetching the value of any other column. Please also be aware that
426 * calling <code>next()</code> or <code>close()</code> on this result set
427 * will close this stream as well.
429 * @param index The index of the column to return.
431 * @return The column value as a raw byte <code>InputStream</code>.
433 * @exception SQLException If an error occurs.
435 public abstract InputStream
436 getBinaryStream(int index) throws SQLException;
438 /*************************************************************************/
441 * This method returns the value of the specified column as a character
442 * stream. Note that all the data from this stream must be read before
443 * fetching the value of any other column. Please also be aware that
444 * calling <code>next()</code> or <code>close()</code> on this result set
445 * will close this stream as well.
447 * @param index The index of the column to return.
449 * @return The column value as an character <code>Reader</code>.
451 * @exception SQLException If an error occurs.
453 public abstract Reader
454 getCharacterStream(int index) throws SQLException;
456 /*************************************************************************/
459 * This method returns the value of the specified column as a Java
460 * <code>String</code>.
462 * @param column The name of the column to return.
464 * @return The column value as a <code>String</code>.
466 * @exception SQLException If an error occurs.
468 public abstract String
469 getString(String column) throws SQLException;
471 /*************************************************************************/
474 * This method returns the value of the specified column as a Java
475 * <code>Object</code>.
477 * @param column The name of the column to return.
479 * @return The column value as an <code>Object</code>.
481 * @exception SQLException If an error occurs.
483 public abstract Object
484 getObject(String column) throws SQLException;
486 /*************************************************************************/
489 * This method returns the value of the specified column as a Java
490 * <code>boolean</code>.
492 * @param column The name of the column to return.
494 * @return The column value as a <code>boolean</code>.
496 * @exception SQLException If an error occurs.
498 public abstract boolean
499 getBoolean(String column) throws SQLException;
501 /*************************************************************************/
504 * This method returns the value of the specified column as a Java
505 * <code>byte</code>.
507 * @param column The name of the column to return.
509 * @return The column value as a <code>byte</code>.
511 * @exception SQLException If an error occurs.
513 public abstract byte
514 getByte(String column) throws SQLException;
516 /*************************************************************************/
519 * This method returns the value of the specified column as a Java
520 * <code>short</code>.
522 * @param column The name of the column to return.
524 * @return The column value as a <code>short</code>.
526 * @exception SQLException If an error occurs.
528 public abstract short
529 getShort(String column) throws SQLException;
531 /*************************************************************************/
534 * This method returns the value of the specified column as a Java
535 * <code>int</code>.
537 * @param column The name of the column to return.
539 * @return The column value as a <code>int</code>.
541 * @exception SQLException If an error occurs.
543 public abstract int
544 getInt(String column) throws SQLException;
546 /*************************************************************************/
549 * This method returns the value of the specified column as a Java
550 * <code>long</code>.
552 * @param column The name of the column to return.
554 * @return The column value as a <code>long</code>.
556 * @exception SQLException If an error occurs.
558 public abstract long
559 getLong(String column) throws SQLException;
561 /*************************************************************************/
564 * This method returns the value of the specified column as a Java
565 * <code>float</code>.
567 * @param column The name of the column to return.
569 * @return The column value as a <code>float</code>.
571 * @exception SQLException If an error occurs.
573 public abstract float
574 getFloat(String column) throws SQLException;
576 /*************************************************************************/
579 * This method returns the value of the specified column as a Java
580 * <code>double</code>.
582 * @param column The name of the column to return.
584 * @return The column value as a <code>double</code>.
586 * @exception SQLException If an error occurs.
588 public abstract double
589 getDouble(String column) throws SQLException;
591 /*************************************************************************/
594 * This method returns the value of the specified column as a Java
595 * <code>BigDecimal</code>.
597 * @param column The name of the column to return.
599 * @return The column value as a <code>BigDecimal</code>.
601 * @exception SQLException If an error occurs.
603 public abstract BigDecimal
604 getBigDecimal(String column) throws SQLException;
606 /*************************************************************************/
609 * This method returns the value of the specified column as a Java
610 * <code>BigDecimal</code>.
612 * @param column The name of the column to return.
613 * @param scale The number of digits to the right of the decimal to return.
615 * @return The column value as a <code>BigDecimal</code>.
617 * @exception SQLException If an error occurs.
619 public abstract BigDecimal
620 getBigDecimal(String column, int scale) throws SQLException;
622 /*************************************************************************/
625 * This method returns the value of the specified column as a Java
626 * byte array.
628 * @param column The name of the column to return.
630 * @return The column value as a byte array
632 * @exception SQLException If an error occurs.
634 public abstract byte[]
635 getBytes(String column) throws SQLException;
637 /*************************************************************************/
640 * This method returns the value of the specified column as a Java
641 * <code>java.sql.Date</code>.
643 * @param column The name of the column to return.
645 * @return The column value as a <code>java.sql.Date</code>.
647 * @exception SQLException If an error occurs.
649 public abstract java.sql.Date
650 getDate(String column) throws SQLException;
652 /*************************************************************************/
655 * This method returns the value of the specified column as a Java
656 * <code>java.sql.Time</code>.
658 * @param column The name of the column to return.
660 * @return The column value as a <code>java.sql.Time</code>.
662 * @exception SQLException If an error occurs.
664 public abstract java.sql.Time
665 getTime(String column) throws SQLException;
667 /*************************************************************************/
670 * This method returns the value of the specified column as a Java
671 * <code>java.sql.Timestamp</code>.
673 * @param column The name of the column to return.
675 * @return The column value as a <code>java.sql.Timestamp</code>.
677 * @exception SQLException If an error occurs.
679 public abstract java.sql.Timestamp
680 getTimestamp(String column) throws SQLException;
682 /*************************************************************************/
685 * This method returns the value of the specified column as an ASCII
686 * stream. Note that all the data from this stream must be read before
687 * fetching the value of any other column. Please also be aware that
688 * calling <code>next()</code> or <code>close()</code> on this result set
689 * will close this stream as well.
691 * @param column The name of the column to return.
693 * @return The column value as an ASCII <code>InputStream</code>.
695 * @exception SQLException If an error occurs.
697 public abstract InputStream
698 getAsciiStream(String column) throws SQLException;
700 /*************************************************************************/
703 * This method returns the value of the specified column as a Unicode UTF-8
704 * stream. Note that all the data from this stream must be read before
705 * fetching the value of any other column. Please also be aware that
706 * calling <code>next()</code> or <code>close()</code> on this result set
707 * will close this stream as well.
709 * @param column The name of the column to return.
711 * @return The column value as a Unicode UTF-8 <code>InputStream</code>.
713 * @exception SQLException If an error occurs.
715 public abstract InputStream
716 getUnicodeStream(String column) throws SQLException;
718 /*************************************************************************/
721 * This method returns the value of the specified column as a raw byte
722 * stream. Note that all the data from this stream must be read before
723 * fetching the value of any other column. Please also be aware that
724 * calling <code>next()</code> or <code>close()</code> on this result set
725 * will close this stream as well.
727 * @param column The name of the column to return.
729 * @return The column value as a raw byte <code>InputStream</code>.
731 * @exception SQLException If an error occurs.
733 public abstract InputStream
734 getBinaryStream(String column) throws SQLException;
736 /*************************************************************************/
739 * This method returns the value of the specified column as a character
740 * stream. Note that all the data from this stream must be read before
741 * fetching the value of any other column. Please also be aware that
742 * calling <code>next()</code> or <code>close()</code> on this result set
743 * will close this stream as well.
745 * @param column The name of the column to return.
747 * @return The column value as an character <code>Reader</code>.
749 * @exception SQLException If an error occurs.
751 public abstract Reader
752 getCharacterStream(String column) throws SQLException;
754 /*************************************************************************/
757 * This method returns the first SQL warning associated with this result
758 * set. Any additional warnings will be chained to this one.
760 * @return The first SQLWarning for this result set, or <code>null</code> if
761 * there are no warnings.
763 * @exception SQLException If an error occurs.
765 public abstract SQLWarning
766 getWarnings() throws SQLException;
768 /*************************************************************************/
771 * This method clears all warnings associated with this result set.
773 * @exception SQLException If an error occurs.
775 public abstract void
776 clearWarnings() throws SQLException;
778 /*************************************************************************/
781 * This method returns the name of the database cursor used by this
782 * result set.
784 * @return The name of the database cursor used by this result set.
786 * @exception SQLException If an error occurs.
788 public abstract String
789 getCursorName() throws SQLException;
791 /*************************************************************************/
794 * This method returns data about the columns returned as part of the
795 * result set as a <code>ResultSetMetaData</code> instance.
797 * @return The <code>ResultSetMetaData</code> instance for this result set.
799 * @exception SQLException If an error occurs.
801 public abstract ResultSetMetaData
802 getMetaData() throws SQLException;
804 /*************************************************************************/
807 * This method returns the column index of the specified named column.
809 * @param column The name of the column.
811 * @return The index of the column.
813 * @exception SQLException If an error occurs.
815 public abstract int
816 findColumn(String column) throws SQLException;
818 /*************************************************************************/
821 * This method tests whether or not the cursor is before the first row
822 * in the result set.
824 * @return <code>true</code> if the cursor is positioned before the first
825 * row, <code>false</code> otherwise.
827 * @exception SQLException If an error occurs.
829 public abstract boolean
830 isBeforeFirst() throws SQLException;
832 /*************************************************************************/
835 * This method tests whether or not the cursor is after the last row
836 * in the result set.
838 * @return <code>true</code> if the cursor is positioned after the last
839 * row, <code>false</code> otherwise.
841 * @exception SQLException If an error occurs.
843 public abstract boolean
844 isAfterLast() throws SQLException;
846 /*************************************************************************/
849 * This method tests whether or not the cursor is positioned on the first
850 * row in the result set.
852 * @return <code>true</code> if the cursor is positioned on the first
853 * row, <code>false</code> otherwise.
855 * @exception SQLException If an error occurs.
857 public abstract boolean
858 isFirst() throws SQLException;
860 /*************************************************************************/
863 * This method tests whether or not the cursor is on the last row
864 * in the result set.
866 * @return <code>true</code> if the cursor is positioned on the last
867 * row, <code>false</code> otherwise.
869 * @exception SQLException If an error occurs.
871 public abstract boolean
872 isLast() throws SQLException;
874 /*************************************************************************/
877 * This method repositions the cursor to before the first row in the
878 * result set.
880 * @exception SQLException If an error occurs.
882 public abstract void
883 beforeFirst() throws SQLException;
885 /*************************************************************************/
888 * This method repositions the cursor to after the last row in the result
889 * set.
891 * @exception SQLException If an error occurs.
893 public abstract void
894 afterLast() throws SQLException;
896 /*************************************************************************/
899 * This method repositions the cursor on the first row in the
900 * result set.
902 * @return <code>true</code> if the cursor is on a valid row;
903 * <code>false</code> if there are no rows in the result set.
905 * @exception SQLException If an error occurs.
907 public abstract boolean
908 first() throws SQLException;
910 /*************************************************************************/
913 * This method repositions the cursor on the last row in the result
914 * set.
916 * @return <code>true</code> if the cursor is on a valid row;
917 * <code>false</code> if there are no rows in the result set.
919 * @exception SQLException If an error occurs.
921 public abstract boolean
922 last() throws SQLException;
924 /*************************************************************************/
927 * This method returns the current row number in the cursor. Numbering
928 * begins at index 1.
930 * @return The current row number, or 0 if there is not current row.
932 * @exception SQLException If an error occurs.
934 public abstract int
935 getRow() throws SQLException;
937 /*************************************************************************/
940 * This method positions the result set to the specified absolute row.
941 * Positive numbers are row offsets from the beginning of the result
942 * set (numbering starts from row 1) and negative numbers are row offsets
943 * from the end of the result set (numbering starts from -1).
945 * @param row The row to position the result set to.
947 * @return <code>true</code> if the current position was changed,
948 * <code>false</code> otherwise.
950 * @exception SQLException If an error occurs.
952 public abstract boolean
953 absolute(int row) throws SQLException;
955 /*************************************************************************/
958 * This method moves the result set position relative to the current row.
959 * The offset can be positive or negative.
961 * @param row The relative row position to move to.
963 * @return <code>true</code> if the current position was changed,
964 * <code>false</code> otherwise.
966 * @exception SQLException If an error occurs.
968 public abstract boolean
969 relative(int row) throws SQLException;
971 /*************************************************************************/
974 * This method provides a hint to the driver about which direction the
975 * result set will be processed in.
977 * @param direction The direction in which rows will be processed. (Values?)
979 * @exception SQLException If an error occurs.
981 public abstract void
982 setFetchDirection(int direction) throws SQLException;
984 /*************************************************************************/
987 * This method returns the current fetch direction for this result set.
989 * @return The fetch direction for this result set.
991 * @exception SQLException If an error occurs.
993 public abstract int
994 getFetchDirection() throws SQLException;
996 /*************************************************************************/
999 * This method provides a hint to the driver about how many rows at a
1000 * time it should fetch from the database.
1002 * @param rows The number of rows the driver should fetch per call.
1004 * @exception SQLException If an error occurs.
1006 public abstract void
1007 setFetchSize(int rows) throws SQLException;
1009 /*************************************************************************/
1012 * This method returns the current number of rows that will be fetched
1013 * from the database at a time.
1015 * @return The current fetch size for this result set.
1017 * @exception SQLException If an error occurs.
1019 public abstract int
1020 getFetchSize() throws SQLException;
1022 /*************************************************************************/
1025 * This method returns the result set type of this result set. This will
1026 * be one of the TYPE_* constants defined in this interface.
1028 * @return The result set type.
1030 * @exception SQLException If an error occurs.
1032 public abstract int
1033 getType() throws SQLException;
1035 /*************************************************************************/
1038 * This method returns the concurrency type of this result set. This will
1039 * be one of the CONCUR_* constants defined in this interface.
1041 * @return The result set concurrency type.
1043 * @exception SQLException If an error occurs.
1045 public abstract int
1046 getConcurrency() throws SQLException;
1048 /*************************************************************************/
1051 * This method tests whether or not the current row in the result set
1052 * has been updated. Updates must be visible in order of this method to
1053 * detect the update.
1055 * @return <code>true</code> if the row has been updated, <code>false</code>
1056 * otherwise.
1058 * @exception SQLException If an error occurs.
1060 public abstract boolean
1061 rowUpdated() throws SQLException;
1063 /*************************************************************************/
1066 * This method tests whether or not the current row in the result set
1067 * has been inserted. Inserts must be visible in order of this method to
1068 * detect the insert.
1070 * @return <code>true</code> if the row has been inserted, <code>false</code>
1071 * otherwise.
1073 * @exception SQLException If an error occurs.
1075 public abstract boolean
1076 rowInserted() throws SQLException;
1078 /*************************************************************************/
1081 * This method tests whether or not the current row in the result set
1082 * has been deleted. Deletes must be visible in order of this method to
1083 * detect the deletion.
1085 * @return <code>true</code> if the row has been deleted, <code>false</code>
1086 * otherwise.
1088 * @exception SQLException If an error occurs.
1090 public abstract boolean
1091 rowDeleted() throws SQLException;
1093 /*************************************************************************/
1096 * This method updates the specified column to have a NULL value. This
1097 * does not update the actual database. <code>updateRow</code> must be
1098 * called in order to do that.
1100 * @return index The index of the column to update.
1102 * @exception SQLException If an error occurs.
1104 public abstract void
1105 updateNull(int index) throws SQLException;
1107 /*************************************************************************/
1110 * This method updates the specified column to have a boolean value. This
1111 * does not update the actual database. <code>updateRow</code> must be
1112 * called in order to do that.
1114 * @param index The index of the column to update.
1115 * @param value The new value of the column.
1117 * @exception SQLException If an error occurs.
1119 public abstract void
1120 updateBoolean(int index, boolean value) throws SQLException;
1122 /*************************************************************************/
1125 * This method updates the specified column to have a byte value. This
1126 * does not update the actual database. <code>updateRow</code> must be
1127 * called in order to do that.
1129 * @param index The index of the column to update.
1130 * @param value The new value of the column.
1132 * @exception SQLException If an error occurs.
1134 public abstract void
1135 updateByte(int index, byte value) throws SQLException;
1137 /*************************************************************************/
1140 * This method updates the specified column to have a short value. This
1141 * does not update the actual database. <code>updateRow</code> must be
1142 * called in order to do that.
1144 * @param index The index of the column to update.
1145 * @param value The new value of the column.
1147 * @exception SQLException If an error occurs.
1149 public abstract void
1150 updateShort(int index, short value) throws SQLException;
1152 /*************************************************************************/
1155 * This method updates the specified column to have an int value. This
1156 * does not update the actual database. <code>updateRow</code> must be
1157 * called in order to do that.
1159 * @param index The index of the column to update.
1160 * @param value The new value of the column.
1162 * @exception SQLException If an error occurs.
1164 public abstract void
1165 updateInt(int index, int value) throws SQLException;
1167 /*************************************************************************/
1170 * This method updates the specified column to have a long value. This
1171 * does not update the actual database. <code>updateRow</code> must be
1172 * called in order to do that.
1174 * @param index The index of the column to update.
1175 * @param value The new value of the column.
1177 * @exception SQLException If an error occurs.
1179 public abstract void
1180 updateLong(int index, long value) throws SQLException;
1182 /*************************************************************************/
1185 * This method updates the specified column to have a float value. This
1186 * does not update the actual database. <code>updateRow</code> must be
1187 * called in order to do that.
1189 * @param index The index of the column to update.
1190 * @param value The new value of the column.
1192 * @exception SQLException If an error occurs.
1194 public abstract void
1195 updateFloat(int index, float value) throws SQLException;
1197 /*************************************************************************/
1200 * This method updates the specified column to have a double value. This
1201 * does not update the actual database. <code>updateRow</code> must be
1202 * called in order to do that.
1204 * @param index The index of the column to update.
1205 * @param value The new value of the column.
1207 * @exception SQLException If an error occurs.
1209 public abstract void
1210 updateDouble(int index, double value) throws SQLException;
1212 /*************************************************************************/
1215 * This method updates the specified column to have a BigDecimal value. This
1216 * does not update the actual database. <code>updateRow</code> must be
1217 * called in order to do that.
1219 * @param index The index of the column to update.
1220 * @param value The new value of the column.
1222 * @exception SQLException If an error occurs.
1224 public abstract void
1225 updateBigDecimal(int index, BigDecimal value) throws SQLException;
1227 /*************************************************************************/
1230 * This method updates the specified column to have a String value. This
1231 * does not update the actual database. <code>updateRow</code> must be
1232 * called in order to do that.
1234 * @param index The index of the column to update.
1235 * @param value The new value of the column.
1237 * @exception SQLException If an error occurs.
1239 public abstract void
1240 updateString(int index, String value) throws SQLException;
1242 /*************************************************************************/
1245 * This method updates the specified column to have a byte array value. This
1246 * does not update the actual database. <code>updateRow</code> must be
1247 * called in order to do that.
1249 * @param index The index of the column to update.
1250 * @param value The new value of the column.
1252 * @exception SQLException If an error occurs.
1254 public abstract void
1255 updateBytes(int index, byte[] value) throws SQLException;
1257 /*************************************************************************/
1260 * This method updates the specified column to have a java.sql.Date value. This
1261 * does not update the actual database. <code>updateRow</code> must be
1262 * called in order to do that.
1264 * @param index The index of the column to update.
1265 * @param value The new value of the column.
1267 * @exception SQLException If an error occurs.
1269 public abstract void
1270 updateDate(int index, java.sql.Date value) throws SQLException;
1272 /*************************************************************************/
1275 * This method updates the specified column to have a java.sql.Time value. This
1276 * does not update the actual database. <code>updateRow</code> must be
1277 * called in order to do that.
1279 * @param index The index of the column to update.
1280 * @param value The new value of the column.
1282 * @exception SQLException If an error occurs.
1284 public abstract void
1285 updateTime(int index, java.sql.Time value) throws SQLException;
1287 /*************************************************************************/
1290 * This method updates the specified column to have a java.sql.Timestamp value.
1291 * This does not update the actual database. <code>updateRow</code> must be
1292 * called in order to do that.
1294 * @param index The index of the column to update.
1295 * @param value The new value of the column.
1297 * @exception SQLException If an error occurs.
1299 public abstract void
1300 updateTimestamp(int index, java.sql.Timestamp value) throws SQLException;
1302 /*************************************************************************/
1305 * This method updates the specified column from an ASCII text stream.
1306 * This does not update the actual database. <code>updateRow</code> must be
1307 * called in order to do that.
1309 * @param index The index of the column to update.
1310 * @param value The new value of the column.
1311 * @param length The length of the stream.
1313 * @exception SQLException If an error occurs.
1315 public abstract void
1316 updateAsciiStream(int index, InputStream value, int length) throws SQLException;
1318 /*************************************************************************/
1321 * This method updates the specified column from a binary stream.
1322 * This does not update the actual database. <code>updateRow</code> must be
1323 * called in order to do that.
1325 * @param index The index of the column to update.
1326 * @param value The new value of the column.
1327 * @param length The length of the stream.
1329 * @exception SQLException If an error occurs.
1331 public abstract void
1332 updateBinaryStream(int index, InputStream value, int length)
1333 throws SQLException;
1335 /*************************************************************************/
1338 * This method updates the specified column from a character stream.
1339 * This does not update the actual database. <code>updateRow</code> must be
1340 * called in order to do that.
1342 * @param index The index of the column to update.
1343 * @param value The new value of the column.
1344 * @param length The length of the stream.
1346 * @exception SQLException If an error occurs.
1348 public abstract void
1349 updateCharacterStream(int index, Reader value, int length) throws SQLException;
1351 /*************************************************************************/
1354 * This method updates the specified column to have an Object value.
1355 * This does not update the actual database. <code>updateRow</code> must be
1356 * called in order to do that.
1358 * @param index The index of the column to update.
1359 * @param value The new value of the column.
1361 * @exception SQLException If an error occurs.
1363 public abstract void
1364 updateObject(int index, Object value) throws SQLException;
1366 /*************************************************************************/
1369 * This method updates the specified column to have an Object value.
1370 * This does not update the actual database. <code>updateRow</code> must be
1371 * called in order to do that.
1373 * @param index The index of the column to update.
1374 * @param value The new value of the column.
1375 * @param scale The scale of the object in question, which is used only
1376 * for numeric type objects.
1378 * @exception SQLException If an error occurs.
1380 public abstract void
1381 updateObject(int index, Object value, int scale) throws SQLException;
1383 /*************************************************************************/
1386 * This method updates the specified column to have a NULL value. This
1387 * does not update the actual database. <code>updateRow</code> must be
1388 * called in order to do that.
1390 * @return name The name of the column to update.
1392 * @exception SQLException If an error occurs.
1394 public abstract void
1395 updateNull(String name) throws SQLException;
1397 /*************************************************************************/
1400 * This method updates the specified column to have a boolean value. This
1401 * does not update the actual database. <code>updateRow</code> must be
1402 * called in order to do that.
1404 * @param name The name of the column to update.
1405 * @param value The new value of the column.
1407 * @exception SQLException If an error occurs.
1409 public abstract void
1410 updateBoolean(String name, boolean value) throws SQLException;
1412 /*************************************************************************/
1415 * This method updates the specified column to have a byte value. This
1416 * does not update the actual database. <code>updateRow</code> must be
1417 * called in order to do that.
1419 * @param name The name of the column to update.
1420 * @param value The new value of the column.
1422 * @exception SQLException If an error occurs.
1424 public abstract void
1425 updateByte(String name, byte value) throws SQLException;
1427 /*************************************************************************/
1430 * This method updates the specified column to have a short value. This
1431 * does not update the actual database. <code>updateRow</code> must be
1432 * called in order to do that.
1434 * @param name The name of the column to update.
1435 * @param value The new value of the column.
1437 * @exception SQLException If an error occurs.
1439 public abstract void
1440 updateShort(String name, short value) throws SQLException;
1442 /*************************************************************************/
1445 * This method updates the specified column to have an int value. This
1446 * does not update the actual database. <code>updateRow</code> must be
1447 * called in order to do that.
1449 * @param name The name of the column to update.
1450 * @param value The new value of the column.
1452 * @exception SQLException If an error occurs.
1454 public abstract void
1455 updateInt(String name, int value) throws SQLException;
1457 /*************************************************************************/
1460 * This method updates the specified column to have a long value. This
1461 * does not update the actual database. <code>updateRow</code> must be
1462 * called in order to do that.
1464 * @param name The name of the column to update.
1465 * @param value The new value of the column.
1467 * @exception SQLException If an error occurs.
1469 public abstract void
1470 updateLong(String name, long value) throws SQLException;
1472 /*************************************************************************/
1475 * This method updates the specified column to have a float value. This
1476 * does not update the actual database. <code>updateRow</code> must be
1477 * called in order to do that.
1479 * @param name The name of the column to update.
1480 * @param value The new value of the column.
1482 * @exception SQLException If an error occurs.
1484 public abstract void
1485 updateFloat(String name, float value) throws SQLException;
1487 /*************************************************************************/
1490 * This method updates the specified column to have a double value. This
1491 * does not update the actual database. <code>updateRow</code> must be
1492 * called in order to do that.
1494 * @param name The name of the column to update.
1495 * @param value The new value of the column.
1497 * @exception SQLException If an error occurs.
1499 public abstract void
1500 updateDouble(String name, double value) throws SQLException;
1502 /*************************************************************************/
1505 * This method updates the specified column to have a BigDecimal value. This
1506 * does not update the actual database. <code>updateRow</code> must be
1507 * called in order to do that.
1509 * @param name The name of the column to update.
1510 * @param value The new value of the column.
1512 * @exception SQLException If an error occurs.
1514 public abstract void
1515 updateBigDecimal(String name, BigDecimal value) throws SQLException;
1517 /*************************************************************************/
1520 * This method updates the specified column to have a String value. This
1521 * does not update the actual database. <code>updateRow</code> must be
1522 * called in order to do that.
1524 * @param name The name of the column to update.
1525 * @param value The new value of the column.
1527 * @exception SQLException If an error occurs.
1529 public abstract void
1530 updateString(String name, String value) throws SQLException;
1532 /*************************************************************************/
1535 * This method updates the specified column to have a byte array value. This
1536 * does not update the actual database. <code>updateRow</code> must be
1537 * called in order to do that.
1539 * @param name The name of the column to update.
1540 * @param value The new value of the column.
1542 * @exception SQLException If an error occurs.
1544 public abstract void
1545 updateBytes(String name, byte[] value) throws SQLException;
1547 /*************************************************************************/
1550 * This method updates the specified column to have a java.sql.Date value. This
1551 * does not update the actual database. <code>updateRow</code> must be
1552 * called in order to do that.
1554 * @param name The name of the column to update.
1555 * @param value The new value of the column.
1557 * @exception SQLException If an error occurs.
1559 public abstract void
1560 updateDate(String name, java.sql.Date value) throws SQLException;
1562 /*************************************************************************/
1565 * This method updates the specified column to have a java.sql.Time value. This
1566 * does not update the actual database. <code>updateRow</code> must be
1567 * called in order to do that.
1569 * @param name The name of the column to update.
1570 * @param value The new value of the column.
1572 * @exception SQLException If an error occurs.
1574 public abstract void
1575 updateTime(String name, java.sql.Time value) throws SQLException;
1577 /*************************************************************************/
1580 * This method updates the specified column to have a java.sql.Timestamp value.
1581 * This does not update the actual database. <code>updateRow</code> must be
1582 * called in order to do that.
1584 * @param name The name of the column to update.
1585 * @param value The new value of the column.
1587 * @exception SQLException If an error occurs.
1589 public abstract void
1590 updateTimestamp(String name, java.sql.Timestamp value) throws SQLException;
1592 /*************************************************************************/
1595 * This method updates the specified column from an ASCII text stream.
1596 * This does not update the actual database. <code>updateRow</code> must be
1597 * called in order to do that.
1599 * @param name The name of the column to update.
1600 * @param value The new value of the column.
1601 * @param length The length of the stream.
1603 * @exception SQLException If an error occurs.
1605 public abstract void
1606 updateAsciiStream(String name, InputStream value, int length) throws SQLException;
1608 /*************************************************************************/
1611 * This method updates the specified column from a binary stream.
1612 * This does not update the actual database. <code>updateRow</code> must be
1613 * called in order to do that.
1615 * @param name The name of the column to update.
1616 * @param value The new value of the column.
1617 * @param length The length of the stream.
1619 * @exception SQLException If an error occurs.
1621 public abstract void
1622 updateBinaryStream(String name, InputStream value, int length)
1623 throws SQLException;
1625 /*************************************************************************/
1628 * This method updates the specified column from a character stream.
1629 * This does not update the actual database. <code>updateRow</code> must be
1630 * called in order to do that.
1632 * @param name The name of the column to update.
1633 * @param value The new value of the column.
1634 * @param length The length of the stream.
1636 * @exception SQLException If an error occurs.
1638 public abstract void
1639 updateCharacterStream(String name, Reader value, int length) throws SQLException;
1641 /*************************************************************************/
1644 * This method updates the specified column to have an Object value.
1645 * This does not update the actual database. <code>updateRow</code> must be
1646 * called in order to do that.
1648 * @param name The name of the column to update.
1649 * @param value The new value of the column.
1651 * @exception SQLException If an error occurs.
1653 public abstract void
1654 updateObject(String name, Object value) throws SQLException;
1656 /*************************************************************************/
1659 * This method updates the specified column to have an Object value.
1660 * This does not update the actual database. <code>updateRow</code> must be
1661 * called in order to do that.
1663 * @param name The name of the column to update.
1664 * @param value The new value of the column.
1665 * @param scale The scale of the object in question, which is used only
1666 * for numeric type objects.
1668 * @exception SQLException If an error occurs.
1670 public abstract void
1671 updateObject(String name, Object value, int scale) throws SQLException;
1673 /*************************************************************************/
1676 * This method inserts the current row into the database. The result set
1677 * must be positioned on the insert row in order to call this method
1678 * successfully.
1680 * @exception SQLException If an error occurs.
1682 public abstract void
1683 insertRow() throws SQLException;
1685 /*************************************************************************/
1688 * This method updates the current row in the database.
1690 * @exception SQLException If an error occurs.
1692 public abstract void
1693 updateRow() throws SQLException;
1695 /*************************************************************************/
1698 * This method deletes the current row in the database.
1700 * @exception SQLException If an error occurs.
1702 public abstract void
1703 deleteRow() throws SQLException;
1705 /*************************************************************************/
1708 * This method refreshes the contents of the current row from the database.
1710 * @exception SQLException If an error occurs.
1712 public abstract void
1713 refreshRow() throws SQLException;
1715 /*************************************************************************/
1718 * This method cancels any changes that have been made to a row. If
1719 * the <code>rowUpdate</code> method has been called, then the changes
1720 * cannot be undone.
1722 * @exception SQLException If an error occurs.
1724 public abstract void
1725 cancelRowUpdates() throws SQLException;
1727 /*************************************************************************/
1730 * This method positions the result set to the "insert row", which allows
1731 * a new row to be inserted into the database from the result set.
1733 * @exception SQLException If an error occurs.
1735 public abstract void
1736 moveToInsertRow() throws SQLException;
1738 /*************************************************************************/
1741 * This method moves the result set position from the insert row back to
1742 * the current row that was selected prior to moving to the insert row.
1744 * @exception SQLException If an error occurs.
1746 public abstract void
1747 moveToCurrentRow() throws SQLException;
1749 /*************************************************************************/
1752 * This method returns a the <code>Statement</code> that was used to
1753 * produce this result set.
1755 * @return The <code>Statement</code> used to produce this result set.
1757 * @exception SQLException If an error occurs.
1759 public abstract Statement
1760 getStatement() throws SQLException;
1762 /*************************************************************************/
1765 * This method returns the value of the specified column as a Java
1766 * <code>Object</code> using the specified SQL type to Java type map.
1768 * @param index The index of the column to return.
1769 * @param map The SQL type to Java type map to use.
1771 * @return The value of the column as an <code>Object</code>.
1773 * @exception SQLException If an error occurs.
1775 public abstract Object
1776 getObject(int index, Map map) throws SQLException;
1778 /*************************************************************************/
1781 * This method returns a <code>Ref</code> for the specified column which
1782 * represents the structured type for the column.
1784 * @param index The index of the column to return.
1786 * @return A <code>Ref</code> object for the column
1788 * @exception SQLException If an error occurs.
1790 public Ref
1791 getRef(int index) throws SQLException;
1793 /*************************************************************************/
1796 * This method returns the specified column value as a BLOB.
1798 * @param index The index of the column value to return.
1800 * @return The value of the column as a BLOB.
1802 * @exception SQLException If an error occurs.
1804 public abstract Blob
1805 getBlob(int index) throws SQLException;
1807 /*************************************************************************/
1810 * This method returns the specified column value as a CLOB.
1812 * @param index The index of the column value to return.
1814 * @return The value of the column as a CLOB.
1816 * @exception SQLException If an error occurs.
1818 public abstract Clob
1819 getClob(int index) throws SQLException;
1821 /*************************************************************************/
1824 * This method returns the specified column value as an <code>Array</code>.
1826 * @param index The index of the column value to return.
1828 * @return The value of the column as an <code>Array</code>.
1830 * @exception SQLException If an error occurs.
1832 public abstract Array
1833 getArray(int index) throws SQLException;
1835 /*************************************************************************/
1838 * This method returns the value of the specified column as a Java
1839 * <code>Object</code> using the specified SQL type to Java type map.
1841 * @param name The name of the column to return.
1842 * @param map The SQL type to Java type map to use.
1844 * @return The value of the column as an <code>Object</code>.
1846 * @exception SQLException If an error occurs.
1848 public abstract Object
1849 getObject(String name, Map map) throws SQLException;
1851 /*************************************************************************/
1854 * This method returns a <code>Ref</code> for the specified column which
1855 * represents the structured type for the column.
1857 * @param index The index of the column to return.
1859 * @return A <code>Ref</code> object for the column
1861 * @exception SQLException If an error occurs.
1863 public Ref
1864 getRef(String name) throws SQLException;
1866 /*************************************************************************/
1869 * This method returns the specified column value as a BLOB.
1871 * @param name The name of the column value to return.
1873 * @return The value of the column as a BLOB.
1875 * @exception SQLException If an error occurs.
1877 public abstract Blob
1878 getBlob(String name) throws SQLException;
1880 /*************************************************************************/
1883 * This method returns the specified column value as a CLOB.
1885 * @param name The name of the column value to return.
1887 * @return The value of the column as a CLOB.
1889 * @exception SQLException If an error occurs.
1891 public abstract Clob
1892 getClob(String name) throws SQLException;
1894 /*************************************************************************/
1897 * This method returns the specified column value as an <code>Array</code>.
1899 * @param name The name of the column value to return.
1901 * @return The value of the column as an <code>Array</code>.
1903 * @exception SQLException If an error occurs.
1905 public abstract Array
1906 getArray(String name) throws SQLException;
1908 /*************************************************************************/
1911 * This method returns the specified column value as a
1912 * <code>java.sql.Date</code>. The specified <code>Calendar</code> is used
1913 * to generate a value for the date if the database does not support
1914 * timezones.
1916 * @param index The index of the column value to return.
1917 * @param cal The <code>Calendar</code> to use for calculating timezones.
1919 * @return The value of the column as a <code>java.sql.Date</code>.
1921 * @exception SQLException If an error occurs.
1923 public abstract java.sql.Date
1924 getDate(int index, Calendar cal) throws SQLException;
1926 /*************************************************************************/
1929 * This method returns the specified column value as a
1930 * <code>java.sql.Time</code>. The specified <code>Calendar</code> is used
1931 * to generate a value for the time if the database does not support
1932 * timezones.
1934 * @param index The index of the column value to return.
1935 * @param cal The <code>Calendar</code> to use for calculating timezones.
1937 * @return The value of the column as a <code>java.sql.Time</code>.
1939 * @exception SQLException If an error occurs.
1941 public abstract java.sql.Time
1942 getTime(int index, Calendar cal) throws SQLException;
1944 /*************************************************************************/
1947 * This method returns the specified column value as a
1948 * <code>java.sql.Timestamp</code>. The specified <code>Calendar</code> is used
1949 * to generate a value for the timestamp if the database does not support
1950 * timezones.
1952 * @param index The index of the column value to return.
1953 * @param cal The <code>Calendar</code> to use for calculating timezones.
1955 * @return The value of the column as a <code>java.sql.Timestamp</code>.
1957 * @exception SQLException If an error occurs.
1959 public abstract java.sql.Timestamp
1960 getTimestamp(int index, Calendar cal) throws SQLException;
1962 /*************************************************************************/
1965 * This method returns the specified column value as a
1966 * <code>java.sql.Date</code>. The specified <code>Calendar</code> is used
1967 * to generate a value for the date if the database does not support
1968 * timezones.
1970 * @param name The name of the column value to return.
1971 * @param cal The <code>Calendar</code> to use for calculating timezones.
1973 * @return The value of the column as a <code>java.sql.Date</code>.
1975 * @exception SQLException If an error occurs.
1977 public abstract java.sql.Date
1978 getDate(String name, Calendar cal) throws SQLException;
1980 /*************************************************************************/
1983 * This method returns the specified column value as a
1984 * <code>java.sql.Time</code>. The specified <code>Calendar</code> is used
1985 * to generate a value for the time if the database does not support
1986 * timezones.
1988 * @param name The name of the column value to return.
1989 * @param cal The <code>Calendar</code> to use for calculating timezones.
1991 * @return The value of the column as a <code>java.sql.Time</code>.
1993 * @exception SQLException If an error occurs.
1995 public abstract java.sql.Time
1996 getTime(String name, Calendar cal) throws SQLException;
1998 /*************************************************************************/
2001 * This method returns the specified column value as a
2002 * <code>java.sql.Timestamp</code>. The specified <code>Calendar</code> is used
2003 * to generate a value for the timestamp if the database does not support
2004 * timezones.
2006 * @param name The name of the column value to return.
2007 * @param cal The <code>Calendar</code> to use for calculating timezones.
2009 * @return The value of the column as a <code>java.sql.Timestamp</code>.
2011 * @exception SQLException If an error occurs.
2013 public abstract java.sql.Timestamp
2014 getTimestamp(String name, Calendar cal) throws SQLException;
2016 } // interface ResultSet