KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > rmijdbc > RJResultSetInterface


1
2 /**
3  * RmiJdbc client/server JDBC Driver
4  * (C) GIE Dyade (Groupe BULL / INRIA Research Center) 1997
5  * (C) ExperLog 1999-2000
6  *
7  * @version 1.0
8  * @author Pierre-Yves Gibello (pierreyves.gibello@experlog.com)
9  */

10
11 package org.objectweb.rmijdbc;
12
13 import java.math.BigDecimal JavaDoc;
14 import java.util.Calendar JavaDoc;
15
16 import java.sql.*;
17
18 // TBD: WARNING This file contains a hack for InputStream class...
19
// InputStream is not serializable, of course !
20
// The right way would be to encapsulate InputStream in a RMI remote object
21
// (hope I'll find time to do that)
22

23 /**
24  * <P>A ResultSet provides access to a table of data generated by
25  * executing a Statement. The table rows are retrieved in
26  * sequence. Within a row its column values can be accessed in any
27  * order.
28  *
29  * <P>A ResultSet maintains a cursor pointing to its current row of
30  * data. Initially the cursor is positioned before the first row.
31  * The 'next' method moves the cursor to the next row.
32  *
33  * <P>The getXXX methods retrieve column values for the current
34  * row. You can retrieve values either using the index number of the
35  * column, or by using the name of the column. In general using the
36  * column index will be more efficient. Columns are numbered from 1.
37  *
38  * <P>For maximum portability, ResultSet columns within each row should be
39  * read in left-to-right order and each column should be read only once.
40  *
41  * <P>For the getXXX methods, the JDBC driver attempts to convert the
42  * underlying data to the specified Java type and returns a suitable
43  * Java value. See the JDBC specification for allowable mappings
44  * from SQL types to Java types with the ResultSet.getXXX methods.
45  *
46  * <P>Column names used as input to getXXX methods are case insensitive.
47  * When performing a getXXX using a column name, if several columns have
48  * the same name, then the value of the first matching column will be
49  * returned.
50  *
51  * <P>A ResultSet is automatically closed by the Statement that
52  * generated it when that Statement is closed, re-executed, or is used
53  * to retrieve the next result from a sequence of multiple results.
54  *
55  * <P>The number, types and properties of a ResultSet's columns are
56  * provided by the ResulSetMetaData object returned by the getMetaData
57  * method.
58  *
59  * @see Statement#executeQuery
60  * @see Statement#getResultSet
61  * @see ResultSetMetaData
62  */

63
64 public interface RJResultSetInterface extends java.rmi.Remote JavaDoc {
65
66     /**
67      * A ResultSet is initially positioned before its first row; the
68      * first call to next makes the first row the current row; the
69      * second call makes the second row the current row, etc.
70      *
71      * <P>If an input stream from the previous row is open, it is
72      * implicitly closed. The ResultSet's warning chain is cleared
73      * when a new row is read.
74      *
75      * @return true if the new current row is valid; false if there
76      * are no more rows
77      */

78     boolean next() throws java.rmi.RemoteException JavaDoc, SQLException;
79
80     /**
81      * In some cases, it is desirable to immediately release a
82      * ResultSet's database and JDBC resources instead of waiting for
83      * this to happen when it is automatically closed; the close
84      * method provides this immediate release.
85      *
86      * <P><B>Note:</B> A ResultSet is automatically closed by the
87      * Statement that generated it when that Statement is closed,
88      * re-executed, or is used to retrieve the next result from a
89      * sequence of multiple results. A ResultSet is also automatically
90      * closed when it is garbage collected.
91      */

92     void close() throws java.rmi.RemoteException JavaDoc, SQLException;
93
94     /**
95      * A column may have the value of SQL NULL; wasNull reports whether
96      * the last column read had this special value.
97      * Note that you must first call getXXX on a column to try to read
98      * its value and then call wasNull() to find if the value was
99      * the SQL NULL.
100      *
101      * @return true if last column read was SQL NULL
102      */

103     boolean wasNull() throws java.rmi.RemoteException JavaDoc, SQLException;
104     
105     //======================================================================
106
// Methods for accessing results by column index
107
//======================================================================
108

109     /**
110      * Get the value of a column in the current row as a Java String.
111      *
112      * @param columnIndex the first column is 1, the second is 2, ...
113      * @return the column value; if the value is SQL NULL, the result is null
114      */

115     String JavaDoc getString(int columnIndex) throws java.rmi.RemoteException JavaDoc, SQLException;
116
117     /**
118      * Get the value of a column in the current row as a Java boolean.
119      *
120      * @param columnIndex the first column is 1, the second is 2, ...
121      * @return the column value; if the value is SQL NULL, the result is false
122      */

123     boolean getBoolean(int columnIndex) throws java.rmi.RemoteException JavaDoc, SQLException;
124
125     /**
126      * Get the value of a column in the current row as a Java byte.
127      *
128      * @param columnIndex the first column is 1, the second is 2, ...
129      * @return the column value; if the value is SQL NULL, the result is 0
130      */

131     byte getByte(int columnIndex) throws java.rmi.RemoteException JavaDoc, SQLException;
132
133     /**
134      * Get the value of a column in the current row as a Java short.
135      *
136      * @param columnIndex the first column is 1, the second is 2, ...
137      * @return the column value; if the value is SQL NULL, the result is 0
138      */

139     short getShort(int columnIndex) throws java.rmi.RemoteException JavaDoc, SQLException;
140
141     /**
142      * Get the value of a column in the current row as a Java int.
143      *
144      * @param columnIndex the first column is 1, the second is 2, ...
145      * @return the column value; if the value is SQL NULL, the result is 0
146      */

147     int getInt(int columnIndex) throws java.rmi.RemoteException JavaDoc, SQLException;
148
149     /**
150      * Get the value of a column in the current row as a Java long.
151      *
152      * @param columnIndex the first column is 1, the second is 2, ...
153      * @return the column value; if the value is SQL NULL, the result is 0
154      */

155     long getLong(int columnIndex) throws java.rmi.RemoteException JavaDoc, SQLException;
156
157     /**
158      * Get the value of a column in the current row as a Java float.
159      *
160      * @param columnIndex the first column is 1, the second is 2, ...
161      * @return the column value; if the value is SQL NULL, the result is 0
162      */

163     float getFloat(int columnIndex) throws java.rmi.RemoteException JavaDoc, SQLException;
164
165     /**
166      * Get the value of a column in the current row as a Java double.
167      *
168      * @param columnIndex the first column is 1, the second is 2, ...
169      * @return the column value; if the value is SQL NULL, the result is 0
170      */

171     double getDouble(int columnIndex) throws java.rmi.RemoteException JavaDoc, SQLException;
172
173     /**
174      * Get the value of a column in the current row as a java.lang.BigDecimal object.
175      *
176      * @param columnIndex the first column is 1, the second is 2, ...
177      * @param scale the number of digits to the right of the decimal
178      * @return the column value; if the value is SQL NULL, the result is null
179      */

180     BigDecimal JavaDoc getBigDecimal(int columnIndex, int scale) throws java.rmi.RemoteException JavaDoc, SQLException;
181
182     /**
183      * Get the value of a column in the current row as a Java byte array.
184      * The bytes represent the raw values returned by the driver.
185      *
186      * @param columnIndex the first column is 1, the second is 2, ...
187      * @return the column value; if the value is SQL NULL, the result is null
188      */

189     byte[] getBytes(int columnIndex) throws java.rmi.RemoteException JavaDoc, SQLException;
190
191     /**
192      * Get the value of a column in the current row as a java.sql.Date object.
193      *
194      * @param columnIndex the first column is 1, the second is 2, ...
195      * @return the column value; if the value is SQL NULL, the result is null
196      */

197     java.sql.Date JavaDoc getDate(int columnIndex) throws java.rmi.RemoteException JavaDoc, SQLException;
198
199     /**
200      * Get the value of a column in the current row as a java.sql.Time object.
201      *
202      * @param columnIndex the first column is 1, the second is 2, ...
203      * @return the column value; if the value is SQL NULL, the result is null
204      */

205     java.sql.Time JavaDoc getTime(int columnIndex) throws java.rmi.RemoteException JavaDoc, SQLException;
206
207     /**
208      * Get the value of a column in the current row as a java.sql.Timestamp object.
209      *
210      * @param columnIndex the first column is 1, the second is 2, ...
211      * @return the column value; if the value is SQL NULL, the result is null
212      */

213     java.sql.Timestamp JavaDoc getTimestamp(int columnIndex) throws java.rmi.RemoteException JavaDoc, SQLException;
214
215     /**
216      * A column value can be retrieved as a stream of ASCII characters
217      * and then read in chunks from the stream. This method is particularly
218      * suitable for retrieving large LONGVARCHAR values. The JDBC driver will
219      * do any necessary conversion from the database format into ASCII.
220      *
221      * <P><B>Note:</B> All the data in the returned stream must be
222      * read prior to getting the value of any other column. The next
223      * call to a get method implicitly closes the stream. . Also, a
224      * stream may return 0 for available() whether there is data
225      * available or not.
226      *
227      * @param columnIndex the first column is 1, the second is 2, ...
228      * @return a Java input stream that delivers the database column value
229      * as a stream of one byte ASCII characters. If the value is SQL NULL
230      * then the result is null.
231      */

232 // java.io.InputStream getAsciiStream(int columnIndex)
233
// TBD This is a hack (InputStream not serializable)
234
byte[] getAsciiStream(int columnIndex)
235   throws java.rmi.RemoteException JavaDoc, SQLException;
236
237     /**
238      * A column value can be retrieved as a stream of Unicode characters
239      * and then read in chunks from the stream. This method is particularly
240      * suitable for retrieving large LONGVARCHAR values. The JDBC driver will
241      * do any necessary conversion from the database format into Unicode.
242      *
243      * <P><B>Note:</B> All the data in the returned stream must be
244      * read prior to getting the value of any other column. The next
245      * call to a get method implicitly closes the stream. . Also, a
246      * stream may return 0 for available() whether there is data
247      * available or not.
248      *
249      * @param columnIndex the first column is 1, the second is 2, ...
250      * @return a Java input stream that delivers the database column value
251      * as a stream of two byte Unicode characters. If the value is SQL NULL
252      * then the result is null.
253      */

254 // java.io.InputStream getUnicodeStream(int columnIndex)
255
// TBD This is a hack (InputStream not serializable)
256
byte[] getUnicodeStream(int columnIndex)
257   throws java.rmi.RemoteException JavaDoc, SQLException;
258
259     /**
260      * A column value can be retrieved as a stream of uninterpreted bytes
261      * and then read in chunks from the stream. This method is particularly
262      * suitable for retrieving large LONGVARBINARY values.
263      *
264      * <P><B>Note:</B> All the data in the returned stream must be
265      * read prior to getting the value of any other column. The next
266      * call to a get method implicitly closes the stream. Also, a
267      * stream may return 0 for available() whether there is data
268      * available or not.
269      *
270      * @param columnIndex the first column is 1, the second is 2, ...
271      * @return a Java input stream that delivers the database column value
272      * as a stream of uninterpreted bytes. If the value is SQL NULL
273      * then the result is null.
274      */

275 // java.io.InputStream getBinaryStream(int columnIndex)
276
// TBD This is a hack (InputStream not serializable)
277
byte[] getBinaryStream(int columnIndex)
278   throws java.rmi.RemoteException JavaDoc, SQLException;
279
280
281     //======================================================================
282
// Methods for accessing results by column name
283
//======================================================================
284

285     /**
286      * Get the value of a column in the current row as a Java String.
287      *
288      * @param columnName is the SQL name of the column
289      * @return the column value; if the value is SQL NULL, the result is null
290      */

291     String JavaDoc getString(String JavaDoc columnName) throws java.rmi.RemoteException JavaDoc, SQLException;
292
293     /**
294      * Get the value of a column in the current row as a Java boolean.
295      *
296      * @param columnName is the SQL name of the column
297      * @return the column value; if the value is SQL NULL, the result is false
298      */

299     boolean getBoolean(String JavaDoc columnName) throws java.rmi.RemoteException JavaDoc, SQLException;
300
301     /**
302      * Get the value of a column in the current row as a Java byte.
303      *
304      * @param columnName is the SQL name of the column
305      * @return the column value; if the value is SQL NULL, the result is 0
306      */

307     byte getByte(String JavaDoc columnName) throws java.rmi.RemoteException JavaDoc, SQLException;
308
309     /**
310      * Get the value of a column in the current row as a Java short.
311      *
312      * @param columnName is the SQL name of the column
313      * @return the column value; if the value is SQL NULL, the result is 0
314      */

315     short getShort(String JavaDoc columnName) throws java.rmi.RemoteException JavaDoc, SQLException;
316
317     /**
318      * Get the value of a column in the current row as a Java int.
319      *
320      * @param columnName is the SQL name of the column
321      * @return the column value; if the value is SQL NULL, the result is 0
322      */

323     int getInt(String JavaDoc columnName) throws java.rmi.RemoteException JavaDoc, SQLException;
324
325     /**
326      * Get the value of a column in the current row as a Java long.
327      *
328      * @param columnName is the SQL name of the column
329      * @return the column value; if the value is SQL NULL, the result is 0
330      */

331     long getLong(String JavaDoc columnName) throws java.rmi.RemoteException JavaDoc, SQLException;
332
333     /**
334      * Get the value of a column in the current row as a Java float.
335      *
336      * @param columnName is the SQL name of the column
337      * @return the column value; if the value is SQL NULL, the result is 0
338      */

339     float getFloat(String JavaDoc columnName) throws java.rmi.RemoteException JavaDoc, SQLException;
340
341     /**
342      * Get the value of a column in the current row as a Java double.
343      *
344      * @param columnName is the SQL name of the column
345      * @return the column value; if the value is SQL NULL, the result is 0
346      */

347     double getDouble(String JavaDoc columnName) throws java.rmi.RemoteException JavaDoc, SQLException;
348
349     /**
350      * Get the value of a column in the current row as a java.lang.BigDecimal object.
351      *
352      * @param columnName is the SQL name of the column
353      * @param scale the number of digits to the right of the decimal
354      * @return the column value; if the value is SQL NULL, the result is null
355      */

356     BigDecimal JavaDoc getBigDecimal(String JavaDoc columnName, int scale) throws java.rmi.RemoteException JavaDoc, SQLException;
357
358     /**
359      * Get the value of a column in the current row as a Java byte array.
360      * The bytes represent the raw values returned by the driver.
361      *
362      * @param columnName is the SQL name of the column
363      * @return the column value; if the value is SQL NULL, the result is null
364      */

365     byte[] getBytes(String JavaDoc columnName) throws java.rmi.RemoteException JavaDoc, SQLException;
366
367     /**
368      * Get the value of a column in the current row as a java.sql.Date object.
369      *
370      * @param columnName is the SQL name of the column
371      * @return the column value; if the value is SQL NULL, the result is null
372      */

373     java.sql.Date JavaDoc getDate(String JavaDoc columnName) throws java.rmi.RemoteException JavaDoc, SQLException;
374
375     /**
376      * Get the value of a column in the current row as a java.sql.Time object.
377      *
378      * @param columnName is the SQL name of the column
379      * @return the column value; if the value is SQL NULL, the result is null
380      */

381     java.sql.Time JavaDoc getTime(String JavaDoc columnName) throws java.rmi.RemoteException JavaDoc, SQLException;
382
383     /**
384      * Get the value of a column in the current row as a java.sql.Timestamp object.
385      *
386      * @param columnName is the SQL name of the column
387      * @return the column value; if the value is SQL NULL, the result is null
388      */

389     java.sql.Timestamp JavaDoc getTimestamp(String JavaDoc columnName) throws java.rmi.RemoteException JavaDoc, SQLException;
390
391     /**
392      * A column value can be retrieved as a stream of ASCII characters
393      * and then read in chunks from the stream. This method is particularly
394      * suitable for retrieving large LONGVARCHAR values. The JDBC driver will
395      * do any necessary conversion from the database format into ASCII.
396      *
397      * <P><B>Note:</B> All the data in the returned stream must
398      * be read prior to getting the value of any other column. The
399      * next call to a get method implicitly closes the stream.
400      *
401      * @param columnName is the SQL name of the column
402      * @return a Java input stream that delivers the database column value
403      * as a stream of one byte ASCII characters. If the value is SQL NULL
404      * then the result is null.
405      */

406 // java.io.InputStream getAsciiStream(String columnName)
407
// TBD This is a hack (InputStream not serializable)
408
byte[] getAsciiStream(String JavaDoc columnName)
409   throws java.rmi.RemoteException JavaDoc, SQLException;
410
411     /**
412      * A column value can be retrieved as a stream of Unicode characters
413      * and then read in chunks from the stream. This method is particularly
414      * suitable for retrieving large LONGVARCHAR values. The JDBC driver will
415      * do any necessary conversion from the database format into Unicode.
416      *
417      * <P><B>Note:</B> All the data in the returned stream must
418      * be read prior to getting the value of any other column. The
419      * next call to a get method implicitly closes the stream.
420      *
421      * @param columnName is the SQL name of the column
422      * @return a Java input stream that delivers the database column value
423      * as a stream of two byte Unicode characters. If the value is SQL NULL
424      * then the result is null.
425      */

426 // java.io.InputStream getUnicodeStream(String columnName)
427
// TBD This is a hack (InputStream not serializable)
428
byte[] getUnicodeStream(String JavaDoc columnName) throws java.rmi.RemoteException JavaDoc, SQLException;
429
430     /**
431      * A column value can be retrieved as a stream of uninterpreted bytes
432      * and then read in chunks from the stream. This method is particularly
433      * suitable for retrieving large LONGVARBINARY values.
434      *
435      * <P><B>Note:</B> All the data in the returned stream must
436      * be read prior to getting the value of any other column. The
437      * next call to a get method implicitly closes the stream.
438      *
439      * @param columnName is the SQL name of the column
440      * @return a Java input stream that delivers the database column value
441      * as a stream of uninterpreted bytes. If the value is SQL NULL
442      * then the result is null.
443      */

444 // java.io.InputStream getBinaryStream(String columnName)
445
// TBD This is a hack (InputStream not serializable)
446
byte[] getBinaryStream(String JavaDoc columnName) throws java.rmi.RemoteException JavaDoc, SQLException;
447
448
449     //=====================================================================
450
// Advanced features:
451
//=====================================================================
452

453     /**
454      * <p>The first warning reported by calls on this ResultSet is
455      * returned. Subsequent ResultSet warnings will be chained to this
456      * SQLWarning.
457      *
458      * <P>The warning chain is automatically cleared each time a new
459      * row is read.
460      *
461      * <P><B>Note:</B> This warning chain only covers warnings caused
462      * by ResultSet methods. Any warning caused by statement methods
463      * (such as reading OUT parameters) will be chained on the
464      * Statement object.
465      *
466      * @return the first SQLWarning or null
467      */

468     SQLWarning getWarnings() throws java.rmi.RemoteException JavaDoc, SQLException;
469
470     /**
471      * After this call getWarnings returns null until a new warning is
472      * reported for this ResultSet.
473      */

474     void clearWarnings() throws java.rmi.RemoteException JavaDoc, SQLException;
475
476     /**
477      * Get the name of the SQL cursor used by this ResultSet.
478      *
479      * <P>In SQL, a result table is retrieved through a cursor that is
480      * named. The current row of a result can be updated or deleted
481      * using a positioned update/delete statement that references the
482      * cursor name.
483      *
484      * <P>JDBC supports this SQL feature by providing the name of the
485      * SQL cursor used by a ResultSet. The current row of a ResultSet
486      * is also the current row of this SQL cursor.
487      *
488      * <P><B>Note:</B> If positioned update is not supported a
489      * SQLException is thrown
490      *
491      * @return the ResultSet's SQL cursor name
492      */

493     String JavaDoc getCursorName() throws java.rmi.RemoteException JavaDoc, SQLException;
494
495     /**
496      * The number, types and properties of a ResultSet's columns
497      * are provided by the getMetaData method.
498      *
499      * @return the description of a ResultSet's columns
500      */

501     RJResultSetMetaDataInterface getMetaData() throws java.rmi.RemoteException JavaDoc, SQLException;
502
503     /**
504      * <p>Get the value of a column in the current row as a Java object.
505      *
506      * <p>This method will return the value of the given column as a
507      * Java object. The type of the Java object will be the default
508      * Java Object type corresponding to the column's SQL type,
509      * following the mapping specified in the JDBC spec.
510      *
511      * <p>This method may also be used to read datatabase specific abstract
512      * data types.
513      *
514      * @param columnIndex the first column is 1, the second is 2, ...
515      * @return A java.lang.Object holding the column value.
516      */

517     Object JavaDoc getObject(int columnIndex) throws java.rmi.RemoteException JavaDoc, SQLException;
518
519     /**
520      * <p>Get the value of a column in the current row as a Java object.
521      *
522      * <p>This method will return the value of the given column as a
523      * Java object. The type of the Java object will be the default
524      * Java Object type corresponding to the column's SQL type,
525      * following the mapping specified in the JDBC spec.
526      *
527      * <p>This method may also be used to read datatabase specific abstract
528      * data types.
529      *
530      * @param columnName is the SQL name of the column
531      * @return A java.lang.Object holding the column value.
532      */

533   Object JavaDoc getObject(String JavaDoc columnName)
534   throws java.rmi.RemoteException JavaDoc, SQLException;
535
536     //----------------------------------------------------------------
537

538     /**
539      * Map a Resultset column name to a ResultSet column index.
540      *
541      * @param columnName the name of the column
542      * @return the column index
543      */

544   int findColumn(String JavaDoc columnName)
545   throws java.rmi.RemoteException JavaDoc, SQLException;
546
547       //--------------------------JDBC 2.0-----------------------------------
548

549     //---------------------------------------------------------------------
550
// Getter's and Setter's
551
//---------------------------------------------------------------------
552

553     /**
554      * JDBC 2.0
555      *
556      * <p>Gets the value of a column in the current row as a java.io.Reader.
557      * @param columnIndex the first column is 1, the second is 2, ...
558      */

559     java.io.Reader JavaDoc getCharacterStream(int columnIndex) throws java.rmi.RemoteException JavaDoc, SQLException;
560
561     /**
562      * JDBC 2.0
563      *
564      * <p>Gets the value of a column in the current row as a java.io.Reader.
565      * @param columnName the name of the column
566      * @return the value in the specified column as a <code>java.io.Reader</code>
567      */

568     java.io.Reader JavaDoc getCharacterStream(String JavaDoc columnName) throws java.rmi.RemoteException JavaDoc, SQLException;
569
570     /**
571      * JDBC 2.0
572      *
573      * Gets the value of a column in the current row as a java.math.BigDecimal
574      * object with full precision.
575      *
576      * @param columnIndex the first column is 1, the second is 2, ...
577      * @return the column value (full precision); if the value is SQL NULL,
578      * the result is null
579      * @exception SQLException if a database access error occurs
580      */

581     BigDecimal JavaDoc getBigDecimal(int columnIndex) throws java.rmi.RemoteException JavaDoc, SQLException;
582
583     /**
584      * JDBC 2.0
585      *
586      * Gets the value of a column in the current row as a java.math.BigDecimal
587      * object with full precision.
588      * @param columnName the column name
589      * @return the column value (full precision); if the value is SQL NULL,
590      * the result is null
591      * @exception SQLException if a database access error occurs
592      *
593      */

594     BigDecimal JavaDoc getBigDecimal(String JavaDoc columnName) throws java.rmi.RemoteException JavaDoc, SQLException;
595
596     //---------------------------------------------------------------------
597
// Traversal/Positioning
598
//---------------------------------------------------------------------
599

600     /**
601      * JDBC 2.0
602      *
603      * <p>Indicates whether the cursor is before the first row in the result
604      * set.
605      *
606      * @return true if the cursor is before the first row, false otherwise. Returns
607      * false when the result set contains no rows.
608      * @exception SQLException if a database access error occurs
609      */

610     boolean isBeforeFirst() throws java.rmi.RemoteException JavaDoc, SQLException;
611       
612     /**
613      * JDBC 2.0
614      *
615      * <p>Indicates whether the cursor is after the last row in the result
616      * set.
617      *
618      * @return true if the cursor is after the last row, false otherwise. Returns
619      * false when the result set contains no rows.
620      * @exception SQLException if a database access error occurs
621      */

622     boolean isAfterLast() throws java.rmi.RemoteException JavaDoc, SQLException;
623  
624     /**
625      * JDBC 2.0
626      *
627      * <p>Indicates whether the cursor is on the first row of the result set.
628      *
629      * @return true if the cursor is on the first row, false otherwise.
630      * @exception SQLException if a database access error occurs
631      */

632     boolean isFirst() throws java.rmi.RemoteException JavaDoc, SQLException;
633  
634     /**
635      * JDBC 2.0
636      *
637      * <p>Indicates whether the cursor is on the last row of the result set.
638      * Note: Calling the method <code>isLast</code> may be expensive
639      * because the JDBC driver
640      * might need to fetch ahead one row in order to determine
641      * whether the current row is the last row in the result set.
642      *
643      * @return true if the cursor is on the last row, false otherwise.
644      * @exception SQLException if a database access error occurs
645      */

646     boolean isLast() throws java.rmi.RemoteException JavaDoc, SQLException;
647
648     /**
649      * JDBC 2.0
650      *
651      * <p>Moves the cursor to the front of the result set, just before the
652      * first row. Has no effect if the result set contains no rows.
653      *
654      * @exception SQLException if a database access error occurs or the
655      * result set type is TYPE_FORWARD_ONLY
656      */

657     void beforeFirst() throws java.rmi.RemoteException JavaDoc, SQLException;
658
659     /**
660      * JDBC 2.0
661      *
662      * <p>Moves the cursor to the end of the result set, just after the last
663      * row. Has no effect if the result set contains no rows.
664      *
665      * @exception SQLException if a database access error occurs or the
666      * result set type is TYPE_FORWARD_ONLY
667      */

668     void afterLast() throws java.rmi.RemoteException JavaDoc, SQLException;
669
670     /**
671      * JDBC 2.0
672      *
673      * <p>Moves the cursor to the first row in the result set.
674      *
675      * @return true if the cursor is on a valid row; false if
676      * there are no rows in the result set
677      * @exception SQLException if a database access error occurs or the
678      * result set type is TYPE_FORWARD_ONLY
679      */

680     boolean first() throws java.rmi.RemoteException JavaDoc, SQLException;
681
682     /**
683      * JDBC 2.0
684      *
685      * <p>Moves the cursor to the last row in the result set.
686      *
687      * @return true if the cursor is on a valid row;
688      * false if there are no rows in the result set
689      * @exception SQLException if a database access error occurs or the
690      * result set type is TYPE_FORWARD_ONLY.
691      */

692     boolean last() throws java.rmi.RemoteException JavaDoc, SQLException;
693
694     /**
695      * JDBC 2.0
696      *
697      * <p>Retrieves the current row number. The first row is number 1, the
698      * second number 2, and so on.
699      *
700      * @return the current row number; 0 if there is no current row
701      * @exception SQLException if a database access error occurs
702      */

703     int getRow() throws java.rmi.RemoteException JavaDoc, SQLException;
704
705     /**
706      * JDBC 2.0
707      *
708      * <p>Moves the cursor to the given row number in the result set.
709      *
710      * <p>If the row number is positive, the cursor moves to
711      * the given row number with respect to the
712      * beginning of the result set. The first row is row 1, the second
713      * is row 2, and so on.
714      *
715      * <p>If the given row number is negative, the cursor moves to
716      * an absolute row position with respect to
717      * the end of the result set. For example, calling
718      * <code>absolute(-1)</code> positions the
719      * cursor on the last row, <code>absolute(-2)</code> indicates the next-to-last
720      * row, and so on.
721      *
722      * <p>An attempt to position the cursor beyond the first/last row in
723      * the result set leaves the cursor before/after the first/last
724      * row, respectively.
725      *
726      * <p>Note: Calling <code>absolute(1)</code> is the same
727      * as calling <code>first()</code>.
728      * Calling <code>absolute(-1)</code> is the same as calling <code>last()</code>.
729      *
730      * @return true if the cursor is on the result set; false otherwise
731      * @exception SQLException if a database access error occurs or
732      * row is 0, or result set type is TYPE_FORWARD_ONLY.
733      */

734     boolean absolute( int row ) throws java.rmi.RemoteException JavaDoc, SQLException;
735
736     /**
737      * JDBC 2.0
738      *
739      * <p>Moves the cursor a relative number of rows, either positive or negative.
740      * Attempting to move beyond the first/last row in the
741      * result set positions the cursor before/after the
742      * the first/last row. Calling <code>relative(0)</code> is valid, but does
743      * not change the cursor position.
744      *
745      * <p>Note: Calling <code>relative(1)</code>
746      * is different from calling <code>next()</code>
747      * because is makes sense to call <code>next()</code> when there is no current row,
748      * for example, when the cursor is positioned before the first row
749      * or after the last row of the result set.
750      *
751      * @return true if the cursor is on a row; false otherwise
752      * @exception SQLException if a database access error occurs, there
753      * is no current row, or the result set type is TYPE_FORWARD_ONLY
754      */

755     boolean relative( int rows ) throws java.rmi.RemoteException JavaDoc, SQLException;
756
757     /**
758      * JDBC 2.0
759      *
760      * <p>Moves the cursor to the previous row in the result set.
761      *
762      * <p>Note: <code>previous()</code> is not the same as
763      * <code>relative(-1)</code> because it
764      * makes sense to call</code>previous()</code> when there is no current row.
765      *
766      * @return true if the cursor is on a valid row; false if it is off the result set
767      * @exception SQLException if a database access error occurs or the
768      * result set type is TYPE_FORWARD_ONLY
769      */

770     boolean previous() throws java.rmi.RemoteException JavaDoc, SQLException;
771
772     /**
773      * JDBC 2.0
774      *
775      * Gives a hint as to the direction in which the rows in this result set
776      * will be processed. The initial value is determined by the statement
777      * that produced the result set. The fetch direction may be changed
778      * at any time.
779      *
780      * @exception SQLException if a database access error occurs or
781      * the result set type is TYPE_FORWARD_ONLY and the fetch direction is not
782      * FETCH_FORWARD.
783      */

784     void setFetchDirection(int direction) throws java.rmi.RemoteException JavaDoc, SQLException;
785
786     /**
787      * JDBC 2.0
788      *
789      * Returns the fetch direction for this result set.
790      *
791      * @return the current fetch direction for this result set
792      * @exception SQLException if a database access error occurs
793      */

794     int getFetchDirection() throws java.rmi.RemoteException JavaDoc, SQLException;
795
796     /**
797      * JDBC 2.0
798      *
799      * Gives the JDBC driver a hint as to the number of rows that should
800      * be fetched from the database when more rows are needed for this result
801      * set. If the fetch size specified is zero, the JDBC driver
802      * ignores the value and is free to make its own best guess as to what
803      * the fetch size should be. The default value is set by the statement
804      * that created the result set. The fetch size may be changed at any
805      * time.
806      *
807      * @param rows the number of rows to fetch
808      * @exception SQLException if a database access error occurs or the
809      * condition 0 <= rows <= this.getMaxRows() is not satisfied.
810      */

811     void setFetchSize(int rows) throws java.rmi.RemoteException JavaDoc, SQLException;
812
813     /**
814      * JDBC 2.0
815      *
816      * Returns the fetch size for this result set.
817      *
818      * @return the current fetch size for this result set
819      * @exception SQLException if a database access error occurs
820      */

821     int getFetchSize() throws java.rmi.RemoteException JavaDoc, SQLException;
822
823
824     /**
825      * JDBC 2.0
826      *
827      * Returns the type of this result set. The type is determined by
828      * the statement that created the result set.
829      *
830      * @return TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, or
831      * TYPE_SCROLL_SENSITIVE
832      * @exception SQLException if a database access error occurs
833      */

834     int getType() throws java.rmi.RemoteException JavaDoc, SQLException;
835
836     /**
837      * JDBC 2.0
838      *
839      * Returns the concurrency mode of this result set. The concurrency
840      * used is determined by the statement that created the result set.
841      *
842      * @return the concurrency type, CONCUR_READ_ONLY or CONCUR_UPDATABLE
843      * @exception SQLException if a database access error occurs
844      */

845     int getConcurrency() throws java.rmi.RemoteException JavaDoc, SQLException;
846
847     //---------------------------------------------------------------------
848
// Updates
849
//---------------------------------------------------------------------
850

851     /**
852      * JDBC 2.0
853      *
854      * Indicates whether the current row has been updated. The value returned
855      * depends on whether or not the result set can detect updates.
856      *
857      * @return true if the row has been visibly updated by the owner or
858      * another, and updates are detected
859      * @exception SQLException if a database access error occurs
860      *
861      * @see DatabaseMetaData#updatesAreDetected
862      */

863     boolean rowUpdated() throws java.rmi.RemoteException JavaDoc, SQLException;
864
865     /**
866      * JDBC 2.0
867      *
868      * Indicates whether the current row has had an insertion. The value returned
869      * depends on whether or not the result set can detect visible inserts.
870      *
871      * @return true if a row has had an insertion and insertions are detected
872      * @exception SQLException if a database access error occurs
873      *
874      * @see DatabaseMetaData#insertsAreDetected
875      */

876     boolean rowInserted() throws java.rmi.RemoteException JavaDoc, SQLException;
877    
878     /**
879      * JDBC 2.0
880      *
881      * Indicates whether a row has been deleted. A deleted row may leave
882      * a visible "hole" in a result set. This method can be used to
883      * detect holes in a result set. The value returned depends on whether
884      * or not the result set can detect deletions.
885      *
886      * @return true if a row was deleted and deletions are detected
887      * @exception SQLException if a database access error occurs
888      *
889      * @see DatabaseMetaData#deletesAreDetected
890      */

891     boolean rowDeleted() throws java.rmi.RemoteException JavaDoc, SQLException;
892
893     /**
894      * JDBC 2.0
895      *
896      * Give a nullable column a null value.
897      *
898      * The <code>updateXXX</code> methods are used to update column values in the
899      * current row, or the insert row. The <code>updateXXX</code> methods do not
900      * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
901      * methods are called to update the database.
902      *
903      * @param columnIndex the first column is 1, the second is 2, ...
904      * @exception SQLException if a database access error occurs
905      */

906     void updateNull(int columnIndex) throws java.rmi.RemoteException JavaDoc, SQLException;
907
908     /**
909      * JDBC 2.0
910      *
911      * Updates a column with a boolean value.
912      *
913      * The <code>updateXXX</code> methods are used to update column values in the
914      * current row, or the insert row. The <code>updateXXX</code> methods do not
915      * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
916      * methods are called to update the database.
917      *
918      * @param columnIndex the first column is 1, the second is 2, ...
919      * @param x the new column value
920      * @exception SQLException if a database access error occurs
921      */

922     void updateBoolean(int columnIndex, boolean x) throws java.rmi.RemoteException JavaDoc, SQLException;
923
924     /**
925      * JDBC 2.0
926      *
927      * Updates a column with a byte value.
928      *
929      * The <code>updateXXX</code> methods are used to update column values in the
930      * current row, or the insert row. The <code>updateXXX</code> methods do not
931      * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
932      * methods are called to update the database.
933      *
934      * @param columnIndex the first column is 1, the second is 2, ...
935      * @param x the new column value
936      * @exception SQLException if a database access error occurs
937      */

938     void updateByte(int columnIndex, byte x) throws java.rmi.RemoteException JavaDoc, SQLException;
939
940     /**
941      * JDBC 2.0
942      *
943      * Updates a column with a short value.
944      *
945      * The <code>updateXXX</code> methods are used to update column values in the
946      * current row, or the insert row. The <code>updateXXX</code> methods do not
947      * update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code>
948      * methods are called to update the database.
949      *
950      * @param columnIndex the first column is 1, the second is 2, ...
951      * @param x the new column value
952      * @exception SQLException if a database access error occurs
953      */

954     void updateShort(int columnIndex, short x) throws java.rmi.RemoteException JavaDoc, SQLException;
955
956     /**
957      * JDBC 2.0
958      *
959      * Updates a column with an integer value.
960      *
961      * The <code>updateXXX</code> methods are used to update column values in the