Import GNU Classpath (20121202).
[official-gcc.git] / libjava / classpath / java / sql / ResultSet.java
blobc487bed6b944420234fc626d2e4e5b1dab11d875
1 /* ResultSet.java -- A SQL statement result set.
2 Copyright (C) 1999, 2000, 2002, 2006 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., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 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>.
53 * <p> 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.</p>
57 * <p> Note that a result set is invalidated if the statement that returned
58 * it is closed.</p>
60 * @author Aaron M. Renn (arenn@urbanophile.com)
62 public interface ResultSet
63 extends AutoCloseable
65 /**
66 * The rows will be processed in order from first to last.
68 int FETCH_FORWARD = 1000;
70 /**
71 * The rows will be processed in order from last to first.
73 int FETCH_REVERSE = 1001;
75 /**
76 * The rows will be processed in an unknown order
78 int FETCH_UNKNOWN = 1002;
80 /**
81 * This type of result set may only step forward through the rows returned.
83 int TYPE_FORWARD_ONLY = 1003;
85 /**
86 * This type of result set is scrollable and is not sensitive to changes
87 * made by other statements.
89 int TYPE_SCROLL_INSENSITIVE = 1004;
91 /**
92 * This type of result set is scrollable and is also sensitive to changes
93 * made by other statements.
95 int TYPE_SCROLL_SENSITIVE = 1005;
97 /**
98 * The concurrency mode of for the result set may not be modified.
100 int CONCUR_READ_ONLY = 1007;
103 * The concurrency mode of for the result set may be modified.
105 int CONCUR_UPDATABLE = 1008;
107 int HOLD_CURSORS_OVER_COMMIT = 1;
109 int CLOSE_CURSORS_AT_COMMIT = 2;
112 * This method advances to the next row in the result set. Any streams
113 * open on the current row are closed automatically.
115 * @return <code>true</code> if the next row exists, <code>false</code>
116 * otherwise.
117 * @exception SQLException If an error occurs.
119 boolean next() throws SQLException;
122 * This method closes the result set and frees any associated resources.
124 * @exception SQLException If an error occurs.
126 void close() throws SQLException;
129 * This method tests whether the value of the last column that was fetched
130 * was actually a SQL NULL value.
132 * @return <code>true</code> if the last column fetched was a NULL,
133 * <code>false</code> otherwise.
134 * @exception SQLException If an error occurs.
136 boolean wasNull() throws SQLException;
139 * This method returns the value of the specified column as a Java
140 * <code>String</code>.
142 * @param columnIndex The index of the column to return.
143 * @return The column value as a <code>String</code>.
144 * @exception SQLException If an error occurs.
146 String getString(int columnIndex) throws SQLException;
149 * This method returns the value of the specified column as a Java
150 * <code>boolean</code>.
152 * @param columnIndex The index of the column to return.
153 * @return The column value as a <code>boolean</code>.
154 * @exception SQLException If an error occurs.
156 boolean getBoolean(int columnIndex) throws SQLException;
159 * This method returns the value of the specified column as a Java
160 * <code>byte</code>.
162 * @param columnIndex The index of the column to return.
163 * @return The column value as a <code>byte</code>.
164 * @exception SQLException If an error occurs.
166 byte getByte(int columnIndex) throws SQLException;
169 * This method returns the value of the specified column as a Java
170 * <code>short</code>.
172 * @param columnIndex The index of the column to return.
173 * @return The column value as a <code>short</code>.
174 * @exception SQLException If an error occurs.
176 short getShort(int columnIndex) throws SQLException;
179 * This method returns the value of the specified column as a Java
180 * <code>int</code>.
182 * @param columnIndex The index of the column to return.
183 * @return The column value as a <code>int</code>.
184 * @exception SQLException If an error occurs.
186 int getInt(int columnIndex) throws SQLException;
189 * This method returns the value of the specified column as a Java
190 * <code>long</code>.
192 * @param columnIndex The index of the column to return.
193 * @return The column value as a <code>long</code>.
194 * @exception SQLException If an error occurs.
196 long getLong(int columnIndex) throws SQLException;
199 * This method returns the value of the specified column as a Java
200 * <code>float</code>.
202 * @param columnIndex The index of the column to return.
203 * @return The column value as a <code>float</code>.
204 * @exception SQLException If an error occurs.
206 float getFloat(int columnIndex) throws SQLException;
209 * This method returns the value of the specified column as a Java
210 * <code>double</code>.
212 * @param columnIndex The index of the column to return.
213 * @return The column value as a <code>double</code>.
214 * @exception SQLException If an error occurs.
216 double getDouble(int columnIndex) throws SQLException;
219 * This method returns the value of the specified column as a Java
220 * <code>BigDecimal</code>.
222 * @param columnIndex The index of the column to return.
223 * @param scale The number of digits to the right of the decimal to return.
224 * @return The column value as a <code>BigDecimal</code>.
225 * @exception SQLException If an error occurs.
226 * @deprecated
228 BigDecimal getBigDecimal(int columnIndex, int scale)
229 throws SQLException;
232 * This method returns the value of the specified column as a Java
233 * byte array.
235 * @param columnIndex The index of the column to return.
236 * @return The column value as a byte array
237 * @exception SQLException If an error occurs.
239 byte[] getBytes(int columnIndex) throws SQLException;
242 * This method returns the value of the specified column as a Java
243 * <code>java.sql.Date</code>.
245 * @param columnIndex The index of the column to return.
246 * @return The column value as a <code>java.sql.Date</code>.
247 * @exception SQLException If an error occurs.
249 Date getDate(int columnIndex) throws SQLException;
252 * This method returns the value of the specified column as a Java
253 * <code>java.sql.Time</code>.
255 * @param columnIndex The index of the column to return.
256 * @return The column value as a <code>java.sql.Time</code>.
257 * @exception SQLException If an error occurs.
259 Time getTime(int columnIndex) throws SQLException;
262 * This method returns the value of the specified column as a Java
263 * <code>java.sql.Timestamp</code>.
265 * @param columnIndex The index of the column to return.
266 * @return The column value as a <code>java.sql.Timestamp</code>.
267 * @exception SQLException If an error occurs.
269 Timestamp getTimestamp(int columnIndex) throws SQLException;
272 * This method returns the value of the specified column as an ASCII
273 * stream. Note that all the data from this stream must be read before
274 * fetching the value of any other column. Please also be aware that
275 * calling <code>next()</code> or <code>close()</code> on this result set
276 * will close this stream as well.
278 * @param columnIndex The index of the column to return.
279 * @return The column value as an ASCII <code>InputStream</code>.
280 * @exception SQLException If an error occurs.
282 InputStream getAsciiStream(int columnIndex) throws SQLException;
285 * This method returns the value of the specified column as a Unicode UTF-8
286 * stream. Note that all the data from this stream must be read before
287 * fetching the value of any other column. Please also be aware that
288 * calling <code>next()</code> or <code>close()</code> on this result set
289 * will close this stream as well.
291 * @param columnIndex The index of the column to return.
292 * @return The column value as a Unicode UTF-8 <code>InputStream</code>.
293 * @exception SQLException If an error occurs.
294 * @deprecated Use getCharacterStream instead.
296 InputStream getUnicodeStream(int columnIndex) throws SQLException;
299 * This method returns the value of the specified column as a raw byte
300 * stream. Note that all the data from this stream must be read before
301 * fetching the value of any other column. Please also be aware that
302 * calling <code>next()</code> or <code>close()</code> on this result set
303 * will close this stream as well.
305 * @param columnIndex The index of the column to return.
306 * @return The column value as a raw byte <code>InputStream</code>.
307 * @exception SQLException If an error occurs.
309 InputStream getBinaryStream(int columnIndex) throws SQLException;
312 * This method returns the value of the specified column as a Java
313 * <code>String</code>.
315 * @param columnName The name of the column to return.
316 * @return The column value as a <code>String</code>.
317 * @exception SQLException If an error occurs.
319 String getString(String columnName) throws SQLException;
322 * This method returns the value of the specified column as a Java
323 * <code>boolean</code>.
325 * @param columnName The name of the column to return.
326 * @return The column value as a <code>boolean</code>.
327 * @exception SQLException If an error occurs.
329 boolean getBoolean(String columnName) throws SQLException;
332 * This method returns the value of the specified column as a Java
333 * <code>byte</code>.
335 * @param columnName The name of the column to return.
336 * @return The column value as a <code>byte</code>.
337 * @exception SQLException If an error occurs.
339 byte getByte(String columnName) throws SQLException;
342 * This method returns the value of the specified column as a Java
343 * <code>short</code>.
345 * @param columnName The name of the column to return.
346 * @return The column value as a <code>short</code>.
347 * @exception SQLException If an error occurs.
349 short getShort(String columnName) throws SQLException;
352 * This method returns the value of the specified column as a Java
353 * <code>int</code>.
355 * @param columnName The name of the column to return.
356 * @return The column value as a <code>int</code>.
357 * @exception SQLException If an error occurs.
359 int getInt(String columnName) throws SQLException;
362 * This method returns the value of the specified column as a Java
363 * <code>long</code>.
365 * @param columnName The name of the column to return.
366 * @return The column value as a <code>long</code>.
367 * @exception SQLException If an error occurs.
369 long getLong(String columnName) throws SQLException;
372 * This method returns the value of the specified column as a Java
373 * <code>float</code>.
375 * @param columnName The name of the column to return.
376 * @return The column value as a <code>float</code>.
377 * @exception SQLException If an error occurs.
379 float getFloat(String columnName) throws SQLException;
382 * This method returns the value of the specified column as a Java
383 * <code>double</code>.
385 * @param columnName The name of the column to return.
386 * @return The column value as a <code>double</code>.
387 * @exception SQLException If an error occurs.
389 double getDouble(String columnName) throws SQLException;
392 * This method returns the value of the specified column as a Java
393 * <code>BigDecimal</code>.
395 * @param columnName The name of the column to return.
396 * @return The column value as a <code>BigDecimal</code>.
397 * @exception SQLException If an error occurs.
398 * @deprecated
400 BigDecimal getBigDecimal(String columnName, int scale)
401 throws SQLException;
404 * This method returns the value of the specified column as a Java
405 * byte array.
407 * @param columnName The name of the column to return.
408 * @return The column value as a byte array
409 * @exception SQLException If an error occurs.
411 byte[] getBytes(String columnName) throws SQLException;
414 * This method returns the value of the specified column as a Java
415 * <code>java.sql.Date</code>.
417 * @param columnName The name of the column to return.
418 * @return The column value as a <code>java.sql.Date</code>.
419 * @exception SQLException If an error occurs.
421 Date getDate(String columnName) throws SQLException;
424 * This method returns the value of the specified column as a Java
425 * <code>java.sql.Time</code>.
427 * @param columnName The name of the column to return.
428 * @return The column value as a <code>java.sql.Time</code>.
429 * @exception SQLException If an error occurs.
431 Time getTime(String columnName) throws SQLException;
434 * This method returns the value of the specified column as a Java
435 * <code>java.sql.Timestamp</code>.
437 * @param columnName The name of the column to return.
438 * @return The column value as a <code>java.sql.Timestamp</code>.
439 * @exception SQLException If an error occurs.
441 Timestamp getTimestamp(String columnName) throws SQLException;
444 * This method returns the value of the specified column as an ASCII
445 * stream. Note that all the data from this stream must be read before
446 * fetching the value of any other column. Please also be aware that
447 * calling <code>next()</code> or <code>close()</code> on this result set
448 * will close this stream as well.
450 * @param columnName The name of the column to return.
451 * @return The column value as an ASCII <code>InputStream</code>.
452 * @exception SQLException If an error occurs.
454 InputStream getAsciiStream(String columnName) throws SQLException;
457 * This method returns the value of the specified column as a Unicode UTF-8
458 * stream. Note that all the data from this stream must be read before
459 * fetching the value of any other column. Please also be aware that
460 * calling <code>next()</code> or <code>close()</code> on this result set
461 * will close this stream as well.
463 * @param columnName The name of the column to return.
464 * @return The column value as a Unicode UTF-8 <code>InputStream</code>.
465 * @exception SQLException If an error occurs.
466 * @deprecated Use getCharacterStream instead.
468 InputStream getUnicodeStream(String columnName) throws SQLException;
471 * This method returns the value of the specified column as a raw byte
472 * stream. Note that all the data from this stream must be read before
473 * fetching the value of any other column. Please also be aware that
474 * calling <code>next()</code> or <code>close()</code> on this result set
475 * will close this stream as well.
477 * @param columnName The name of the column to return.
478 * @return The column value as a raw byte <code>InputStream</code>.
479 * @exception SQLException If an error occurs.
481 InputStream getBinaryStream(String columnName) throws SQLException;
484 * This method returns the first SQL warning associated with this result
485 * set. Any additional warnings will be chained to this one.
487 * @return The first SQLWarning for this result set, or <code>null</code> if
488 * there are no warnings.
489 * @exception SQLException If an error occurs.
491 SQLWarning getWarnings() throws SQLException;
494 * This method clears all warnings associated with this result set.
496 * @exception SQLException If an error occurs.
498 void clearWarnings() throws SQLException;
501 * This method returns the name of the database cursor used by this
502 * result set.
504 * @return The name of the database cursor used by this result set.
505 * @exception SQLException If an error occurs.
507 String getCursorName() throws SQLException;
510 * This method returns data about the columns returned as part of the
511 * result set as a <code>ResultSetMetaData</code> instance.
513 * @return The <code>ResultSetMetaData</code> instance for this result set.
514 * @exception SQLException If an error occurs.
516 ResultSetMetaData getMetaData() throws SQLException;
519 * This method returns the value of the specified column as a Java
520 * <code>Object</code>.
522 * @param columnIndex The index of the column to return.
523 * @return The column value as an <code>Object</code>.
524 * @exception SQLException If an error occurs.
526 Object getObject(int columnIndex) throws SQLException;
529 * This method returns the value of the specified column as a Java
530 * <code>Object</code>.
532 * @param columnName The name of the column to return.
533 * @return The column value as an <code>Object</code>.
534 * @exception SQLException If an error occurs.
536 Object getObject(String columnName) throws SQLException;
539 * This method returns the column index of the specified named column.
541 * @param columnName The name of the column.
542 * @return The index of the column.
543 * @exception SQLException If an error occurs.
545 int findColumn(String columnName) throws SQLException;
548 * This method returns the value of the specified column as a character
549 * stream. Note that all the data from this stream must be read before
550 * fetching the value of any other column. Please also be aware that
551 * calling <code>next()</code> or <code>close()</code> on this result set
552 * will close this stream as well.
554 * @param columnIndex The index of the column to return.
555 * @return The column value as an character <code>Reader</code>.
556 * @exception SQLException If an error occurs.
558 Reader getCharacterStream(int columnIndex) throws SQLException;
561 * This method returns the value of the specified column as a character
562 * stream. Note that all the data from this stream must be read before
563 * fetching the value of any other column. Please also be aware that
564 * calling <code>next()</code> or <code>close()</code> on this result set
565 * will close this stream as well.
567 * @param columnName The name of the column to return.
568 * @return The column value as an character <code>Reader</code>.
569 * @exception SQLException If an error occurs.
571 Reader getCharacterStream(String columnName) throws SQLException;
574 * This method returns the value of the specified column as a Java
575 * <code>BigDecimal</code>.
577 * @param columnIndex The index of the column to return.
578 * @return The column value as a <code>BigDecimal</code>.
579 * @exception SQLException If an error occurs.
581 BigDecimal getBigDecimal(int columnIndex) throws SQLException;
584 * This method returns the value of the specified column as a Java
585 * <code>BigDecimal</code>.
587 * @param columnName The name of the column to return.
588 * @return The column value as a <code>BigDecimal</code>.
589 * @exception SQLException If an error occurs.
591 BigDecimal getBigDecimal(String columnName) throws SQLException;
594 * This method tests whether or not the cursor is before the first row
595 * in the result set.
597 * @return <code>true</code> if the cursor is positioned before the first
598 * row, <code>false</code> otherwise.
599 * @exception SQLException If an error occurs.
601 boolean isBeforeFirst() throws SQLException;
604 * This method tests whether or not the cursor is after the last row
605 * in the result set.
607 * @return <code>true</code> if the cursor is positioned after the last
608 * row, <code>false</code> otherwise.
609 * @exception SQLException If an error occurs.
611 boolean isAfterLast() throws SQLException;
614 * This method tests whether or not the cursor is positioned on the first
615 * row in the result set.
617 * @return <code>true</code> if the cursor is positioned on the first
618 * row, <code>false</code> otherwise.
619 * @exception SQLException If an error occurs.
621 boolean isFirst() throws SQLException;
624 * This method tests whether or not the cursor is on the last row
625 * in the result set.
627 * @return <code>true</code> if the cursor is positioned on the last
628 * row, <code>false</code> otherwise.
629 * @exception SQLException If an error occurs.
631 boolean isLast() throws SQLException;
634 * This method repositions the cursor to before the first row in the
635 * result set.
637 * @exception SQLException If an error occurs.
639 void beforeFirst() throws SQLException;
642 * This method repositions the cursor to after the last row in the result
643 * set.
645 * @exception SQLException If an error occurs.
647 void afterLast() throws SQLException;
650 * This method repositions the cursor on the first row in the
651 * result set.
653 * @return <code>true</code> if the cursor is on a valid row;
654 * <code>false</code> if there are no rows in the result set.
655 * @exception SQLException If an error occurs.
657 boolean first() throws SQLException;
660 * This method repositions the cursor on the last row in the result
661 * set.
663 * @return <code>true</code> if the cursor is on a valid row;
664 * <code>false</code> if there are no rows in the result set.
665 * @exception SQLException If an error occurs.
667 boolean last() throws SQLException;
670 * This method returns the current row number in the cursor. Numbering
671 * begins at index 1.
673 * @return The current row number, or 0 if there is not current row.
674 * @exception SQLException If an error occurs.
676 int getRow() throws SQLException;
679 * This method positions the result set to the specified absolute row.
680 * Positive numbers are row offsets from the beginning of the result
681 * set (numbering starts from row 1) and negative numbers are row offsets
682 * from the end of the result set (numbering starts from -1).
684 * @param row The row to position the result set to.
686 * @return <code>true</code> if the current position was changed,
687 * <code>false</code> otherwise.
688 * @exception SQLException If an error occurs.
690 boolean absolute(int row) throws SQLException;
693 * This method moves the result set position relative to the current row.
694 * The offset can be positive or negative.
696 * @param rows The number of row positions to move.
697 * @return <code>true</code> if the current position was changed,
698 * <code>false</code> otherwise.
699 * @exception SQLException If an error occurs.
701 boolean relative(int rows) throws SQLException;
704 * This method moves the current position to the previous row in the
705 * result set.
707 * @return <code>true</code> if the previous row exists, <code>false</code>
708 * otherwise.
709 * @exception SQLException If an error occurs.
711 boolean previous() throws SQLException;
714 * This method provides a hint to the driver about which direction the
715 * result set will be processed in.
717 * @param direction The direction in which rows will be processed. The
718 * allowed values are the <code>FETCH_*</code> constants
719 * defined in this interface.
720 * @exception SQLException If an error occurs.
722 void setFetchDirection(int direction) throws SQLException;
725 * This method returns the current fetch direction for this result set.
727 * @return The fetch direction for this result set.
728 * @exception SQLException If an error occurs.
730 int getFetchDirection() throws SQLException;
733 * This method provides a hint to the driver about how many rows at a
734 * time it should fetch from the database.
736 * @param rows The number of rows the driver should fetch per call.
737 * @exception SQLException If an error occurs.
739 void setFetchSize(int rows) throws SQLException;
742 * This method returns the current number of rows that will be fetched
743 * from the database at a time.
745 * @return The current fetch size for this result set.
746 * @exception SQLException If an error occurs.
748 int getFetchSize() throws SQLException;
751 * This method returns the result set type of this result set. This will
752 * be one of the <code>TYPE_*</code> constants defined in this interface.
754 * @return The result set type.
755 * @exception SQLException If an error occurs.
757 int getType() throws SQLException;
760 * This method returns the concurrency type of this result set. This will
761 * be one of the <code>CONCUR_*</code> constants defined in this interface.
763 * @return The result set concurrency type.
764 * @exception SQLException If an error occurs.
766 int getConcurrency() throws SQLException;
769 * This method tests whether or not the current row in the result set
770 * has been updated. Updates must be visible in order of this method to
771 * detect the update.
773 * @return <code>true</code> if the row has been updated, <code>false</code>
774 * otherwise.
775 * @exception SQLException If an error occurs.
777 boolean rowUpdated() throws SQLException;
780 * This method tests whether or not the current row in the result set
781 * has been inserted. Inserts must be visible in order of this method to
782 * detect the insert.
784 * @return <code>true</code> if the row has been inserted, <code>false</code>
785 * otherwise.
786 * @exception SQLException If an error occurs.
788 boolean rowInserted() throws SQLException;
791 * This method tests whether or not the current row in the result set
792 * has been deleted. Deletes must be visible in order of this method to
793 * detect the deletion.
795 * @return <code>true</code> if the row has been deleted, <code>false</code>
796 * otherwise.
797 * @exception SQLException If an error occurs.
799 boolean rowDeleted() throws SQLException;
802 * This method updates the specified column to have a NULL value. This
803 * does not update the actual database. <code>updateRow</code> must be
804 * called in order to do that.
806 * @param columnIndex The index of the column to update.
807 * @exception SQLException If an error occurs.
809 void updateNull(int columnIndex) throws SQLException;
812 * This method updates the specified column to have a boolean value. This
813 * does not update the actual database. <code>updateRow</code> must be
814 * called in order to do that.
816 * @param columnIndex The index of the column to update.
817 * @param value The new value of the column.
818 * @exception SQLException If an error occurs.
820 void updateBoolean(int columnIndex, boolean value) throws SQLException;
823 * This method updates the specified column to have a byte value. This
824 * does not update the actual database. <code>updateRow</code> must be
825 * called in order to do that.
827 * @param columnIndex The index of the column to update.
828 * @param value The new value of the column.
829 * @exception SQLException If an error occurs.
831 void updateByte(int columnIndex, byte value) throws SQLException;
834 * This method updates the specified column to have a short value. This
835 * does not update the actual database. <code>updateRow</code> must be
836 * called in order to do that.
838 * @param columnIndex The index of the column to update.
839 * @param value The new value of the column.
840 * @exception SQLException If an error occurs.
842 void updateShort(int columnIndex, short value) throws SQLException;
845 * This method updates the specified column to have an int value. This
846 * does not update the actual database. <code>updateRow</code> must be
847 * called in order to do that.
849 * @param columnIndex The index of the column to update.
850 * @param value The new value of the column.
851 * @exception SQLException If an error occurs.
853 void updateInt(int columnIndex, int value) throws SQLException;
856 * This method updates the specified column to have a long value. This
857 * does not update the actual database. <code>updateRow</code> must be
858 * called in order to do that.
860 * @param columnIndex The index of the column to update.
861 * @param value The new value of the column.
862 * @exception SQLException If an error occurs.
864 void updateLong(int columnIndex, long value) throws SQLException;
867 * This method updates the specified column to have a float value. This
868 * does not update the actual database. <code>updateRow</code> must be
869 * called in order to do that.
871 * @param columnIndex The index of the column to update.
872 * @param value The new value of the column.
873 * @exception SQLException If an error occurs.
875 void updateFloat(int columnIndex, float value) throws SQLException;
878 * This method updates the specified column to have a double value. This
879 * does not update the actual database. <code>updateRow</code> must be
880 * called in order to do that.
882 * @param columnIndex The index of the column to update.
883 * @param value The new value of the column.
884 * @exception SQLException If an error occurs.
886 void updateDouble(int columnIndex, double value) throws SQLException;
889 * This method updates the specified column to have a BigDecimal value. This
890 * does not update the actual database. <code>updateRow</code> must be
891 * called in order to do that.
893 * @param columnIndex The index of the column to update.
894 * @param value The new value of the column.
895 * @exception SQLException If an error occurs.
897 void updateBigDecimal(int columnIndex, BigDecimal value)
898 throws SQLException;
901 * This method updates the specified column to have a String value. This
902 * does not update the actual database. <code>updateRow</code> must be
903 * called in order to do that.
905 * @param columnIndex The index of the column to update.
906 * @param value The new value of the column.
907 * @exception SQLException If an error occurs.
909 void updateString(int columnIndex, String value) throws SQLException;
912 * This method updates the specified column to have a byte array value. This
913 * does not update the actual database. <code>updateRow</code> must be
914 * called in order to do that.
916 * @param columnIndex The index of the column to update.
917 * @param value The new value of the column.
918 * @exception SQLException If an error occurs.
920 void updateBytes(int columnIndex, byte[] value) throws SQLException;
923 * This method updates the specified column to have a java.sql.Date value. This
924 * does not update the actual database. <code>updateRow</code> must be
925 * called in order to do that.
927 * @param columnIndex The index of the column to update.
928 * @param value The new value of the column.
929 * @exception SQLException If an error occurs.
931 void updateDate(int columnIndex, Date value) throws SQLException;
934 * This method updates the specified column to have a java.sql.Time value. This
935 * does not update the actual database. <code>updateRow</code> must be
936 * called in order to do that.
938 * @param columnIndex The index of the column to update.
939 * @param value The new value of the column.
940 * @exception SQLException If an error occurs.
942 void updateTime(int columnIndex, Time value) throws SQLException;
945 * This method updates the specified column to have a java.sql.Timestamp value.
946 * This does not update the actual database. <code>updateRow</code> must be
947 * called in order to do that.
949 * @param columnIndex The index of the column to update.
950 * @param value The new value of the column.
951 * @exception SQLException If an error occurs.
953 void updateTimestamp(int columnIndex, Timestamp value)
954 throws SQLException;
957 * This method updates the specified column from an ASCII text stream.
958 * This does not update the actual database. <code>updateRow</code> must be
959 * called in order to do that.
961 * @param columnIndex The index of the column to update.
962 * @param stream The stream from which the column value is updated.
963 * @param count The length of the stream.
964 * @exception SQLException If an error occurs.
966 void updateAsciiStream(int columnIndex, InputStream stream, int count)
967 throws SQLException;
970 * This method updates the specified column from a binary stream.
971 * This does not update the actual database. <code>updateRow</code> must be
972 * called in order to do that.
974 * @param columnIndex The index of the column to update.
975 * @param stream The stream from which the column value is updated.
976 * @param count The length of the stream.
977 * @exception SQLException If an error occurs.
979 void updateBinaryStream(int columnIndex, InputStream stream, int count)
980 throws SQLException;
983 * This method updates the specified column from a character stream.
984 * This does not update the actual database. <code>updateRow</code> must be
985 * called in order to do that.
987 * @param columnIndex The index of the column to update.
988 * @param reader The reader from which the column value is updated.
989 * @param count The length of the stream.
990 * @exception SQLException If an error occurs.
992 void updateCharacterStream(int columnIndex, Reader reader, int count)
993 throws SQLException;
996 * This method updates the specified column to have an Object value.
997 * This does not update the actual database. <code>updateRow</code> must be
998 * called in order to do that.
1000 * @param columnIndex The index of the column to update.
1001 * @param value The new value of the column.
1002 * @param scale The scale of the object in question, which is used only
1003 * for numeric type objects.
1004 * @exception SQLException If an error occurs.
1006 void updateObject(int columnIndex, Object value, int scale)
1007 throws SQLException;
1010 * This method updates the specified column to have an Object value.
1011 * This does not update the actual database. <code>updateRow</code> must be
1012 * called in order to do that.
1014 * @param columnIndex The index of the column to update.
1015 * @param value The new value of the column.
1016 * @exception SQLException If an error occurs.
1018 void updateObject(int columnIndex, Object value) throws SQLException;
1021 * This method updates the specified column to have a NULL value. This
1022 * does not update the actual database. <code>updateRow</code> must be
1023 * called in order to do that.
1025 * @param columnName The name of the column to update.
1026 * @exception SQLException If an error occurs.
1028 void updateNull(String columnName) throws SQLException;
1031 * This method updates the specified column to have a boolean value. This
1032 * does not update the actual database. <code>updateRow</code> must be
1033 * called in order to do that.
1035 * @param columnName The name of the column to update.
1036 * @param value The new value of the column.
1037 * @exception SQLException If an error occurs.
1039 void updateBoolean(String columnName, boolean value) throws SQLException;
1042 * This method updates the specified column to have a byte value. This
1043 * does not update the actual database. <code>updateRow</code> must be
1044 * called in order to do that.
1046 * @param columnName The name of the column to update.
1047 * @param value The new value of the column.
1048 * @exception SQLException If an error occurs.
1050 void updateByte(String columnName, byte value) throws SQLException;
1053 * This method updates the specified column to have a short value. This
1054 * does not update the actual database. <code>updateRow</code> must be
1055 * called in order to do that.
1057 * @param columnName The name of the column to update.
1058 * @param value The new value of the column.
1059 * @exception SQLException If an error occurs.
1061 void updateShort(String columnName, short value) throws SQLException;
1064 * This method updates the specified column to have an int value. This
1065 * does not update the actual database. <code>updateRow</code> must be
1066 * called in order to do that.
1068 * @param columnName The name of the column to update.
1069 * @param value The new value of the column.
1070 * @exception SQLException If an error occurs.
1072 void updateInt(String columnName, int value) throws SQLException;
1075 * This method updates the specified column to have a long value. This
1076 * does not update the actual database. <code>updateRow</code> must be
1077 * called in order to do that.
1079 * @param columnName The name of the column to update.
1080 * @param value The new value of the column.
1081 * @exception SQLException If an error occurs.
1083 void updateLong(String columnName, long value) throws SQLException;
1086 * This method updates the specified column to have a float value. This
1087 * does not update the actual database. <code>updateRow</code> must be
1088 * called in order to do that.
1090 * @param columnName The name of the column to update.
1091 * @param value The new value of the column.
1092 * @exception SQLException If an error occurs.
1094 void updateFloat(String columnName, float value) throws SQLException;
1097 * This method updates the specified column to have a double value. This
1098 * does not update the actual database. <code>updateRow</code> must be
1099 * called in order to do that.
1101 * @param columnName The name of the column to update.
1102 * @param value The new value of the column.
1103 * @exception SQLException If an error occurs.
1105 void updateDouble(String columnName, double value) throws SQLException;
1108 * This method updates the specified column to have a BigDecimal value. This
1109 * does not update the actual database. <code>updateRow</code> must be
1110 * called in order to do that.
1112 * @param columnName The name of the column to update.
1113 * @param value The new value of the column.
1114 * @exception SQLException If an error occurs.
1116 void updateBigDecimal(String columnName, BigDecimal value)
1117 throws SQLException;
1120 * This method updates the specified column to have a String value. This
1121 * does not update the actual database. <code>updateRow</code> must be
1122 * called in order to do that.
1124 * @param columnName The name of the column to update.
1125 * @param value The new value of the column.
1126 * @exception SQLException If an error occurs.
1128 void updateString(String columnName, String value) throws SQLException;
1131 * This method updates the specified column to have a byte array value. This
1132 * does not update the actual database. <code>updateRow</code> must be
1133 * called in order to do that.
1135 * @param columnName The name of the column to update.
1136 * @param value The new value of the column.
1137 * @exception SQLException If an error occurs.
1139 void updateBytes(String columnName, byte[] value) throws SQLException;
1142 * This method updates the specified column to have a java.sql.Date value. This
1143 * does not update the actual database. <code>updateRow</code> must be
1144 * called in order to do that.
1146 * @param columnName The name of the column to update.
1147 * @param value The new value of the column.
1148 * @exception SQLException If an error occurs.
1150 void updateDate(String columnName, Date value) throws SQLException;
1153 * This method updates the specified column to have a java.sql.Time value. This
1154 * does not update the actual database. <code>updateRow</code> must be
1155 * called in order to do that.
1157 * @param columnName The name of the column to update.
1158 * @param value The new value of the column.
1159 * @exception SQLException If an error occurs.
1161 void updateTime(String columnName, Time value) throws SQLException;
1164 * This method updates the specified column to have a java.sql.Timestamp value.
1165 * This does not update the actual database. <code>updateRow</code> must be
1166 * called in order to do that.
1168 * @param columnName The name of the column to update.
1169 * @param value The new value of the column.
1170 * @exception SQLException If an error occurs.
1172 void updateTimestamp(String columnName, Timestamp value)
1173 throws SQLException;
1176 * This method updates the specified column from an ASCII text stream.
1177 * This does not update the actual database. <code>updateRow</code> must be
1178 * called in order to do that.
1180 * @param columnName The name of the column to update.
1181 * @param stream The stream from which the column value is updated.
1182 * @param count The length of the stream.
1183 * @exception SQLException If an error occurs.
1185 void updateAsciiStream(String columnName, InputStream stream, int count)
1186 throws SQLException;
1189 * This method updates the specified column from a binary stream.
1190 * This does not update the actual database. <code>updateRow</code> must be
1191 * called in order to do that.
1193 * @param columnName The name of the column to update.
1194 * @param stream The stream from which the column value is updated.
1195 * @param count The length of the stream.
1196 * @exception SQLException If an error occurs.
1198 void updateBinaryStream(String columnName, InputStream stream, int count)
1199 throws SQLException;
1202 * This method updates the specified column from a character stream.
1203 * This does not update the actual database. <code>updateRow</code> must be
1204 * called in order to do that.
1206 * @param columnName The name of the column to update.
1207 * @param reader The reader from which the column value is updated.
1208 * @param count The length of the stream.
1209 * @exception SQLException If an error occurs.
1211 void updateCharacterStream(String columnName, Reader reader, int count)
1212 throws SQLException;
1215 * This method updates the specified column to have an Object value.
1216 * This does not update the actual database. <code>updateRow</code> must be
1217 * called in order to do that.
1219 * @param columnName The name of the column to update.
1220 * @param value The new value of the column.
1221 * @param scale The scale of the object in question, which is used only
1222 * for numeric type objects.
1223 * @exception SQLException If an error occurs.
1225 void updateObject(String columnName, Object value, int scale)
1226 throws SQLException;
1229 * This method updates the specified column to have an Object value.
1230 * This does not update the actual database. <code>updateRow</code> must be
1231 * called in order to do that.
1233 * @param columnName The name of the column to update.
1234 * @param value The new value of the column.
1235 * @exception SQLException If an error occurs.
1237 void updateObject(String columnName, Object value) throws SQLException;
1240 * This method inserts the current row into the database. The result set
1241 * must be positioned on the insert row in order to call this method
1242 * successfully.
1244 * @exception SQLException If an error occurs.
1246 void insertRow() throws SQLException;
1249 * This method updates the current row in the database.
1251 * @exception SQLException If an error occurs.
1253 void updateRow() throws SQLException;
1256 * This method deletes the current row in the database.
1258 * @exception SQLException If an error occurs.
1260 void deleteRow() throws SQLException;
1263 * This method refreshes the contents of the current row from the database.
1265 * @exception SQLException If an error occurs.
1267 void refreshRow() throws SQLException;
1270 * This method cancels any changes that have been made to a row. If
1271 * the <code>rowUpdate</code> method has been called, then the changes
1272 * cannot be undone.
1274 * @exception SQLException If an error occurs.
1276 void cancelRowUpdates() throws SQLException;
1279 * This method positions the result set to the "insert row", which allows
1280 * a new row to be inserted into the database from the result set.
1282 * @exception SQLException If an error occurs.
1284 void moveToInsertRow() throws SQLException;
1287 * This method moves the result set position from the insert row back to
1288 * the current row that was selected prior to moving to the insert row.
1290 * @exception SQLException If an error occurs.
1292 void moveToCurrentRow() throws SQLException;
1295 * This method returns a the <code>Statement</code> that was used to
1296 * produce this result set.
1298 * @return The <code>Statement</code> used to produce this result set.
1300 * @exception SQLException If an error occurs.
1302 Statement getStatement() throws SQLException;
1305 * This method returns the value of the specified column as a Java
1306 * <code>Object</code> using the specified SQL type to Java type map.
1308 * @param columnIndex The index of the column to return.
1309 * @param map The SQL type to Java type map to use.
1310 * @return The value of the column as an <code>Object</code>.
1311 * @exception SQLException If an error occurs.
1313 Object getObject(int columnIndex, Map<String, Class<?>> map)
1314 throws SQLException;
1317 * This method returns a <code>Ref</code> for the specified column which
1318 * represents the structured type for the column.
1320 * @param columnIndex The index of the column to return.
1321 * @return A <code>Ref</code> object for the column
1322 * @exception SQLException If an error occurs.
1324 Ref getRef(int columnIndex) throws SQLException;
1327 * This method returns the specified column value as a BLOB.
1329 * @param columnIndex The index of the column value to return.
1330 * @return The value of the column as a BLOB.
1331 * @exception SQLException If an error occurs.
1333 Blob getBlob(int columnIndex) throws SQLException;
1336 * This method returns the specified column value as a CLOB.
1338 * @param columnIndex The index of the column value to return.
1339 * @return The value of the column as a CLOB.
1340 * @exception SQLException If an error occurs.
1342 Clob getClob(int columnIndex) throws SQLException;
1345 * This method returns the specified column value as an <code>Array</code>.
1347 * @param columnIndex The index of the column value to return.
1348 * @return The value of the column as an <code>Array</code>.
1349 * @exception SQLException If an error occurs.
1351 Array getArray(int columnIndex) throws SQLException;
1354 * This method returns the value of the specified column as a Java
1355 * <code>Object</code> using the specified SQL type to Java type map.
1357 * @param columnName The name of the column to return.
1358 * @param map The SQL type to Java type map to use.
1359 * @return The value of the column as an <code>Object</code>.
1360 * @exception SQLException If an error occurs.
1362 Object getObject(String columnName, Map<String, Class<?>> map)
1363 throws SQLException;
1366 * This method returns a <code>Ref</code> for the specified column which
1367 * represents the structured type for the column.
1369 * @param columnName The name of the column to return.
1370 * @return A <code>Ref</code> object for the column
1371 * @exception SQLException If an error occurs.
1373 Ref getRef(String columnName) throws SQLException;
1376 * This method returns the specified column value as a BLOB.
1378 * @param columnName The name of the column value to return.
1379 * @return The value of the column as a BLOB.
1380 * @exception SQLException If an error occurs.
1382 Blob getBlob(String columnName) throws SQLException;
1385 * This method returns the specified column value as a CLOB.
1387 * @param columnName The name of the column value to return.
1388 * @return The value of the column as a CLOB.
1389 * @exception SQLException If an error occurs.
1391 Clob getClob(String columnName) throws SQLException;
1394 * This method returns the specified column value as an <code>Array</code>.
1396 * @param columnName The name of the column value to return.
1397 * @return The value of the column as an <code>Array</code>.
1398 * @exception SQLException If an error occurs.
1400 Array getArray(String columnName) throws SQLException;
1403 * This method returns the specified column value as a
1404 * <code>java.sql.Date</code>. The specified <code>Calendar</code> is used
1405 * to generate a value for the date if the database does not support
1406 * timezones.
1408 * @param columnIndex The index of the column value to return.
1409 * @param cal The <code>Calendar</code> to use for calculating timezones.
1410 * @return The value of the column as a <code>java.sql.Date</code>.
1411 * @exception SQLException If an error occurs.
1413 Date getDate(int columnIndex, Calendar cal) throws SQLException;
1416 * This method returns the specified column value as a
1417 * <code>java.sql.Date</code>. The specified <code>Calendar</code> is used
1418 * to generate a value for the date if the database does not support
1419 * timezones.
1421 * @param columnName The name of the column value to return.
1422 * @param cal The <code>Calendar</code> to use for calculating timezones.
1423 * @return The value of the column as a <code>java.sql.Date</code>.
1424 * @exception SQLException If an error occurs.
1426 Date getDate(String columnName, Calendar cal) throws SQLException;
1429 * This method returns the specified column value as a
1430 * <code>java.sql.Time</code>. The specified <code>Calendar</code> is used
1431 * to generate a value for the time if the database does not support
1432 * timezones.
1434 * @param columnIndex The index of the column value to return.
1435 * @param cal The <code>Calendar</code> to use for calculating timezones.
1436 * @return The value of the column as a <code>java.sql.Time</code>.
1437 * @exception SQLException If an error occurs.
1439 Time getTime(int columnIndex, Calendar cal) throws SQLException;
1442 * This method returns the specified column value as a
1443 * <code>java.sql.Time</code>. The specified <code>Calendar</code> is used
1444 * to generate a value for the time if the database does not support
1445 * timezones.
1447 * @param columnName The name of the column value to return.
1448 * @param cal The <code>Calendar</code> to use for calculating timezones.
1449 * @return The value of the column as a <code>java.sql.Time</code>.
1450 * @exception SQLException If an error occurs.
1452 Time getTime(String columnName, Calendar cal) throws SQLException;
1455 * This method returns the specified column value as a
1456 * <code>java.sql.Timestamp</code>. The specified <code>Calendar</code> is used
1457 * to generate a value for the timestamp if the database does not support
1458 * timezones.
1460 * @param columnIndex The index of the column value to return.
1461 * @param cal The <code>Calendar</code> to use for calculating timezones.
1462 * @return The value of the column as a <code>java.sql.Timestamp</code>.
1463 * @exception SQLException If an error occurs.
1465 Timestamp getTimestamp(int columnIndex, Calendar cal)
1466 throws SQLException;
1469 * This method returns the specified column value as a
1470 * <code>java.sql.Timestamp</code>. The specified <code>Calendar</code> is used
1471 * to generate a value for the timestamp if the database does not support
1472 * timezones.
1474 * @param columnName The name of the column value to return.
1475 * @param cal The <code>Calendar</code> to use for calculating timezones.
1477 * @return The value of the column as a <code>java.sql.Timestamp</code>.
1479 * @exception SQLException If an error occurs.
1481 Timestamp getTimestamp(String columnName, Calendar cal)
1482 throws SQLException;
1485 * This method returns the specified column value as a
1486 * <code>java.net.URL</code>.
1488 * @param columnIndex The index of the column value to return.
1489 * @exception SQLException If an error occurs.
1490 * @since 1.4
1492 URL getURL(int columnIndex) throws SQLException;
1495 * This method returns the specified column value as a
1496 * <code>java.net.URL</code>.
1498 * @param columnName The name of the column value to return.
1499 * @exception SQLException If an error occurs.
1500 * @since 1.4
1502 URL getURL(String columnName) throws SQLException;
1505 * This method updates the specified column to have a
1506 * <code>java.sql.Ref</code> value.
1507 * This does not update the actual database. <code>updateRow</code> must be
1508 * called in order to do that.
1510 * @parm columnIndex The index of the column value to update.
1511 * @parm value The <code>java.sql.Ref</code> used to set the new value
1512 * of the column.
1513 * @exception SQLException If an error occurs.
1514 * @since 1.4
1516 void updateRef(int columnIndex, Ref value) throws SQLException;
1519 * This method updates the specified column to have a
1520 * <code>java.sql.Ref</code> value.
1521 * This does not update the actual database. <code>updateRow</code> must be
1522 * called in order to do that.
1524 * @parm columnName The name of the column value to update.
1525 * @parm value The <code>java.sql.Ref</code> used to set the new value
1526 * of the column.
1527 * @exception SQLException If an error occurs.
1528 * @since 1.4
1530 void updateRef(String columnName, Ref value) throws SQLException;
1533 * This method updates the specified column to have a
1534 * <code>java.sql.Blob</code> value.
1535 * This does not update the actual database. <code>updateRow</code> must be
1536 * called in order to do that.
1538 * @parm columnIndex The index of the column value to update.
1539 * @parm value The <code>java.sql.Blob</code> used to set the new value
1540 * of the column.
1541 * @exception SQLException If an error occurs.
1542 * @since 1.4
1544 void updateBlob(int columnIndex, Blob value) throws SQLException;
1547 * This method updates the specified column to have a
1548 * <code>java.sql.Blob</code> value.
1549 * This does not update the actual database. <code>updateRow</code> must be
1550 * called in order to do that.
1552 * @parm columnName The name of the column value to update.
1553 * @parm value The <code>java.sql.Blob</code> used to set the new value
1554 * of the column.
1555 * @exception SQLException If an error occurs.
1556 * @since 1.4
1558 void updateBlob(String columnName, Blob value) throws SQLException;
1561 * This method updates the specified column to have a
1562 * <code>java.sql.Clob</code> value.
1563 * This does not update the actual database. <code>updateRow</code> must be
1564 * called in order to do that.
1566 * @parm columnIndex The index of the column value to update.
1567 * @parm value The <code>java.sql.Clob</code> used to set the new value
1568 * of the column.
1569 * @exception SQLException If an error occurs.
1570 * @since 1.4
1572 void updateClob(int columnIndex, Clob value) throws SQLException;
1575 * This method updates the specified column to have a
1576 * <code>java.sql.Clob</code> value.
1577 * This does not update the actual database. <code>updateRow</code> must be
1578 * called in order to do that.
1580 * @parm columnName The name of the column value to update.
1581 * @parm value The <code>java.sql.Clob</code> used to set the new value
1582 * of the column.
1583 * @exception SQLException If an error occurs.
1584 * @since 1.4
1586 void updateClob(String columnName, Clob value) throws SQLException;
1589 * This method updates the specified column to have a
1590 * <code>java.sqlArray</code> value.
1591 * This does not update the actual database. <code>updateRow</code> must be
1592 * called in order to do that.
1594 * @parm columnIndex The index of the column value to update.
1595 * @parm value The new value of the column.
1596 * @exception SQLException If an error occurs.
1597 * @since 1.4
1599 void updateArray(int columnIndex, Array value) throws SQLException;
1602 * This method updates the specified column to have a
1603 * <code>java.sqlArray</code> value.
1604 * This does not update the actual database. <code>updateRow</code> must be
1605 * called in order to do that.
1607 * @parm columnName The name of the column value to update.
1608 * @parm value The new value of the column.
1609 * @exception SQLException If an error occurs.
1610 * @since 1.4
1612 void updateArray(String columnName, Array value) throws SQLException;