KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hsqldb > jdbc > jdbcResultSet


1 /* Copyright (c) 1995-2000, The Hypersonic SQL Group.
2  * All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  *
7  * Redistributions of source code must retain the above copyright notice, this
8  * list of conditions and the following disclaimer.
9  *
10  * Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following disclaimer in the documentation
12  * and/or other materials provided with the distribution.
13  *
14  * Neither the name of the Hypersonic SQL Group nor the names of its
15  * contributors may be used to endorse or promote products derived from this
16  * software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE HYPERSONIC SQL GROUP,
22  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  *
30  * This software consists of voluntary contributions made by many individuals
31  * on behalf of the Hypersonic SQL Group.
32  *
33  *
34  * For work added by the HSQL Development Group:
35  *
36  * Copyright (c) 2001-2005, The HSQL Development Group
37  * All rights reserved.
38  *
39  * Redistribution and use in source and binary forms, with or without
40  * modification, are permitted provided that the following conditions are met:
41  *
42  * Redistributions of source code must retain the above copyright notice, this
43  * list of conditions and the following disclaimer.
44  *
45  * Redistributions in binary form must reproduce the above copyright notice,
46  * this list of conditions and the following disclaimer in the documentation
47  * and/or other materials provided with the distribution.
48  *
49  * Neither the name of the HSQL Development Group nor the names of its
50  * contributors may be used to endorse or promote products derived from this
51  * software without specific prior written permission.
52  *
53  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
54  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
55  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
56  * ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG,
57  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
58  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
59  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
60  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
61  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
62  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
63  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
64  */

65
66
67 package org.hsqldb.jdbc;
68
69 import java.io.ByteArrayInputStream JavaDoc;
70 import java.io.StringReader JavaDoc;
71 import java.math.BigDecimal JavaDoc;
72 import java.sql.Date JavaDoc;
73 import java.sql.ResultSet JavaDoc;
74 import java.sql.ResultSetMetaData JavaDoc;
75 import java.sql.SQLException JavaDoc;
76 import java.sql.SQLWarning JavaDoc;
77 import java.sql.Statement JavaDoc;
78 import java.sql.Time JavaDoc;
79 import java.sql.Timestamp JavaDoc;
80 import java.util.Calendar JavaDoc;
81
82 //#ifdef JAVA2
83
import java.sql.Array JavaDoc;
84 import java.sql.Blob JavaDoc;
85 import java.sql.Clob JavaDoc;
86 import java.sql.Ref JavaDoc;
87 import java.util.Map JavaDoc;
88
89 //#endif JAVA2
90
import org.hsqldb.Column;
91 import org.hsqldb.HsqlDateTime;
92 import org.hsqldb.HsqlException;
93 import org.hsqldb.Record;
94 import org.hsqldb.Result;
95 import org.hsqldb.ResultConstants;
96 import org.hsqldb.Trace;
97 import org.hsqldb.Types;
98 import org.hsqldb.lib.AsciiStringInputStream;
99 import org.hsqldb.lib.StringInputStream;
100 import org.hsqldb.persist.HsqlProperties;
101 import org.hsqldb.types.Binary;
102 import org.hsqldb.types.JavaObject;
103
104 // fredt@users 20020320 - patch 1.7.0 - JDBC 2 support and error trapping
105
// JDBC 2 methods can now be called from jdk 1.1.x - see javadoc comments
106
// SCROLL_INSENSITIVE and FORWARD_ONLY types for ResultSet are now supported
107
// fredt@users 20020315 - patch 497714 by lakuhns@users - scrollable ResultSet
108
// all absolute and relative positioning methods defined
109
// boucherb@users 20020409 - added "throws SQLException" to all methods where
110
// it was missing here but specified in the java.sql.ResultSet and
111
// java.sql.ResultSetMetaData interfaces, updated generic documentation to
112
// JDK 1.4, and added JDBC3 methods and docs
113
// boucherb@users and fredt@users 20020505 extensive review and update
114
// of docs and behaviour to comply with java.sql specification
115
// tony_lai@users 20020820 - patch 595073 - duplicated exception msg
116
// fredt@users 20030622 - patch 1.7.2 - columns and labels are case sensitive
117
// boucherb@users 200404xx - javadoc updates
118

119 /**
120  * <!-- start generic documentation -->
121  * A table of data representing a database result set, which
122  * is usually generated by executing a statement that queries the database.
123  *
124  * <P>A <code>ResultSet</code> object maintains a cursor pointing
125  * to its current row of data. Initially the cursor is positioned
126  * before the first row. The <code>next</code> method moves the
127  * cursor to the next row, and because it returns <code>false</code>
128  * when there are no more rows in the <code>ResultSet</code> object,
129  * it can be used in a <code>while</code> loop to iterate through
130  * the result set.
131  * <P>
132  * A default <code>ResultSet</code> object is not updatable and
133  * has a cursor that moves forward only. Thus, you can
134  * iterate through it only once and only from the first row to the
135  * last row. It is possible to
136  * produce <code>ResultSet</code> objects that are scrollable and/or
137  * updatable. The following code fragment, in which <code>con</code>
138  * is a valid <code>Connection</code> object, illustrates how to make
139  * a result set that is scrollable and insensitive to updates by others,
140  * and that is updatable. See <code>ResultSet</code> fields for other
141  * options.
142  * <PRE>
143  *
144  * Statement stmt = con.createStatement(
145  * ResultSet.TYPE_SCROLL_INSENSITIVE,
146  * ResultSet.CONCUR_UPDATABLE);
147  * ResultSet rs = stmt.executeQuery("SELECT a, b FROM TABLE2");
148  * // rs will be scrollable, will not show changes made by others,
149  * // and will be updatable
150  *
151  * </PRE>
152  * The <code>ResultSet</code> interface provides
153  * <i>getter</i> methods (<code>getBoolean</code>, <code>getLong</code>,
154  * and so on) for retrieving column values from the current row.
155  * Values can be retrieved using either the index number of the
156  * column or the name of the column. In general, using the
157  * column index will be more efficient. Columns are numbered from 1.
158  * For maximum portability, result set columns within each row should be
159  * read in left-to-right order, and each column should be read only once.
160  *
161  * <P>For the getter methods, a JDBC driver attempts
162  * to convert the underlying data to the Java type specified in the
163  * getter method and returns a suitable Java value. The JDBC specification
164  * has a table showing the allowable mappings from SQL types to Java types
165  * that can be used by the <code>ResultSet</code> getter methods.
166  * <P>
167  * <P>Column names used as input to getter methods are case
168  * insensitive. When a getter method is called with
169  * a column name and several columns have the same name,
170  * the value of the first matching column will be returned.
171  * The column name option is
172  * designed to be used when column names are used in the SQL
173  * query that generated the result set.
174  * For columns that are NOT explicitly named in the query, it
175  * is best to use column numbers. If column names are used, there is
176  * no way for the programmer to guarantee that they actually refer to
177  * the intended columns.
178  * <P>
179  * A set of updater methods were added to this interface
180  * in the JDBC 2.0 API (Java<sup><font size=-2>TM</font></sup> 2 SDK,
181  * Standard Edition, version 1.2). The comments regarding parameters
182  * to the getter methods also apply to parameters to the
183  * updater methods.
184  * <P>
185  * The updater methods may be used in two ways:
186  * <ol>
187  * <LI>to update a column value in the current row. In a scrollable
188  * <code>ResultSet</code> object, the cursor can be moved backwards
189  * and forwards, to an absolute position, or to a position
190  * relative to the current row.
191  * The following code fragment updates the <code>NAME</code> column
192  * in the fifth row of the <code>ResultSet</code> object
193  * <code>rs</code> and then uses the method <code>updateRow</code>
194  * to update the data source table from which <code>rs</code> was
195  * derived.
196  * <PRE>
197  *
198  * rs.absolute(5); // moves the cursor to the fifth row of rs
199  * rs.updateString("NAME", "AINSWORTH"); // updates the
200  * // <code>NAME</code> column of row 5 to be <code>AINSWORTH</code>
201  * rs.updateRow(); // updates the row in the data source
202  *
203  * </PRE>
204  * <LI>to insert column values into the insert row. An updatable
205  * <code>ResultSet</code> object has a special row associated with
206  * it that serves as a staging area for building a row to be inserted.
207  * The following code fragment moves the cursor to the insert row, builds
208  * a three-column row, and inserts it into <code>rs</code> and into
209  * the data source table using the method <code>insertRow</code>.
210  * <PRE>
211  *
212  * rs.moveToInsertRow(); // moves cursor to the insert row
213  * rs.updateString(1, "AINSWORTH"); // updates the
214  * // first column of the insert row to be <code>AINSWORTH</code>
215  * rs.updateInt(2,35); // updates the second column to be <code>35</code>
216  * rs.updateBoolean(3, true); // updates the third row to <code>true</code>
217  * rs.insertRow();
218  * rs.moveToCurrentRow();
219  *
220  * </PRE>
221  * </ol>
222  * <P>A <code>ResultSet</code> object is automatically closed when the
223  * <code>Statement</code> object that
224  * generated it is closed, re-executed, or used
225  * to retrieve the next result from a sequence of multiple results.
226  *
227  * <P>The number, types and properties of a <code>ResultSet</code>
228  * object's columns are provided by the <code>ResulSetMetaData</code>
229  * object returned by the <code>ResultSet.getMetaData</code> method. <p>
230  * <!-- end generic documentation -->
231  *
232  * <!-- start release-specific documentation -->
233  * <div class="ReleaseSpecificDocumentation">
234  * <h3>HSQLDB-Specific Information:</h3> <p>
235  *
236  * A <code>ResultSet</code> object generated by HSQLDB is by default of
237  * <code>ResultSet.TYPE_FORWARD_ONLY</code> (as is standard JDBC behavior)
238  * and does not allow the use of absolute and relative positioning
239  * methods. However, since 1.7.0, if a statement is created
240  * with:<p>
241  *
242  * <pre class="JavaCodeExample">
243  * Statement stmt = conn.<b>createStatement</b>(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
244  * </pre>
245  *
246  * then the <code>ResultSet</code> objects it produces support
247  * using all of the absolute and relative positioning methods of JDBC2
248  * to set the position of the current row, for example:<p>
249  *
250  * <pre class="JavaCodeExample">
251  * rs.<b>absolute</b>(<span class="JavaNumericLiteral">5</span>);
252  * String fifthRowValue = rs.<b>getString</b>(<span class="JavaNumericLiteral">1</span>);
253  * rs.<b>relative</b>(<span class="JavaNumericLiteral">4</span>);
254  * String ninthRowValue = rs.<b>getString</b>(<span class="JavaNumericLiteral">1</span>);
255  * </pre>
256  *
257  * Note: An HSQLDB <code>ResultSet</code> object persists, even after its
258  * connection is closed. This is regardless of the operational mode of
259  * the {@link Database Database} from which it came. That is, they
260  * persist whether originating from a <code>Server</code>,
261  * <code>WebServer</code> or in-process mode <code>Database.</code>
262  * <p>
263  *
264  * Including HSQLDB 1.7.2, there is no support for any of the methods
265  * introduced in JDBC 2 relating to updateable result sets. These methods
266  * include all updateXXX methods, as well as the {@link #insertRow},
267  * {@link #updateRow}, {@link #deleteRow}, {@link #moveToInsertRow} (and so on)
268  * methods; invoking any such method throws an <code>SQLException</code>
269  * stating that the operation is not supported.
270  *
271  * <b>JRE 1.1.x Notes:</b> <p>
272  *
273  * In general, JDBC 2 support requires Java 1.2 and above, and JDBC 3 requires
274  * Java 1.4 and above. In HSQLDB, support for methods introduced in different
275  * versions of JDBC depends on the JDK version used for compiling and building
276  * HSQLDB.<p>
277  *
278  * Since 1.7.0, it is possible to build the product so that
279  * all JDBC 2 methods can be called while executing under the version 1.1.x
280  * <em>Java Runtime Environment</em><sup><font size="-2">TM</font></sup>.
281  * However, some of these method calls require <code>int</code> values that
282  * are defined only in the JDBC 2 or greater version of the
283  * <a HREF="http://java.sun.com/j2se/1.4/docs/api/java/sql/ResultSet.html">
284  * <code>ResultSet</code></a> interface. For this reason, when the
285  * product is compiled under JDK 1.1.x, these values are defined here, in this
286  * class. <p>
287  *
288  * In a JRE 1.1.x environment, calling JDBC 2 methods that take or return the
289  * JDBC2-only <code>ResultSet</code> values can be achieved by referring
290  * to them in parameter specifications and return value comparisons,
291  * respectively, as follows: <p>
292  *
293  * <pre class="JavaCodeExample">
294  * jdbcResultSet.FETCH_FORWARD
295  * jdbcResultSet.TYPE_FORWARD_ONLY
296  * jdbcResultSet.TYPE_SCROLL_INSENSITIVE
297  * jdbcResultSet.CONCUR_READ_ONLY
298  * // etc.
299  * </pre>
300  *
301  * However, please note that code written in such a manner will not be
302  * compatible for use with other JDBC 2 drivers, since they expect and use
303  * <code>ResultSet</code>, rather than <code>jdbcResultSet</code>. Also
304  * note, this feature is offered solely as a convenience to developers
305  * who must work under JDK 1.1.x due to operating constraints, yet wish to
306  * use some of the more advanced features available under the JDBC 2
307  * specification.<p>
308  *
309  * (fredt@users) <br>
310  * (boucherb@users)<p>
311  *
312  * </div>
313  * @see jdbcStatement#executeQuery
314  * @see jdbcStatement#getResultSet
315  * @see <a HREF=
316  * "http://java.sun.com/j2se/1.4/docs/api/java/sql/ResultSetMetaData.html">
317  * <code>ResultSetMetaData</code></a>
318  *
319  * Extensively rewritten and extended in successive versions of HSQLDB.
320  *
321  * @author Thomas Mueller (Hypersonic SQL Group)
322  * @version 1.8.0
323  * @since Hypersonic SQL
324  */

325 public class jdbcResultSet implements ResultSet JavaDoc {
326
327 // fredt@users 20020320 - patch 497714 by lakuhns@users - scrollable ResultSet
328
// variable values in different states
329
// Condition definitions
330
// bInit iCurrentRow nCurrent nCurrent.next
331
// ----- ----------- -------- -------------
332
// beforeFirst false 0 N/A N/A
333
// first true 1 !null next or null
334
// last true last row # !null null
335
// afterLast true last row + 1 N/A N/A
336
//------------------------ Private Attributes --------------------------
337
/*
338  * Campbell's comments
339  * Future Development Information for Developers and Contributors<p>
340  * Providing a
341  * full and robust implementation guaranteeing consistently accurate
342  * results and behaviour depends upon introducing several new engine
343  * features for which the internals of the product currently have no
344  * infrastructure: <p>
345  *
346  * <OL>
347  * <LI>a unique rowid for each row in the database which lasts the life
348  * of a row, independent of any updates made to that row</LI>
349  * <LI>the ability to explicitly lock either the tables or the
350  * individual rows of an updateable result, for the duration that
351  * the result is open</LI>
352  * <LI>the ability to choose between transactions supporting repeatable
353  * reads, committed reads, and uncommitted reads
354  * <LI>the ability to map an updated result row's columns back to
355  * specific updateable objects on the database.<p>
356  *
357  * <B>Note:</B> Typically, it is easy to do this mapping if all the
358  * rows of a result consist of columns from a single table. And it
359  * is especially easy if the result's columns are a superset of the
360  * primary key columns of that table. The ability to
361  * update a result consisting of any combintation of join, union,
362  * intersect, difference and grouping operations, however, is much more
363  * complex to implement and often impossible, especially under
364  * grouping and non-natural joins. Also, it is not even guaranteed
365  * that the columns of a result map back to *any* updateable object
366  * on the database, for instance in the cases where the
367  * result's column values are general expressions or the result
368  * comes from a stored procedure where the data may not even come,
369  * directly or indirectly, from updateable database objects such as
370  * columns in table rows.
371  * </OL>
372  *
373  * For developers working under a JDBC3 environment,
374  * it is gently recommended to take a look at Sun's early access
375  * <a HREF="http://developer.java.sun.com/developer/earlyAccess/crs/">
376  * <code>RowSet</code></a> implementation, as this can be used to add
377  * JDBC driver independent scrollablility and updateability.
378  * However, as a driver independent implementation, it obviously cannot
379  * guarantee to use the traditional table and/or row locking features
380  * that many DBMS make available to ensure the success of all
381  * valid updates against updateable results sets. As such, performing
382  * updates through Sun's early access <code>RowSet</code> implementation
383  * may not always succeed, even when it is generally expected that they
384  * should. This is because the condition used to find the original row
385  * on the database to update (which, for a driver independent
386  * implementation, would have to be equality on all columns values of
387  * the originally retrieved row) can become invalid if another
388  * transaction modifies or deletes that row on the database at some
389  * point between the time the row was last retrieved or refreshed in
390  * the RowSet and the time the RowSet attempts to make its next
391  * update to that row. Also, any driver independent implementation
392  * of RowSet is still dependent on each driver guaranteeing that its
393  * <code>ResultSet</code> objects return completely accurate
394  * <code>ResultSetMetaData</code> that fulfills all of the
395  * JDBC <code>ResultSetMetaData</code> contracts under all circumstances.
396  * However, up to and including 1.7.0, HSQLDB does not make such guarantees
397  * under all conditions. See the discussion at {@link #getMetaData}.
398  * (boucherb@users) (version 1.7.0)<p>
399 */

400
401 // boucherb@users/hiep256@users 20010829 - patch 1.7.2 - allow expression to
402
// return Results as Object, where object is Result or jdbcResultSet.
403
// - rResult access changed to allow getting internal result object
404
// from Parser.processCall()
405

406     /** Statement is closed when its result set is closed */
407     boolean autoClose;
408
409     /** The internal representation. */
410     public Result rResult;
411
412     /**
413      * The current record containing the data for the row
414      */

415     private Record nCurrent;
416
417     /** The row upon which this ResultSet is currently positioned. */
418     private int iCurrentRow;
419
420     /** When the result of updating the database, the number of updated rows. */
421     private int iUpdateCount;
422
423     /** Is current row before the first row? */
424     private boolean bInit; // false if before first row
425

426     /** How many columns does this ResultSet have? */
427     int iColumnCount;
428
429     /** Did the last getXXX method encounter a null value? */
430     private boolean bWasNull;
431
432     /** The ResultSetMetaData object for this ResultSet */
433     private ResultSetMetaData JavaDoc rsmd;
434
435     /** Properties of this ResultSet's parent Connection. */
436     private HsqlProperties connProperties;
437
438     /** is the connection via network */
439     private boolean isNetConn;
440
441     /**
442      * The Statement that generated this result. Null if the result is
443      * from DatabaseMetaData<p>
444      */

445     jdbcStatement sqlStatement;
446
447     //------------------------ Package Attributes --------------------------
448

449     /**
450      * The scrollability / scroll sensitivity type of this result.
451      */

452     int rsType = TYPE_FORWARD_ONLY;
453
454     /**
455      * <!-- start generic documentation -->
456      * Moves the cursor down one row from its current position.
457      * A <code>ResultSet</code> cursor is initially positioned
458      * before the first row; the first call to the method
459      * <code>next</code> makes the first row the current row; the
460      * second call makes the second row the current row, and so on.
461      *
462      * <P>If an input stream is open for the current row, a call
463      * to the method <code>next</code> will
464      * implicitly close it. A <code>ResultSet</code> object's
465      * warning chain is cleared when a new row is read. <p>
466      *
467      * <!-- end generic documentation -->
468      *
469      * @return <code>true</code> if the new current row is valid;
470      * <code>false</code> if there are no more rows
471      * @exception SQLException if a database access error occurs
472      */

473     public boolean next() throws SQLException JavaDoc {
474
475         bWasNull = false;
476
477         // Have an empty resultset so exit with false
478
if (rResult == null || rResult.isEmpty()) {
479             return false;
480         }
481
482         if (!bInit) {
483
484             // The resultset has not been traversed, so set the cursor
485
// to the first row (1)
486
nCurrent = rResult.rRoot;
487             bInit = true;
488             iCurrentRow = 1;
489         } else {
490
491             // The resultset has been traversed, if afterLast, return false
492
if (nCurrent == null) {
493                 return false;
494             }
495
496             // On a valid row so go to next
497
nCurrent = nCurrent.next;
498
499             iCurrentRow++;
500         }
501
502         // finally test to see if we are in an afterLast situation
503
if (nCurrent == null) {
504
505             // Yes, set the current row to after last and exit with false
506
iCurrentRow = rResult.getSize() + 1;
507
508             return false;
509         } else {
510
511             // Not afterLast, so success
512
return true;
513         }
514     }
515
516     /**
517      * <!-- start generic documentation -->
518      * Releases this <code>ResultSet</code> object's database and
519      * JDBC resources immediately instead of waiting for
520      * this to happen when it is automatically closed.
521      *
522      * <P><B>Note:</B> A <code>ResultSet</code> object
523      * is automatically closed by the
524      * <code>Statement</code> object that generated it when
525      * that <code>Statement</code> object is closed,
526      * re-executed, or is used to retrieve the next result from a
527      * sequence of multiple results. A <code>ResultSet</code> object
528      * is also automatically closed when it is garbage collected. <p>
529      * <!-- end generic documentation -->
530      *
531      * @exception SQLException if a database access error occurs
532      */

533     public void close() throws SQLException JavaDoc {
534
535         iUpdateCount = -1;
536         rResult = null;
537
538         if (autoClose) {
539             sqlStatement.close();
540         }
541     }
542
543     /**
544      * <!-- start generic documentation -->
545      * Reports whether
546      * the last column read had a value of SQL <code>NULL</code>.
547      * Note that you must first call one of the getter methods
548      * on a column to try to read its value and then call
549      * the method <code>wasNull</code> to see if the value read was
550      * SQL <code>NULL</code>. <p>
551      * <!-- end generic documentation -->
552      *
553      * @return <code>true</code> if the last column value read was SQL
554      * <code>NULL</code> and <code>false</code> otherwise
555      * @exception SQLException if a database access error occurs
556      */

557     public boolean wasNull() throws SQLException JavaDoc {
558         return bWasNull;
559     }
560
561     //======================================================================
562
// Methods for accessing results by column index
563
//======================================================================
564

565     /**
566      * <!-- start generic documentation -->
567      * Retrieves the value of the designated column in the current row
568      * of this <code>ResultSet</code> object as
569      * a <code>String</code> in the Java programming language. <p>
570      * <!-- end generic documentation -->
571      *
572      * @param columnIndex the first column is 1, the second is 2, ...
573      * @return the column value; if the value is SQL <code>NULL</code>, the
574      * value returned is <code>null</code>
575      * @exception SQLException if a database access error occurs
576      */

577     public String JavaDoc getString(int columnIndex) throws SQLException JavaDoc {
578         return (String JavaDoc) getColumnInType(columnIndex, Types.CHAR);
579     }
580
581     /**
582      * <!-- start generic documentation -->
583      * Retrieves the value of the designated column in the current row
584      * of this <code>ResultSet</code> object as
585      * a <code>boolean</code> in the Java programming language. <p>
586      * <!-- end generic documentation -->
587      *
588      * @param columnIndex the first column is 1, the second is 2, ...
589      * @return the column value; if the value is SQL <code>NULL</code>, the
590      * value returned is <code>false</code>
591      * @exception SQLException if a database access error occurs
592      */

593     public boolean getBoolean(int columnIndex) throws SQLException JavaDoc {
594
595         Object JavaDoc o = getColumnInType(columnIndex, Types.BOOLEAN);
596
597         return o == null ? false
598                          : ((Boolean JavaDoc) o).booleanValue();
599     }
600
601     /**
602      * <!-- start generic documentation -->
603      * Retrieves the value of the designated column in the current row
604      * of this <code>ResultSet</code> object as
605      * a <code>byte</code> in the Java programming language. <p>
606      * <!-- end generic documentation -->
607      *
608      * @param columnIndex the first column is 1, the second is 2, ...
609      * @return the column value; if the value is SQL <code>NULL</code>, the
610      * value returned is <code>0</code>
611      * @exception SQLException if a database access error occurs
612      */

613     public byte getByte(int columnIndex) throws SQLException JavaDoc {
614
615         Object JavaDoc o = getColumnInType(columnIndex, Types.TINYINT);
616
617         return o == null ? 0
618                          : ((Number JavaDoc) o).byteValue();
619     }
620
621     /**
622      * <!-- start generic documentation -->
623      * Retrieves the value of the designated column in the current row
624      * of this <code>ResultSet</code> object as
625      * a <code>short</code> in the Java programming language. <p>
626      * <!-- end generic documentation -->
627      *
628      * @param columnIndex the first column is 1, the second is 2, ...
629      * @return the column value; if the value is SQL <code>NULL</code>, the
630      * value returned is <code>0</code>
631      * @exception SQLException if a database access error occurs
632      */

633     public short getShort(int columnIndex) throws SQLException JavaDoc {
634
635         Object JavaDoc o = getColumnInType(columnIndex, Types.SMALLINT);
636
637         return o == null ? 0
638                          : ((Number JavaDoc) o).shortValue();
639     }
640
641     /**
642      * <!-- start generic documentation -->
643      * Retrieves the value of the designated column in the current row
644      * of this <code>ResultSet</code> object as
645      * an <code>int</code> in the Java programming language. <p>
646      * <!-- end generic documentation -->
647      *
648      * @param columnIndex the first column is 1, the second is 2, ...
649      * @return the column value; if the value is SQL <code>NULL</code>, the
650      * value returned is <code>0</code>
651      * @exception SQLException if a database access error occurs
652      */

653     public int getInt(int columnIndex) throws SQLException JavaDoc {
654
655         Object JavaDoc o = getColumnInType(columnIndex, Types.INTEGER);
656
657         return o == null ? 0
658                          : ((Number JavaDoc) o).intValue();
659     }
660
661     /**
662      * <!-- start generic documentation -->
663      * Retrieves the value of the designated column in the current row
664      * of this <code>ResultSet</code> object as
665      * a <code>long</code> in the Java programming language. <p>
666      * <!-- end generic documentation -->
667      *
668      * @param columnIndex the first column is 1, the second is 2, ...
669      * @return the column value; if the value is SQL <code>NULL</code>, the
670      * value returned is <code>0</code>
671      * @exception SQLException if a database access error occurs
672      */

673     public long getLong(int columnIndex) throws SQLException JavaDoc {
674
675         Object JavaDoc o = getColumnInType(columnIndex, Types.BIGINT);
676
677         return o == null ? 0
678                          : ((Number JavaDoc) o).longValue();
679     }
680
681     /**
682      * <!-- start generic documentation -->
683      * Retrieves the value of the designated column in the current row
684      * of this <code>ResultSet</code> object as
685      * a <code>float</code> in the Java programming language. <p>
686      * <!-- end generic documentation -->
687      *
688      * @param columnIndex the first column is 1, the second is 2, ...
689      * @return the column value; if the value is SQL <code>NULL</code>, the
690      * value returned is <code>0</code>
691      * @exception SQLException if a database access error occurs
692      */

693     public float getFloat(int columnIndex) throws SQLException JavaDoc {
694
695         Object JavaDoc o = getColumnInType(columnIndex, Types.REAL);
696
697         return o == null ? (float) 0.0
698                          : ((Number JavaDoc) o).floatValue();
699     }
700
701     /**
702      * <!-- start generic documentation -->
703      * Retrieves the value of the designated column in the current row
704      * of this <code>ResultSet</code> object as
705      * a <code>double</code> in the Java programming language. <p>
706      * <!-- end generic documentation -->
707      *
708      * @param columnIndex the first column is 1, the second is 2, ...
709      * @return the column value; if the value is SQL <code>NULL</code>, the
710      * value returned is <code>0</code>
711      * @exception SQLException if a database access error occurs
712      */

713     public double getDouble(int columnIndex) throws SQLException JavaDoc {
714
715         Object JavaDoc o = getColumnInType(columnIndex, Types.DOUBLE);
716
717         return o == null ? 0.0
718                          : ((Number JavaDoc) o).doubleValue();
719     }
720
721     /**
722      * <!-- start generic documentation -->
723      * Retrieves the value of the designated column in the current row
724      * of this <code>ResultSet</code> object as
725      * a <code>java.sql.BigDecimal</code> in the Java programming language.<p>
726      * <!-- end generic documentation -->
727      *
728      * <!-- start release-specific documentation -->
729      * <div class="ReleaseSpecificDocumentation">
730      * <h3>HSQLDB-Specific Information:</h3> <p>
731      *
732      * Beginning with 1.7.0, HSQLDB converts the result and sets the scale
733      * with BigDecimal.ROUND_HALF_DOWN.
734      * </div>
735      * <!-- end release-specific documentation -->
736      *
737      * @param columnIndex the first column is 1, the second is 2, ...
738      * @param scale the number of digits to the right of the decimal point
739      * @return the column value; if the value is SQL <code>NULL</code>, the
740      * value returned is <code>null</code>
741      * @exception SQLException if a database access error occurs
742      * @deprecated by java.sun.com as of JDK 1.2
743      */

744
745 //#ifdef DEPRECATEDJDBC
746
public BigDecimal JavaDoc getBigDecimal(int columnIndex,
747                                     int scale) throws SQLException JavaDoc {
748
749         // boucherb@users 20020502 - added conversion
750
BigDecimal JavaDoc bd = (BigDecimal JavaDoc) getColumnInType(columnIndex,
751             Types.DECIMAL);
752
753         if (scale < 0) {
754             throw Util.sqlException(Trace.INVALID_JDBC_ARGUMENT);
755         }
756
757         if (bd != null) {
758             bd = bd.setScale(scale, BigDecimal.ROUND_HALF_DOWN);
759         }
760
761         return bd;
762     }
763
764 //#endif
765

766     /**
767      * <!-- start generic documentation -->
768      * Retrieves the value of the designated column in the current row
769      * of this <code>ResultSet</code> object as
770      * a <code>byte</code> array in the Java programming language.
771      * The bytes represent the raw values returned by the driver. <p>
772      * <!-- end generic documentation -->
773      *
774      * <!-- start release-specific documentation -->
775      * <div class="ReleaseSpecificDocumentation">
776      * <h3>HSQLDB-Specific Information:</h3> <p>
777      *
778      * HSQLDB returns correct values for columns of type <code>BINARY</code>,
779      * <code>CHAR</code> and their variations. For other types, it returns
780      * the <code>byte[]</code> for the <code>String</code> representation
781      * of the value.
782      * </div>
783      * <!-- end release-specific documentation -->
784      *
785      * @param columnIndex the first column is 1, the second is 2, ...
786      * @return the column value; if the value is SQL <code>NULL</code>, the
787      * value returned is <code>null</code>
788      * @exception SQLException if a database access error occurs
789      */

790     public byte[] getBytes(int columnIndex) throws SQLException JavaDoc {
791
792         Object JavaDoc x = getObject(columnIndex);
793
794         if (x == null) {
795             return null;
796         }
797
798         if (x instanceof byte[]) {
799             return (byte[]) x;
800         }
801
802         if (x instanceof java.lang.String JavaDoc) {
803             return ((String JavaDoc) x).getBytes();
804         }
805
806         x = getColumnInType(columnIndex, Types.BINARY);
807
808         return (byte[]) x;
809     }
810
811     /**
812      * <!-- start generic documentation -->
813      * Retrieves the value of the designated column in the current row
814      * of this <code>ResultSet</code> object as a
815      * <code>java.sql.Date</code> object in the Java programming language.<p>
816      * <!-- end generic documentation -->
817      *
818      * @param columnIndex the first column is 1, the second is 2, ...
819      * @return the column value; if the value is SQL <code>NULL</code>, the
820      * value returned is <code>null</code>
821      * @exception SQLException if a database access error occurs
822      */

823     public Date JavaDoc getDate(int columnIndex) throws SQLException JavaDoc {
824         return (Date JavaDoc) getColumnInType(columnIndex, Types.DATE);
825     }
826
827     /**
828      * <!-- start generic documentation -->
829      * Retrieves the value of the designated column in the current row
830      * of this <code>ResultSet</code> object as a <code>java.sql.Time</code>
831      * object in the Java programming language. <p>
832      * <!-- end generic documentation -->
833      *
834      * @param columnIndex the first column is 1, the second is 2, ...
835      * @return the column value; if the value is SQL <code>NULL</code>, the
836      * value returned is <code>null</code>
837      * @exception SQLException if a database access error occurs
838      */

839     public Time JavaDoc getTime(int columnIndex) throws SQLException JavaDoc {
840         return (Time JavaDoc) getColumnInType(columnIndex, Types.TIME);
841     }
842
843     /**
844      * <!-- start generic documentation -->
845      * Retrieves the value of the designated column in the current row
846      * of this <code>ResultSet</code> object as
847      * a <code>java.sql.Timestamp</code> object in the Java programming
848      * language. <p>
849      * <!-- end generic documentation -->
850      *
851      * @param columnIndex the first column is 1, the second is 2, ...
852      * @return the column value; if the value is SQL <code>NULL</code>, the
853      * value returned is <code>null</code>
854      * @exception SQLException if a database access error occurs
855      */

856     public Timestamp JavaDoc getTimestamp(int columnIndex) throws SQLException JavaDoc {
857         return (Timestamp JavaDoc) getColumnInType(columnIndex, Types.TIMESTAMP);
858     }
859
860     /**
861      * <!-- start generic documentation -->
862      * Retrieves the value of the designated column in the current row
863      * of this <code>ResultSet</code> object as
864      * a stream of ASCII characters. The value can then be read in chunks
865      * from the stream. This method is particularly
866      * suitable for retrieving large <char>LONGVARCHAR</char> values.
867      * The JDBC driver will
868      * do any necessary conversion from the database format into ASCII.
869      *
870      * <P><B>Note:</B> All the data in the returned stream must be
871      * read prior to getting the value of any other column. The next
872      * call to a getter method implicitly closes the stream. Also, a
873      * stream may return <code>0</code> when the method
874      * <code>InputStream.available</code>
875      * is called whether there is data available or not. <p>
876      * <!-- end generic documentation -->
877      *
878      * <!-- start release-specific documentation -->
879      * <div class="ReleaseSpecificDocumentation">
880      * <h3>HSQLDB-Specific Information:</h3> <p>
881      *
882      * The limitation noted above does not apply to HSQLDB.<p>
883      *
884      * In 1.6.1 and previous, getAsciiStream was identical to
885      * getUnicodeStream and both simply returned a byte stream
886      * constructed from the raw {@link #getBytes(int) getBytes}
887      * representation.
888      *
889      * Starting with 1.7.0, this has been updated to comply with the
890      * java.sql specification.
891      *
892      * When the column is of type CHAR and its variations, it requires no
893      * conversion since it is represented internally already as a
894      * Java String object. When the column is not of type CHAR and its
895      * variations, the returned stream is based on a conversion to the
896      * Java <code>String</code> representation of the value. In either case,
897      * the obtained stream is always equivalent to a stream of the low order
898      * bytes from the value's String representation. <p>
899      *
900      * HSQLDB SQL <code>CHAR</code> and its variations are all Unicode strings
901      * internally, so the recommended alternatives to this method are
902      * {@link #getString(int) getString},
903      * {@link #getUnicodeStream(int) getUnicodeStream} (<b>deprecated</b>)
904      * and new to 1.7.0: {@link #getCharacterStream(int) getCharacterStream}
905      * (now prefered over the deprecated getUnicodeStream alternative).
906      * </div>
907      * <!-- end release-specific documentation -->
908      *
909      * @param columnIndex the first column is 1, the second is 2, ...
910      * @return a Java input stream that delivers the database column value
911      * as a stream of one-byte ASCII characters;
912      * if the value is SQL <code>NULL</code>, the
913      * value returned is <code>null</code>
914      * @exception SQLException if a database access error occurs
915      */

916     public java.io.InputStream JavaDoc getAsciiStream(int columnIndex)
917     throws SQLException JavaDoc {
918
919         String JavaDoc s = getString(columnIndex);
920
921         if (s == null) {
922             return null;
923         }
924
925         return new AsciiStringInputStream(s);
926     }
927
928     /**
929      * <!-- start generic documentation -->
930      * Retrieves the value of the designated column in the current row
931      * of this <code>ResultSet</code> object as
932      * as a stream of two-byte Unicode characters. The first byte is
933      * the high byte; the second byte is the low byte.
934      *
935      * The value can then be read in chunks from the
936      * stream. This method is particularly
937      * suitable for retrieving large <code>LONGVARCHAR</code>values. The
938      * JDBC driver will do any necessary conversion from the database
939      * format into Unicode.
940      *
941      * <P><B>Note:</B> All the data in the returned stream must be
942      * read prior to getting the value of any other column. The next
943      * call to a getter method implicitly closes the stream.
944      * Also, a stream may return <code>0</code> when the method
945      * <code>InputStream.available</code>
946      * is called, whether there is data available or not. <p>
947      * <!-- end generic documentation -->
948      *
949      * <!-- start release-specific documentation -->
950      * <div class="ReleaseSpecificDocumentation">
951      * <h3>HSQLDB-Specific Information:</h3> <p>
952      *
953      * The limitation noted above does not apply to HSQLDB.<p>
954      *
955      * Up to and including 1.6.1, getUnicodeStream (and getAsciiStream)
956      * both simply returned a byte stream constructed from the
957      * raw {@link #getBytes(int) getBytes} representation.
958      *
959      * Starting with 1.7.0, this has been corrected to comply with the
960      * java.sql specification.
961      *
962      * When the column is of type CHAR and its variations, it requires no
963      * conversion since it is represented internally already as
964      * Java Strings. When the column is not of type CHAR and its variations,
965      * the returned stream is based on a conversion to the
966      * Java <code>String</code> representation of the value. In either case,
967      * the obtained stream is always equivalent to a stream of
968      * bytes from the value's String representation, with high-byte first.
969      * </div>
970      * <!-- end release-specific documentation -->
971      *
972      * @param columnIndex the first column is 1, the second is 2, ...
973      * @return a Java input stream that delivers the database column value
974      * as a stream of two-byte Unicode characters;
975      * if the value is SQL <code>NULL</code>, the value returned is
976      * <code>null</code>
977      * @exception SQLException if a database access error occurs
978      * @deprecated use <code>getCharacterStream</code> in place of
979      * <code>getUnicodeStream</code>
980      */

981
982 //#ifdef DEPRECATEDJDBC
983
public java.io.InputStream JavaDoc getUnicodeStream(int columnIndex)
984     throws SQLException JavaDoc {
985
986         String JavaDoc s = getString(columnIndex);
987
988         if (s == null) {
989             return null;
990         }
991
992         return new StringInputStream(s);
993     }
994
995 //#endif
996

997     /**
998      * <!-- start generic documentation -->
999      * Retrieves the value of the designated column in the current row
1000     * of this <code>ResultSet</code> object as a binary stream of
1001     * uninterpreted bytes. The value can then be read in chunks from the
1002     * stream. This method is particularly
1003     * suitable for retrieving large <code>LONGVARBINARY</code> values.
1004     *
1005     * <P><B>Note:</B> All the data in the returned stream must be
1006     * read prior to getting the value of any other column. The next
1007     * call to a getter method implicitly closes the stream. Also, a
1008     * stream may return <code>0</code> when the method
1009     * <code>InputStream.available</code>
1010     * is called whether there is data available or not. <p>
1011     * <!-- end generic documentation -->
1012     *
1013     * @param columnIndex the first column is 1, the second is 2, ...
1014     * @return a Java input stream that delivers the database column value
1015     * as a stream of uninterpreted bytes;
1016     * if the value is SQL <code>NULL</code>, the value returned is
1017     * <code>null</code>
1018     * @exception SQLException if a database access error occurs
1019     */

1020// fredt@users 20020215 - patch 485704 by boucherb@users
1021
public java.io.InputStream JavaDoc getBinaryStream(int columnIndex)
1022    throws SQLException JavaDoc {
1023
1024        byte[] b = getBytes(columnIndex);
1025
1026        return wasNull() ? null
1027                         : new ByteArrayInputStream JavaDoc(b);
1028    }
1029
1030    //======================================================================
1031
// Methods for accessing results by column name
1032
//======================================================================
1033

1034    /**
1035     * <!-- start generic documentation -->
1036     * Retrieves the value of the designated column in the current row
1037     * of this <code>ResultSet</code> object as
1038     * a <code>String</code> in the Java programming language. <p>
1039     * <!-- end generic documentation -->
1040     *
1041     * @param columnName the SQL name of the column
1042     * @return the column value; if the value is SQL <code>NULL</code>, the
1043     * value returned is <code>null</code>
1044     * @exception SQLException if a database access error occurs
1045     */

1046    public String JavaDoc getString(String JavaDoc columnName) throws SQLException JavaDoc {
1047        return getString(findColumn(columnName));
1048    }
1049
1050    /**
1051     * <!-- start generic documentation -->
1052     * Retrieves the value of the designated column in the current row
1053     * of this <code>ResultSet</code> object as
1054     * a <code>boolean</code> in the Java programming language. <p>
1055     * <!-- end generic documentation -->
1056     *
1057     * @param columnName the SQL name of the column
1058     * @return the column value; if the value is SQL <code>NULL</code>, the
1059     * value returned is <code>false</code>
1060     * @exception SQLException if a database access error occurs
1061     */

1062    public boolean getBoolean(String JavaDoc columnName) throws SQLException JavaDoc {
1063        return getBoolean(findColumn(columnName));
1064    }
1065
1066    /**
1067     * <!-- start generic documentation -->
1068     * Retrieves the value of the designated column in the current row
1069     * of this <code>ResultSet</code> object as
1070     * a <code>byte</code> in the Java programming language. <p>
1071     * <!-- end generic documentation -->
1072     *
1073     * @param columnName the SQL name of the column
1074     * @return the column value; if the value is SQL <code>NULL</code>, the
1075     * value returned is <code>0</code>
1076     * @exception SQLException if a database access error occurs
1077     */

1078    public byte getByte(String JavaDoc columnName) throws SQLException JavaDoc {
1079        return getByte(findColumn(columnName));
1080    }
1081
1082    /**
1083     * <!-- start generic documentation -->
1084     * Retrieves the value of the designated column in the current row
1085     * of this <code>ResultSet</code> object as
1086     * a <code>short</code> in the Java programming language. <p>
1087     * <!-- end generic documentation -->
1088     *
1089     * @param columnName the SQL name of the column
1090     * @return the column value; if the value is SQL <code>NULL</code>, the
1091     * value returned is <code>0</code>
1092     * @exception SQLException if a database access error occurs
1093     */

1094    public short getShort(String JavaDoc columnName) throws SQLException JavaDoc {
1095        return getShort(findColumn(columnName));
1096    }
1097
1098    /**
1099     * <!-- start generic documentation -->
1100     * Retrieves the value of the designated column in the current row
1101     * of this <code>ResultSet</code> object as
1102     * an <code>int</code> in the Java programming language. <p>
1103     * <!-- end generic documentation -->
1104     *
1105     * @param columnName the SQL name of the column
1106     * @return the column value; if the value is SQL <code>NULL</code>, the
1107     * value returned is <code>0</code>
1108     * @exception SQLException if a database access error occurs
1109     */

1110    public int getInt(String JavaDoc columnName) throws SQLException JavaDoc {
1111        return getInt(findColumn(columnName));
1112    }
1113
1114    /**
1115     * <!-- start generic documentation -->
1116     * Retrieves the value of the designated column in the current row
1117     * of this <code>ResultSet</code> object as
1118     * a <code>long</code> in the Java programming language. <p>
1119     * <!-- end generic documentation -->
1120     *
1121     * @param columnName the SQL name of the column
1122     * @return the column value; if the value is SQL <code>NULL</code>, the
1123     * value returned is <code>0</code>
1124     * @exception SQLException if a database access error occurs
1125     */

1126    public long getLong(String JavaDoc columnName) throws SQLException JavaDoc {
1127        return getLong(findColumn(columnName));
1128    }
1129
1130    /**
1131     * <!-- start generic documentation -->
1132     * Retrieves the value of the designated column in the current row
1133     * of this <code>ResultSet</code> object as
1134     * a <code>float</code> in the Java programming language. <p>
1135     * <!-- end generic documentation -->
1136     *
1137     * @param columnName the SQL name of the column
1138     * @return the column value; if the value is SQL <code>NULL</code>, the
1139     * value returned is <code>0</code>
1140     * @exception SQLException if a database access error occurs
1141     */

1142    public float getFloat(String JavaDoc columnName) throws SQLException JavaDoc {
1143        return getFloat(findColumn(columnName));
1144    }
1145
1146    /**
1147     * <!-- start generic documentation -->
1148     * Retrieves the value of the designated column in the current row
1149     * of this <code>ResultSet</code> object as
1150     * a <code>double</code> in the Java programming language. <p>
1151     * <!-- end generic documentation -->
1152     *
1153     * @param columnName the SQL name of the column
1154     * @return the column value; if the value is SQL <code>NULL</code>, the
1155     * value returned is <code>0</code>
1156     * @exception SQLException if a database access error occurs
1157     */

1158    public double getDouble(String JavaDoc columnName) throws SQLException JavaDoc {
1159        return getDouble(findColumn(columnName));
1160    }
1161
1162    /**
1163     * <!-- start generic documentation -->
1164     * Retrieves the value of the designated column in the current row
1165     * of this <code>ResultSet</code> object as a
1166     * <code>java.math.BigDecimal</code> in the Java programming language.<p>
1167     * <!-- end generic documentation -->
1168     *
1169     * <!-- start release-specific documentation -->
1170     * <div class="ReleaseSpecificDocumentation">
1171     * <h3>HSQLDB-Specific Information:</h3> <p>
1172     *
1173     * Beginning with 1.7.0, HSQLDB converts the result and sets the scale
1174     * with BigDecimal.ROUND_HALF_DOWN.
1175     * </div>
1176     * <!-- end release-specific documentation -->
1177     *
1178     * @param columnName the SQL name of the column
1179     * @param scale the number of digits to the right of the decimal point
1180     * @return the column value; if the value is SQL <code>NULL</code>, the
1181     * value returned is <code>null</code>
1182     * @exception SQLException if a database access error occurs
1183     * @deprecated by java.sun.com as of JDK 1.2
1184     */

1185
1186//#ifdef DEPRECATEDJDBC
1187
public BigDecimal JavaDoc getBigDecimal(String JavaDoc columnName,
1188                                    int scale) throws SQLException JavaDoc {
1189        return getBigDecimal(findColumn(columnName), scale);
1190    }
1191
1192//#endif
1193

1194    /**
1195     * <!-- start generic documentation -->
1196     * Retrieves the value of the designated column in the current row
1197     * of this <code>ResultSet</code> object as
1198     * a <code>byte</code> array in the Java programming language.
1199     * The bytes represent the raw values returned by the driver. <p>
1200     * <!-- end generic documentation -->
1201     *
1202     * @param columnName the SQL name of the column
1203     * @return the column value; if the value is SQL <code>NULL</code>, the
1204     * value returned is <code>null</code>
1205     * @exception SQLException if a database access error occurs
1206     */

1207    public byte[] getBytes(String JavaDoc columnName) throws SQLException JavaDoc {
1208        return getBytes(findColumn(columnName));
1209    }
1210
1211    /**
1212     * <!-- start generic documentation -->
1213     * Retrieves the value of the designated column in the current row
1214     * of this <code>ResultSet</code> object as a
1215     * <code>java.sql.Date</code> object in the Java programming language.<p>
1216     * <!-- end generic documentation -->
1217     *
1218     * @param columnName the SQL name of the column
1219     * @return the column value; if the value is SQL <code>NULL</code>, the
1220     * value returned is <code>null</code>
1221     * @exception SQLException if a database access error occurs
1222     */

1223    public Date JavaDoc getDate(String JavaDoc columnName) throws SQLException JavaDoc {
1224        return getDate(findColumn(columnName));
1225    }
1226
1227    /**
1228     * <!-- start generic documentation -->
1229     * Retrieves the value of the designated column in the current row
1230     * of this <code>ResultSet</code> object as a <code>java.sql.Time</code>
1231     * object in the Java programming language. <p>
1232     * <!-- end generic documentation -->
1233     *
1234     * @param columnName the SQL name of the column
1235     * @return the column value;
1236     * if the value is SQL <code>NULL</code>,
1237     * the value returned is <code>null</code>
1238     * @exception SQLException if a database access error occurs
1239     */

1240    public Time JavaDoc getTime(String JavaDoc columnName) throws SQLException JavaDoc {
1241        return getTime(findColumn(columnName));
1242    }
1243
1244    /**
1245     * <!-- start generic documentation -->
1246     * Retrieves the value of the designated column in the current row
1247     * of this <code>ResultSet</code> object as
1248     * a <code>java.sql.Timestamp</code> object. <p>
1249     * <!-- end generic documentation -->
1250     *
1251     * @param columnName the SQL name of the column
1252     * @return the column value; if the value is SQL <code>NULL</code>, the
1253     * value returned is <code>null</code>
1254     * @exception SQLException if a database access error occurs
1255     */

1256    public Timestamp JavaDoc getTimestamp(String JavaDoc columnName) throws SQLException JavaDoc {
1257        return getTimestamp(findColumn(columnName));
1258    }
1259
1260    /**
1261     * <!-- start generic documentation -->
1262     * Retrieves the value of the designated column in the current row
1263     * of this <code>ResultSet</code> object as a stream of
1264     * ASCII characters. The value can then be read in chunks from the
1265     * stream. This method is particularly
1266     * suitable for retrieving large <code>LONGVARCHAR</code> values.
1267     * The JDBC driver will
1268     * do any necessary conversion from the database format into ASCII.
1269     *
1270     * <P><B>Note:</B> All the data in the returned stream must be
1271     * read prior to getting the value of any other column. The next
1272     * call to a getter method implicitly closes the stream. Also, a
1273     * stream may return <code>0</code> when the method <code>available</code>
1274     * is called whether there is data available or not. <p>
1275     * <!-- end generic documentation -->
1276     *
1277     * @param columnName the SQL name of the column
1278     * @return a Java input stream that delivers the database column value
1279     * as a stream of one-byte ASCII characters.
1280     * If the value is SQL <code>NULL</code>,
1281     * the value returned is <code>null</code>.
1282     * @exception SQLException if a database access error occurs
1283     * @see #getAsciiStream(int)
1284     */

1285    public java.io.InputStream JavaDoc getAsciiStream(String JavaDoc columnName)
1286    throws SQLException JavaDoc {
1287        return getAsciiStream(findColumn(columnName));
1288    }
1289
1290    /**
1291     * <!-- start generic documentation -->
1292     * Retrieves the value of the designated column in the current row
1293     * of this <code>ResultSet</code> object as a stream of two-byte
1294     * Unicode characters. The first byte is the high byte; the second
1295     * byte is the low byte.
1296     *
1297     * The value can then be read in chunks from the
1298     * stream. This method is particularly
1299     * suitable for retrieving large <code>LONGVARCHAR</code> values.
1300     * The JDBC technology-enabled driver will
1301     * do any necessary conversion from the database format into Unicode.
1302     *
1303     * <P><B>Note:</B> All the data in the returned stream must be
1304     * read prior to getting the value of any other column. The next
1305     * call to a getter method implicitly closes the stream.
1306     * Also, a stream may return <code>0</code> when the method
1307     * <code>InputStream.available</code> is called, whether there
1308     * is data available or not. <p>
1309     * <!-- end generic documentation -->
1310     *
1311     * @param columnName the SQL name of the column
1312     * @return a Java input stream that delivers the database column value
1313     * as a stream of two-byte Unicode characters.
1314     * If the value is SQL <code>NULL</code>, the value returned
1315     * is <code>null</code>.
1316     * @exception SQLException if a database access error occurs
1317     * @deprecated use <code>getCharacterStream</code> instead
1318     * @see #getUnicodeStream(int)
1319     */

1320
1321//#ifdef DEPRECATEDJDBC
1322
public java.io.InputStream JavaDoc getUnicodeStream(String JavaDoc columnName)
1323    throws SQLException JavaDoc {
1324        return getUnicodeStream(findColumn(columnName));
1325    }
1326
1327//#endif
1328

1329    /**
1330     * <!-- start generic documentation -->
1331     * Retrieves the value of the designated column in the current row
1332     * of this <code>ResultSet</code> object as a stream of uninterpreted
1333     * <code>byte</code>s.
1334     * The value can then be read in chunks from the
1335     * stream. This method is particularly
1336     * suitable for retrieving large <code>LONGVARBINARY</code>
1337     * values.
1338     *
1339     * <P><B>Note:</B> All the data in the returned stream must be
1340     * read prior to getting the value of any other column. The next
1341     * call to a getter method implicitly closes the stream. Also, a
1342     * stream may return <code>0</code> when the method <code>available</code>
1343     * is called whether there is data available or not. <p>
1344     * <!-- end generic documentation -->
1345     *
1346     * @param columnName the SQL name of the column
1347     * @return a Java input stream that delivers the database column value
1348     * as a stream of uninterpreted bytes;
1349     * if the value is SQL <code>NULL</code>, the result is <code>null</code>
1350     * @exception SQLException if a database access error occurs
1351     */

1352    public java.io.InputStream JavaDoc getBinaryStream(String JavaDoc columnName)
1353    throws SQLException JavaDoc {
1354        return getBinaryStream(findColumn(columnName));
1355    }
1356
1357    //=====================================================================
1358
// Advanced features:
1359
//=====================================================================
1360

1361    /**
1362     * <!-- start generic documentation -->
1363     * Retrieves the first warning reported by calls on this
1364     * <code>ResultSet</code> object.
1365     * Subsequent warnings on this <code>ResultSet</code> object
1366     * will be chained to the <code>SQLWarning</code> object that
1367     * this method returns.
1368     *
1369     * <P>The warning chain is automatically cleared each time a new
1370     * row is read. This method may not be called on a <code>ResultSet</code>
1371     * object that has been closed; doing so will cause an
1372     * <code>SQLException</code> to be thrown.
1373     * <P>
1374     * <B>Note:</B> This warning chain only covers warnings caused
1375     * by <code>ResultSet</code> methods. Any warning caused by
1376     * <code>Statement</code> methods
1377     * (such as reading OUT parameters) will be chained on the
1378     * <code>Statement</code> object. <p>
1379     * <!-- end generic documentation -->
1380     *
1381     * <!-- start release-specific documentation -->
1382     * <div class="ReleaseSpecificDocumentation">
1383     * <h3>HSQLDB-Specific Information:</h3> <p>
1384     *
1385     * Up to and including 1.7.1, HSQLDB does not produce
1386     * <code>SQLWarning</code> objects. This method always returns
1387     * <code>null</code>.
1388     * </div>
1389     * <!-- end release-specific documentation -->
1390     *
1391     * @return the first <code>SQLWarning</code> object reported or
1392     * <code>null</code> if there are none <p>
1393     *
1394     * Up to and including 1.7.1, HSQLDB always returns null. <p>
1395     * @exception SQLException if a database access error occurs or this
1396     * method is called on a closed result set
1397     */

1398    public SQLWarning JavaDoc getWarnings() throws SQLException JavaDoc {
1399        return null;
1400    }
1401
1402    /**
1403     * <!-- start generic documentation -->
1404     * Clears all warnings reported on this <code>ResultSet</code> object.
1405     * After this method is called, the method <code>getWarnings</code>
1406     * returns <code>null</code> until a new warning is
1407     * reported for this <code>ResultSet</code> object. <p>
1408     * <!-- end generic documentation -->
1409     *
1410     * <!-- start release-specific documentation -->
1411     * <div class="ReleaseSpecificDocumentation">
1412     * <h3>HSQLDB-Specific Information:</h3> <p>
1413     *
1414     * Including 1.7.1, HSQLDB does not produce <code>SQLWarning</code>
1415     * objects on any ResultSet object warning chain; calls to this method
1416     * are ignored.
1417     * </div>
1418     * <!-- end release-specific documentation -->
1419     *
1420     * @exception SQLException if a database access error occurs
1421     */

1422    public void clearWarnings() throws SQLException JavaDoc {}
1423
1424    /**
1425     * <!-- start generic documentation -->
1426     * Retrieves the name of the SQL cursor used by this
1427     * <code>ResultSet</code> object.
1428     *
1429     * <P>In SQL, a result table is retrieved through a cursor that is
1430     * named. The current row of a result set can be updated or deleted
1431     * using a positioned update/delete statement that references the
1432     * cursor name. To insure that the cursor has the proper isolation
1433     * level to support update, the cursor's <code>SELECT</code> statement
1434     * should be of the form <code>SELECT FOR UPDATE</code>. If
1435     * <code>FOR UPDATE</code> is omitted, the positioned updates may fail.
1436     *
1437     * <P>The JDBC API supports this SQL feature by providing the name of the
1438     * SQL cursor used by a <code>ResultSet</code> object.
1439     * The current row of a <code>ResultSet</code> object
1440     * is also the current row of this SQL cursor.
1441     *
1442     * <P><B>Note:</B> If positioned update is not supported, a
1443     * <code>SQLException</code> is thrown. <p>
1444     * <!-- end generic documentation -->
1445     *
1446     * <!-- start release-specific documentation -->
1447     * <div class="ReleaseSpecificDocumentation">
1448     * <h3>HSQLDB-Specific Information:</h3> <p>
1449     *
1450     * Including 1.7.2, HSQLDB does not support this feature. <p>
1451     *
1452     * Calling this method always throws an <code>SQLException</code>,
1453     * stating that the operation is not supported.
1454     * </div>
1455     * <!-- end release-specific documentation -->
1456     *
1457     * @return the SQL name for this <code>ResultSet</code> object's cursor
1458     * @exception SQLException if a database access error occurs
1459     */

1460    public String JavaDoc getCursorName() throws SQLException JavaDoc {
1461        throw Util.notSupported();
1462    }
1463
1464    /**
1465     * <!-- start generic documentation -->
1466     * Retrieves the number, types and properties of
1467     * this <code>ResultSet</code> object's columns. <p>
1468     * <!-- end generic documentation -->
1469     *
1470     * <!-- start release-specific documentation -->
1471     * <div class="ReleaseSpecificDocumentation">
1472     * <h3>HSQLDB-Specific Information:</h3> <p>
1473     *
1474     * <B>Example:</B> <p>
1475     *
1476     * The following code fragment creates a <code>ResultSet</code> object rs,
1477     * creates a <code>ResultSetMetaData</code> object rsmd, and uses rsmd
1478     * to find out how many columns rs has and whether the first column
1479     * in rs can be used in a <code>WHERE</code> clause. <p>
1480     *
1481     * <pre class="JavaCodeExample">
1482     * ResultSet rs = stmt.<b>executeQuery</b>(<span class="JavaStringLiteral">"SELECT a, b, c FROM TABLE2"</span>);
1483     * ResultSetMetaData rsmd = rs.<b>getMetaData</b>();<br>
1484     * int numberOfColumns = rsmd.<b>getColumnCount</b>();<br>
1485     * boolean b = rsmd.<b>isSearchable</b>(1);<br>
1486     * </pre>
1487     *
1488     * <hr>
1489     *
1490     * <B>Warning:</B> <p>
1491     *
1492     * Including 1.7.1, HSQLDB did not generate accurate
1493     * <code>ResultSetMetaData</code>. Below were the the most important
1494     * methods to consider: <p>
1495     *
1496     * <ol>
1497     * <li>isAutoIncrement(int) <i>always</i> returned <code>false</code></li>
1498     * <li>isCurrency(int) <i>always</i> returned <code>false</code></li>
1499     * <li>isNullable(int) <i>always</i> returned
1500     * <code>columnNullableUnknown</code></li>
1501     * <li>getColumnDisplaySize(int) returned zero for all valid column
1502     * numbers</li>
1503     * <li>getSchemaName(int) <i>always</i> returned
1504     * <span class="JavaStringLiteral">""</span></li>
1505     * <li>getPrecision(int) <i>always</i> returned zero</li>
1506     * <li>getScale(int) <i>always</i> returned zero</li>
1507     * <li>getCatalogName(int) <i>always</i> returned
1508     * <span class="JavaStringLiteral">""</span></li>
1509     * </ol> <p>
1510     *
1511     * <hr>
1512     *
1513     * Starting with 1.7.2, ResultSetMetaData has been split out into its own
1514     * interface implemenation (jdbcResultSetMetaData), support has been
1515     * improved considerably for a number of methods and behaviour has
1516     * been altered slightly in many areas.
1517     * </div>
1518     * <!-- end release-specific documentation -->
1519     *
1520     * @return the description of this <code>ResultSet</code> object's columns
1521     * @exception SQLException if a database access error occurs
1522     * @see jdbcResultSetMetaData
1523     */

1524    public ResultSetMetaData JavaDoc getMetaData() throws SQLException JavaDoc {
1525
1526        if (rsmd == null) {
1527            rsmd = new jdbcResultSetMetaData(this, connProperties);
1528        }
1529
1530        return rsmd;
1531    }
1532
1533    /**
1534     * <!-- start generic documentation -->
1535     * Gets the value of the designated column in the current row
1536     * of this <code>ResultSet</code> object as
1537     * an <code>Object</code> in the Java programming language.
1538     *
1539     * <p>This method will return the value of the given column as a
1540     * Java object. The type of the Java object will be the default
1541     * Java object type corresponding to the column's SQL type,
1542     * following the mapping for built-in types specified in the JDBC
1543     * specification. If the value is an SQL <code>NULL</code>,
1544     * the driver returns a Java <code>null</code>.
1545     *
1546     * <p>This method may also be used to read datatabase-specific
1547     * abstract data types.
1548     *
1549     * In the JDBC 2.0 API, the behavior of method
1550     * <code>getObject</code> is extended to materialize
1551     * data of SQL user-defined types. When a column contains
1552     * a structured or distinct value, the behavior of this method is as
1553     * if it were a call to: <code>getObject(columnIndex,
1554     * this.getStatement().getConnection().getTypeMap())</code>. <p>
1555     * <!-- end generic documentation -->
1556     *
1557     * @param columnIndex the first column is 1, the second is 2, ...
1558     * @return a <code>java.lang.Object</code> holding the column value
1559     * @exception SQLException if a database access error occurs
1560     */

1561    public Object JavaDoc getObject(int columnIndex) throws SQLException JavaDoc {
1562
1563        checkAvailable();
1564
1565        Object JavaDoc o;
1566        int t;
1567
1568        try {
1569            o = nCurrent.data[--columnIndex];
1570            t = rResult.metaData.colTypes[columnIndex];
1571        } catch (ArrayIndexOutOfBoundsException JavaDoc e) {
1572            throw Util.sqlException(Trace.COLUMN_NOT_FOUND,
1573                                    String.valueOf(++columnIndex));
1574        }
1575
1576        // use checknull because getColumnInType is not used
1577
if (checkNull(o)) {
1578            return null;
1579        }
1580
1581        switch (t) {
1582
1583            case Types.DATE :
1584                return new Date JavaDoc(((Date JavaDoc) o).getTime());
1585
1586            case Types.TIME :
1587                return new Time JavaDoc(((Time JavaDoc) o).getTime());
1588
1589            case Types.TIMESTAMP :
1590                long m = ((Timestamp JavaDoc) o).getTime();
1591                int n = ((Timestamp JavaDoc) o).getNanos();
1592                Timestamp JavaDoc ts = new Timestamp JavaDoc(m);
1593
1594                ts.setNanos(n);
1595
1596                return ts;
1597
1598            case Types.OTHER :
1599            case Types.JAVA_OBJECT :
1600                try {
1601                    return ((JavaObject) o).getObject();
1602                } catch (HsqlException e) {
1603                    throw Util.sqlException(
1604                        Trace.error(Trace.SERIALIZATION_FAILURE));
1605                }
1606            case Types.BINARY :
1607            case Types.VARBINARY :
1608            case Types.LONGVARBINARY :
1609                return ((Binary) o).getClonedBytes();
1610
1611            default :
1612                return o;
1613        }
1614    }
1615
1616    /**
1617     * <!-- start generic documentation -->
1618     * Gets the value of the designated column in the current row
1619     * of this <code>ResultSet</code> object as
1620     * an <code>Object</code> in the Java programming language.
1621     *
1622     * <p>This method will return the value of the given column as a
1623     * Java object. The type of the Java object will be the default
1624     * Java object type corresponding to the column's SQL type,
1625     * following the mapping for built-in types specified in the JDBC
1626     * specification. If the value is an SQL <code>NULL</code>,
1627     * the driver returns a Java <code>null</code>.
1628     * <P>
1629     * This method may also be used to read datatabase-specific
1630     * abstract data types.
1631     * <P>
1632     * In the JDBC 2.0 API, the behavior of the method
1633     * <code>getObject</code> is extended to materialize
1634     * data of SQL user-defined types. When a column contains
1635     * a structured or distinct value, the behavior of this method is as
1636     * if it were a call to: <code>getObject(columnIndex,
1637     * this.getStatement().getConnection().getTypeMap())</code>. <p>
1638     * <!-- end generic documentation -->
1639     *
1640     * @param columnName the SQL name of the column
1641     * @return a <code>java.lang.Object</code> holding the column value
1642     * @exception SQLException if a database access error occurs
1643     */

1644    public Object JavaDoc getObject(String JavaDoc columnName) throws SQLException JavaDoc {
1645        return getObject(findColumn(columnName));
1646    }
1647
1648    //----------------------------------------------------------------
1649

1650    /**
1651     * <!-- start generic documentation -->
1652     * Maps the given <code>ResultSet</code> column name to its
1653     * <code>ResultSet</code> column index. <p>
1654     * <!-- end generic documentation -->
1655     *
1656     * @param columnName the name of the column
1657     * @return the column index of the given column name
1658     * @exception SQLException if the <code>ResultSet</code> object does not
1659     * contain <code>columnName</code> or a database access error occurs
1660     */

1661    public int findColumn(String JavaDoc columnName) throws SQLException JavaDoc {
1662
1663        for (int i = 0; i < iColumnCount; i++) {
1664            String JavaDoc name = rResult.metaData.colLabels[i];
1665
1666            if (columnName.equalsIgnoreCase(name)) {
1667                return i + 1;
1668            }
1669        }
1670
1671        throw Util.sqlException(Trace.COLUMN_NOT_FOUND, columnName);
1672    }
1673
1674    //--------------------------JDBC 2.0-----------------------------------
1675
//---------------------------------------------------------------------
1676
// Getters and Setters
1677
//---------------------------------------------------------------------
1678

1679    /**
1680     * <!-- start generic documentation -->
1681     * Retrieves the value of the designated column in the current row
1682     * of this <code>ResultSet</code> object as a
1683     * <code>java.io.Reader</code> object. <p>
1684     * <!-- end generic documentation -->
1685     *
1686     * <!-- start release-specific documentation -->
1687     * <div class="ReleaseSpecificDocumentation">
1688     * <h3>HSQLDB-Specific Information:</h3> <p>
1689     *
1690     * Starting with 1.7.0. HSQLDB supports this.
1691     * </div>
1692     * <!-- end release-specific documentation -->
1693     *
1694     * @return a <code>java.io.Reader</code> object that contains the column
1695     * value; if the value is SQL <code>NULL</code>, the value returned
1696     * is <code>null</code> in the Java programming language.
1697     * @param columnIndex the first column is 1, the second is 2, ...
1698     * @exception SQLException if a database access error occurs
1699     * @since JDK 1.2
1700     */

1701    public java.io.Reader JavaDoc getCharacterStream(int columnIndex)
1702    throws SQLException JavaDoc {
1703
1704        String JavaDoc s = getString(columnIndex);
1705
1706        if (s == null) {
1707            return null;
1708        }
1709
1710        return new StringReader JavaDoc(s);
1711    }
1712
1713    /**
1714     * <!-- start generic documentation -->
1715     * Retrieves the value of the designated column in the current row
1716     * of this <code>ResultSet</code> object as a
1717     * <code>java.io.Reader</code> object. <p>
1718     * <!-- end generic documentation -->
1719     *
1720     * <!-- start release-specific documentation -->
1721     * <div class="ReleaseSpecificDocumentation">
1722     * <h3>HSQLDB-Specific Information:</h3> <p>
1723     *
1724     * Starting with 1.7.0, HSQLDB supports this.
1725     * </div>
1726     * <!-- end release-specific documentation -->
1727     *
1728     * @param columnName the name of the column
1729     * @return a <code>java.io.Reader</code> object that contains the column
1730     * value; if the value is SQL <code>NULL</code>, the value returned is
1731     * <code>null</code> in the Java programming language
1732     * @exception SQLException if a database access error occurs
1733     * @since JDK 1.2
1734     */

1735    public java.io.Reader JavaDoc getCharacterStream(String JavaDoc columnName)
1736    throws SQLException JavaDoc {
1737        return getCharacterStream(findColumn(columnName));
1738    }
1739
1740    /**
1741     * <!-- start generic documentation -->
1742     * Retrieves the value of the designated column in the current row
1743     * of this <code>ResultSet</code> object as a
1744     * <code>java.math.BigDecimal</code> with full precision. <p>
1745     * <!-- end generic documentation -->
1746     *
1747     * @param columnIndex the first column is 1, the second is 2, ...
1748     * @return the column value (full precision);
1749     * if the value is SQL <code>NULL</code>, the value returned is
1750     * <code>null</code> in the Java programming language.
1751     * @exception SQLException if a database access error occurs
1752     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
1753     * jdbcResultSet)
1754     */

1755    public BigDecimal JavaDoc getBigDecimal(int columnIndex) throws SQLException JavaDoc {
1756        return (BigDecimal JavaDoc) getColumnInType(columnIndex, Types.DECIMAL);
1757    }
1758
1759    /**
1760     * <!-- start generic documentation -->
1761     * Retrieves the value of the designated column in the current row
1762     * of this <code>ResultSet</code> object as a
1763     * <code>java.math.BigDecimal</code> with full precision. <p>
1764     * <!-- end generic documentation -->
1765     *
1766     * @param columnName the column name
1767     * @return the column value (full precision);
1768     * if the value is SQL <code>NULL</code>, the value returned is
1769     * <code>null</code> in the Java programming language.
1770     * @exception SQLException if a database access error occurs
1771     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
1772     * jdbcResultSet)
1773     */

1774    public BigDecimal JavaDoc getBigDecimal(String JavaDoc columnName) throws SQLException JavaDoc {
1775        return getBigDecimal(findColumn(columnName));
1776    }
1777
1778    //---------------------------------------------------------------------
1779
// Traversal/Positioning
1780
//---------------------------------------------------------------------
1781

1782    /**
1783     * <!-- start generic documentation -->
1784     * Retrieves whether the cursor is before the first row in
1785     * this <code>ResultSet</code> object. <p>
1786     * <!-- end generic documentation -->
1787     *
1788     * @return <code>true</code> if the cursor is before the first row;
1789     * <code>false</code> if the cursor is at any other position or the
1790     * result set contains no rows
1791     * @exception SQLException if a database access error occurs
1792     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
1793     * jdbcResultSet)
1794     */

1795    public boolean isBeforeFirst() throws SQLException JavaDoc {
1796
1797        // bInit indicates whether the resultset has not been traversed or not
1798
// true - it has ---- false it hasn't
1799
checkClosed();
1800
1801        return rResult.rRoot != null &&!bInit;
1802
1803        // End New Cose
1804
}
1805
1806    /**
1807     * <!-- start generic documentation -->
1808     * Retrieves whether the cursor is after the last row in
1809     * this <code>ResultSet</code> object. <p>
1810     * <!-- end generic documentation -->
1811     *
1812     * @return <code>true</code> if the cursor is after the last row;
1813     * <code>false</code> if the cursor is at any other position or the
1814     * result set contains no rows
1815     * @exception SQLException if a database access error occurs
1816     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
1817     * jdbcResultSet)
1818     */

1819    public boolean isAfterLast() throws SQLException JavaDoc {
1820
1821        // At afterLast condition exists when resultset has been traversed and
1822
// the current row is null. iCurrentRow should also be set to
1823
// afterlast but no need to test
1824
checkClosed();
1825
1826        return rResult.rRoot != null && bInit && nCurrent == null;
1827    }
1828
1829    /**
1830     * <!-- start generic documentation -->
1831     * Retrieves whether the cursor is on the first row of
1832     * this <code>ResultSet</code> object. <p>
1833     * <!-- end generic documentation -->
1834     *
1835     * @return <code>true</code> if the cursor is on the first row;
1836     * <code>false</code> otherwise
1837     * @exception SQLException if a database access error occurs
1838     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
1839     * jdbcResultSet)
1840     */

1841    public boolean isFirst() throws SQLException JavaDoc {
1842
1843        checkClosed();
1844
1845        return iCurrentRow == 1;
1846    }
1847
1848    /**
1849     * <!-- start generic documentation -->
1850     * Retrieves whether the cursor is on the last row of
1851     * this <code>ResultSet</code> object.
1852     * Note: Calling the method <code>isLast</code> may be expensive
1853     * because the JDBC driver
1854     * might need to fetch ahead one row in order to determine
1855     * whether the current row is the last row in the result set. <p>
1856     * <!-- end generic documentation -->
1857     *
1858     * <!-- start release-specific documentation -->
1859     * <div class="ReleaseSpecificDocumentation">
1860     * <h3>HSQLDB-Specific Information:</h3> <p>
1861     *
1862     * Including 1.7.2, this method is not terribly expensive;
1863     * the entire result is fetched internally before this object
1864     * is returned to a caller.
1865     * </div>
1866     * <!-- end release-specific documentation -->
1867     *
1868     * @return <code>true</code> if the cursor is on the last row;
1869     * <code>false</code> otherwise
1870     * @exception SQLException if a database access error occurs
1871     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
1872     * jdbcResultSet)
1873     */

1874    public boolean isLast() throws SQLException JavaDoc {
1875
1876        checkClosed();
1877
1878        // If the resultset has not been traversed, then exit with false
1879
// At the last row if the next row is null
1880
return rResult.rRoot != null && bInit && nCurrent != null
1881               && nCurrent.next == null;
1882    }
1883
1884    /**
1885     * <!-- start generic documentation -->
1886     * Moves the cursor to the front of
1887     * this <code>ResultSet</code> object, just before the
1888     * first row. This method has no effect if the result set contains
1889     * no rows.<p>
1890     * <!-- end generic documentation -->
1891     *
1892     * @exception SQLException if a database access error
1893     * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
1894     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
1895     * jdbcResultSet)
1896     */

1897    public void beforeFirst() throws SQLException JavaDoc {
1898
1899        checkClosed();
1900
1901        if (this.getType() == TYPE_FORWARD_ONLY) {
1902            throw Util.sqlException(Trace.RESULTSET_FORWARD_ONLY);
1903        }
1904
1905        // Set to beforeFirst status
1906
bInit = false;
1907        nCurrent = null;
1908        iCurrentRow = 0;
1909    }
1910
1911    /**
1912     * <!-- start generic documentation -->
1913     * Moves the cursor to the end of
1914     * this <code>ResultSet</code> object, just after the last row. This
1915     * method has no effect if the result set contains no rows. <p>
1916     * <!-- end generic documentation -->
1917     *
1918     * @exception SQLException if a database access error
1919     * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
1920     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
1921     * jdbcResultSet)
1922     */

1923    public void afterLast() throws SQLException JavaDoc {
1924
1925        checkClosed();
1926
1927        if (this.getType() == TYPE_FORWARD_ONLY) {
1928            throw Util.sqlException(Trace.RESULTSET_FORWARD_ONLY);
1929        }
1930
1931        if (rResult != null && rResult.rRoot != null) {
1932
1933            // not an empty resultset, so set the afterLast status
1934
bInit = true;
1935            iCurrentRow = rResult.getSize() + 1;
1936            nCurrent = null;
1937        }
1938    }
1939
1940    /**
1941     * <!-- start generic documentation -->
1942     * Moves the cursor to the first row in
1943     * this <code>ResultSet</code> object. <p>
1944     * <!-- end generic documentation -->
1945     *
1946     * @return <code>true</code> if the cursor is on a valid row;
1947     * <code>false</code> if there are no rows in the result set
1948     * @exception SQLException if a database access error
1949     * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
1950     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
1951     * jdbcResultSet)
1952     */

1953    public boolean first() throws SQLException JavaDoc {
1954
1955        checkClosed();
1956
1957        if (this.getType() == TYPE_FORWARD_ONLY) {
1958            throw Util.sqlException(Trace.RESULTSET_FORWARD_ONLY);
1959        }
1960
1961        if (rResult == null) {
1962            return false;
1963        }
1964
1965        bInit = false;
1966
1967        if (rResult.rRoot != null) {
1968            bInit = true;
1969            nCurrent = rResult.rRoot;
1970            iCurrentRow = 1;
1971        }
1972
1973        return bInit;
1974    }
1975
1976    /**
1977     * <!-- start generic documentation -->
1978     * Moves the cursor to the last row in
1979     * this <code>ResultSet</code> object. <p>
1980     * <!-- end generic documentation -->
1981     *
1982     * @return <code>true</code> if the cursor is on a valid row;
1983     * <code>false</code> if there are no rows in the result set
1984     * @exception SQLException if a database access error
1985     * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
1986     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
1987     * jdbcResultSet)
1988     */

1989    public boolean last() throws SQLException JavaDoc {
1990
1991        checkClosed();
1992
1993        if (this.getType() == TYPE_FORWARD_ONLY) {
1994            throw Util.sqlException(Trace.RESULTSET_FORWARD_ONLY);
1995        }
1996
1997        if (rResult == null) {
1998            return false;
1999        }
2000
2001        if (rResult.rRoot == null) {
2002            return false;
2003        }
2004
2005        // it resultset not traversed yet, set to first row
2006
if (!bInit || nCurrent == null) {
2007            first();
2008        }
2009
2010        // go to the last row
2011
while (nCurrent.next != null) {
2012            iCurrentRow++;
2013
2014            nCurrent = nCurrent.next;
2015        }
2016
2017        return true;
2018    }
2019
2020    /**
2021     * <!-- start generic documentation -->
2022     * Retrieves the current row number. The first row is number 1, the
2023     * second number 2, and so on. <p>
2024     * <!-- end generic documentation -->
2025     *
2026     * @return the current row number; <code>0</code> if there is no current
2027     * row
2028     * @exception SQLException if a database access error occurs
2029     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2030     * jdbcResultSet)
2031     */

2032    public int getRow() throws SQLException JavaDoc {
2033
2034        checkClosed();
2035
2036        return iCurrentRow;
2037    }
2038
2039    /**
2040     * <!-- start generic documentation -->
2041     * Moves the cursor to the given row number in
2042     * this <code>ResultSet</code> object.
2043     *
2044     * <p>If the row number is positive, the cursor moves to
2045     * the given row number with respect to the
2046     * beginning of the result set. The first row is row 1, the second
2047     * is row 2, and so on.
2048     *
2049     * <p>If the given row number is negative, the cursor moves to
2050     * an absolute row position with respect to
2051     * the end of the result set. For example, calling the method
2052     * <code>absolute(-1)</code> positions the
2053     * cursor on the last row; calling the method <code>absolute(-2)</code>
2054     * moves the cursor to the next-to-last row, and so on.
2055     *
2056     * <p>An attempt to position the cursor beyond the first/last row in
2057     * the result set leaves the cursor before the first row or after
2058     * the last row.
2059     *
2060     * <p><B>Note:</B> Calling <code>absolute(1)</code> is the same
2061     * as calling <code>first()</code>. Calling <code>absolute(-1)</code>
2062     * is the same as calling <code>last()</code>. <p>
2063     * <!-- end generic documentation -->
2064     *
2065     * @param row the number of the row to which the cursor should move.
2066     * A positive number indicates the row number counting from the
2067     * beginning of the result set; a negative number indicates the
2068     * row number counting from the end of the result set
2069     * @return <code>true</code> if the cursor is on the result set;
2070     * <code>false</code> otherwise
2071     * @exception SQLException if a database access error
2072     * occurs, or the result set type is <code>TYPE_FORWARD_ONLY</code>
2073     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2074     * jdbcResultSet)
2075     */

2076    public boolean absolute(int row) throws SQLException JavaDoc {
2077
2078        checkClosed();
2079
2080        if (this.getType() == TYPE_FORWARD_ONLY) {
2081            throw Util.sqlException(Trace.RESULTSET_FORWARD_ONLY);
2082        }
2083
2084        if (rResult == null) {
2085            return false;
2086        }
2087
2088        if (rResult.rRoot == null || row == 0) {
2089
2090            // No rows in the resultset or tried to execute absolute(0)
2091
// which is not valid
2092
return false;
2093        }
2094
2095        // A couple of special cases
2096
switch (row) {
2097
2098            case 1 :
2099                return first(); // absolute(1) is same as first()
2100

2101            case -1 :
2102                return last(); // absolute(-1) is same as last()
2103
}
2104
2105        // If the row variable is negative, calculate the target
2106
// row from the end of the resultset.
2107
if (row < 0) {
2108
2109            // we know there are rows in resultset, so get the last
2110
last();
2111
2112            // calculate the target row
2113
row = iCurrentRow + row + 1;
2114
2115            // Exit if the target row is before the beginning of the resultset
2116
if (row <= 0) {
2117                beforeFirst();
2118
2119                return false;
2120            }
2121        }
2122
2123        if (row < iCurrentRow || iCurrentRow == 0) {
2124
2125            // Need to go back and start from the beginning of the resultset
2126
beforeFirst();
2127        }
2128
2129        // go to the tagget row;
2130
while (row > iCurrentRow) {
2131            next();
2132
2133            if (nCurrent == null) {
2134                break;
2135            }
2136        }
2137
2138        return nCurrent != null;
2139    }
2140
2141    /**
2142     * <!-- start generic documentation -->
2143     * Moves the cursor a relative number of rows, either positive or
2144     * negative. Attempting to move beyond the first/last row in the
2145     * result set positions the cursor before/after the
2146     * the first/last row. Calling <code>relative(0)</code> is valid, but does
2147     * not change the cursor position.
2148     *
2149     * <p>Note: Calling the method <code>relative(1)</code>
2150     * is identical to calling the method <code>next()</code> and
2151     * calling the method <code>relative(-1)</code> is identical
2152     * to calling the method <code>previous()</code>. <p>
2153     * <!-- end generic documentation -->
2154     *
2155     * @param rows an <code>int</code> specifying the number of rows to
2156     * move from the current row; a positive number moves the cursor
2157     * forward; a negative number moves the cursor backward
2158     * @return <code>true</code> if the cursor is on a row;
2159     * <code>false</code> otherwise
2160     * @exception SQLException if a database access error occurs,
2161     * there is no current row, or the result set type is
2162     * <code>TYPE_FORWARD_ONLY</code>
2163     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2164     * jdbcResultSet)
2165     */

2166    public boolean relative(int rows) throws SQLException JavaDoc {
2167
2168        checkClosed();
2169
2170        if (this.getType() == TYPE_FORWARD_ONLY) {
2171            throw Util.sqlException(Trace.RESULTSET_FORWARD_ONLY);
2172        }
2173
2174        if (rResult == null) {
2175            return false;
2176        }
2177
2178        if (rResult.rRoot == null) {
2179            return false;
2180        }
2181
2182        // if the direction is backward calculate the target row
2183
if (rows < 0) {
2184            rows = iCurrentRow + rows;
2185
2186            // set status to beforeFirst status
2187
beforeFirst();
2188
2189            // Exit if the target row is before the beginning of the resultset
2190
if (rows <= 0) {
2191                return false;
2192            }
2193        }
2194
2195        while (rows-- > 0) {
2196            next();
2197
2198            if (nCurrent == null) {
2199                break;
2200            }
2201        }
2202
2203        // if nCurrent is null, the postion will be afterLast
2204
return nCurrent != null;
2205    }
2206
2207    /**
2208     * <!-- start generic documentation -->
2209     * Moves the cursor to the previous row in this
2210     * <code>ResultSet</code> object. <p>
2211     * <!-- end generic documentation -->
2212     *
2213     * @return <code>true</code> if the cursor is on a valid row;
2214     * <code>false</code> if it is off the result set
2215     * @exception SQLException if a database access error
2216     * occurs or the result set type is <code>TYPE_FORWARD_ONLY</code>
2217     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2218     * jdbcResultSet)
2219     */

2220    public boolean previous() throws SQLException JavaDoc {
2221
2222        checkClosed();
2223
2224        if (this.getType() == TYPE_FORWARD_ONLY) {
2225            throw Util.sqlException(Trace.RESULTSET_FORWARD_ONLY);
2226        }
2227
2228        if (rResult == null || rResult.rRoot == null || iCurrentRow == 0) {
2229
2230            // Empty resultset or no valid row
2231
return false;
2232        }
2233
2234        if (bInit && nCurrent == null) {
2235
2236            // Special condition: in an afterlast condition so go to last
2237
// row in the resultset
2238
return last();
2239        }
2240
2241        int targetRow = iCurrentRow - 1;
2242
2243        if (targetRow == 0) {
2244
2245            // Have gone to a beforeFirst status. Not sure if the
2246
// beforeFirst status should be set or not.
2247
// The spec is not very clear.
2248
beforeFirst();
2249
2250            return false;
2251        }
2252
2253        // Go to the target row. We always have to start from the first row
2254
// since the resultset is a forward direction list only
2255
first();
2256
2257        while (targetRow != iCurrentRow) {
2258            nCurrent = nCurrent.next;
2259
2260            iCurrentRow++;
2261        }
2262
2263        return nCurrent != null;
2264    }
2265
2266    //---------------------------------------------------------------------
2267
// Properties
2268
//---------------------------------------------------------------------
2269
// fredt@users - 20020902 - patch 1.7.1 - fetch size and direction
2270
// We now interpret fetch size and direction as irrelevent to HSQLDB because
2271
// the result set is built and returned as one whole data structure.
2272
// Exceptions thrown are adjusted to mimimal and the javadoc updated.
2273

2274    /**
2275     * <!-- start generic documentation -->
2276     * Gives a hint as to the direction in which the rows in this
2277     * <code>ResultSet</code> object will be processed.
2278     * The initial value is determined by the
2279     * <code>Statement</code> object
2280     * that produced this <code>ResultSet</code> object.
2281     * The fetch direction may be changed at any time. <p>
2282     * <!-- end generic documentation -->
2283     *
2284     * <!-- start release-specific documentation -->
2285     * <div class="ReleaseSpecificDocumentation">
2286     * <h3>HSQLDB-Specific Information:</h3> <p>
2287     *
2288     * Including 1.7.2, HSQLDB builds and returns result sets as a whole;
2289     * this method does nothing. However, as mandated by the JDBC standard,
2290     * an SQLException is thrown if the result set type is TYPE_FORWARD_ONLY
2291     * and a fetch direction other than FETCH_FORWARD is requested.
2292     * </div>
2293     * <!-- end release-specific documentation -->
2294     *
2295     * @param direction an <code>int</code> specifying the suggested
2296     * fetch direction; one of <code>ResultSet.FETCH_FORWARD</code>,
2297     * <code>ResultSet.FETCH_REVERSE</code>, or
2298     * <code>ResultSet.FETCH_UNKNOWN</code>
2299     * @exception SQLException if a database access error occurs or
2300     * the result set type is <code>TYPE_FORWARD_ONLY</code> and the
2301     * fetch direction is not <code>FETCH_FORWARD</code>
2302     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2303     * jdbcResultSet)
2304     * @see jdbcStatement#setFetchDirection
2305     * @see #getFetchDirection
2306     */

2307    public void setFetchDirection(int direction) throws SQLException JavaDoc {
2308
2309        checkClosed();
2310
2311        if (rsType == TYPE_FORWARD_ONLY && direction != FETCH_FORWARD) {
2312            throw Util.notSupported();
2313        }
2314    }
2315
2316    /**
2317     * <!-- start generic documentation -->
2318     * Retrieves the fetch direction for this
2319     * <code>ResultSet</code> object. <p>
2320     * <!-- end generic documentation -->
2321     *
2322     * <!-- start release-specific documentation -->
2323     * <div class="ReleaseSpecificDocumentation">
2324     * <h3>HSQLDB-Specific Information:</h3> <p>
2325     *
2326     * Including 1.7.2, HSQLDB builds and returns result sets as a whole;
2327     * this method always returns <code>FETCH_FORWARD</code>, but the value
2328     * has no real meaning.
2329     * </div>
2330     * <!-- end release-specific documentation -->
2331     *
2332     * @return the current fetch direction for this <code>ResultSet</code>
2333     * object
2334     * @exception SQLException if a database access error occurs
2335     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2336     * jdbcResultSet)
2337     * @see #setFetchDirection
2338     */

2339    public int getFetchDirection() throws SQLException JavaDoc {
2340
2341        checkClosed();
2342
2343        return FETCH_FORWARD;
2344    }
2345
2346    /**
2347     * <!-- start generic documentation -->
2348     * Gives the JDBC driver a hint as to the number of rows that should
2349     * be fetched from the database when more rows are needed for this
2350     * <code>ResultSet</code> object.
2351     * If the fetch size specified is zero, the JDBC driver
2352     * ignores the value and is free to make its own best guess as to what
2353     * the fetch size should be. The default value is set by the
2354     * <code>Statement</code> object
2355     * that created the result set. The fetch size may be changed at any
2356     * time. <p>
2357     * <!-- end generic documentation -->
2358     *
2359     * <!-- start release-specific documentation -->
2360     * <div class="ReleaseSpecificDocumentation">
2361     * <h3>HSQLDB-Specific Information:</h3> <p>
2362     *
2363     * Including 1.7.2, HSQLDB builds and returns result sets
2364     * as a whole; this method does nothing.
2365     * </div>
2366     * <!-- end release-specific documentation -->
2367     *
2368     * @param rows the number of rows to fetch
2369     * @exception SQLException if a database access error occurs or the
2370     * condition <code>0 <= rows <= this.getMaxRows()</code> is not satisfied
2371     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2372     * jdbcResultSet)
2373     * @see #getFetchSize
2374     * @see jdbcStatement#setFetchSize
2375     * @see jdbcStatement#getFetchSize
2376     */

2377    public void setFetchSize(int rows) throws SQLException JavaDoc {
2378
2379        if (rows < 0) {
2380            throw Util.sqlException(Trace.INVALID_JDBC_ARGUMENT);
2381        }
2382    }
2383
2384    /**
2385     * <!-- start generic documentation -->
2386     * Retrieves the fetch size for this
2387     * <code>ResultSet</code> object. <p>
2388     * <!-- end generic documentation -->
2389     *
2390     * <!-- start release-specific documentation -->
2391     * <div class="ReleaseSpecificDocumentation">
2392     * <h3>HSQLDB-Specific Information:</h3> <p>
2393     *
2394     * Including 1.7.2, HSQLDB builds and returns result sets
2395     * as a whole; the value returned (always 1) has no significance.
2396     * </div>
2397     * <!-- end release-specific documentation -->
2398     *
2399     * @return the current fetch size for this <code>ResultSet</code> object
2400     * @exception SQLException if a database access error occurs
2401     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2402     * jdbcResultSet)
2403     * @see #setFetchSize
2404     * @see jdbcStatement#getFetchSize
2405     * @see jdbcStatement#setFetchSize
2406     */

2407    public int getFetchSize() throws SQLException JavaDoc {
2408
2409        checkClosed();
2410
2411        return 1;
2412    }
2413
2414    /**
2415     * <!-- start generic documentation -->
2416     * Retrieves the type of this <code>ResultSet</code> object.
2417     * The type is determined by the <code>Statement</code> object
2418     * that created the result set. <p>
2419     * <!-- end generic documentation -->
2420     *
2421     * <!-- start release-specific documentation -->
2422     * <div class="ReleaseSpecificDocumentation">
2423     * <h3>HSQLDB-Specific Information:</h3> <p>
2424     *
2425     * Including 1.7.2, HSQLDB does not support and thus
2426     * never returns <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>.
2427     * </div>
2428     * <!-- end release-specific documentation -->
2429     *
2430     * @return <code>ResultSet.TYPE_FORWARD_ONLY</code>,
2431     * <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>,
2432     * or <code>ResultSet.TYPE_SCROLL_SENSITIVE</code> (not supported)
2433     * @exception SQLException if a database access error occurs
2434     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2435     * jdbcResultSet)
2436     */

2437    public int getType() throws SQLException JavaDoc {
2438
2439        checkClosed();
2440
2441        return rsType;
2442    }
2443
2444    /**
2445     * <!-- start generic documentation -->
2446     * Retrieves the concurrency mode of this <code>ResultSet</code> object.
2447     * The concurrency used is determined by the
2448     * <code>Statement</code> object that created the result set. <p>
2449     * <!-- end generic documentation -->
2450     *
2451     * <!-- start release-specific documentation -->
2452     * <div class="ReleaseSpecificDocumentation">
2453     * <h3>HSQLDB-Specific Information:</h3> <p>
2454     *
2455     * Including 1.7.2, HSQLDB supports only <code>CONCUR_READ_ONLY</code>;
2456     * this method always returns <code>CONCUR_READ_ONLY</code>.
2457     * </div>
2458     * <!-- end release-specific documentation -->
2459     *
2460     * @return the concurrency type, either
2461     * <code>ResultSet.CONCUR_READ_ONLY</code>
2462     * or <code>ResultSet.CONCUR_UPDATABLE</code>
2463     * @exception SQLException if a database access error occurs
2464     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2465     * jdbcResultSet)
2466     */

2467    public int getConcurrency() throws SQLException JavaDoc {
2468
2469        checkClosed();
2470
2471        return CONCUR_READ_ONLY;
2472    }
2473
2474    //---------------------------------------------------------------------
2475
// Updates
2476
//---------------------------------------------------------------------
2477

2478    /**
2479     * <!-- start generic documentation -->
2480     * Retrieves whether the current row has been updated. The value returned
2481     * depends on whether or not the result set can detect updates. <p>
2482     * <!-- end generic documentation -->
2483     *
2484     * <!-- start release-specific documentation -->
2485     * <div class="ReleaseSpecificDocumentation">
2486     * <h3>HSQLDB-Specific Information:</h3> <p>
2487     *
2488     * Including 1.7.2, HSQLDB does not support updateable results. <p>
2489     *
2490     * This method always returns false.
2491     * </div>
2492     * <!-- end release-specific documentation -->
2493     *
2494     * @return <code>true</code> if both (1) the row has been visibly updated
2495     * by the owner or another and (2) updates are detected
2496     * @exception SQLException if a database access error occurs
2497     * @see DatabaseMetaData#updatesAreDetected
2498     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2499     * jdbcResultSet)
2500     */

2501    public boolean rowUpdated() throws SQLException JavaDoc {
2502
2503        checkClosed();
2504
2505        return false;
2506    }
2507
2508    /**
2509     * <!-- start generic documentation -->
2510     * Retrieves whether the current row has had an insertion.
2511     * The value returned depends on whether or not this
2512     * <code>ResultSet</code> object can detect visible inserts. <p>
2513     * <!-- end generic documentation -->
2514     *
2515     * <!-- start release-specific documentation -->
2516     * <div class="ReleaseSpecificDocumentation">
2517     * <h3>HSQLDB-Specific Information:</h3> <p>
2518     *
2519     * Including 1.7.2, HSQLDB does not support updateable results. <p>
2520     *
2521     * This method always returns false.
2522     * </div>
2523     * <!-- end release-specific documentation -->
2524     *
2525     * @return <code>true</code> if a row has had an insertion
2526     * and insertions are detected; <code>false</code> otherwise
2527     * @exception SQLException if a database access error occurs
2528     * @see DatabaseMetaData#insertsAreDetected
2529     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2530     * jdbcResultSet)
2531     */

2532    public boolean rowInserted() throws SQLException JavaDoc {
2533
2534        checkClosed();
2535
2536        return false;
2537    }
2538
2539    /**
2540     * <!-- start generic documentation -->
2541     * Retrieves whether a row has been deleted. A deleted row may leave
2542     * a visible "hole" in a result set. This method can be used to
2543     * detect holes in a result set. The value returned depends on whether
2544     * or not this <code>ResultSet</code> object can detect deletions. <p>
2545     * <!-- end generic documentation -->
2546     *
2547     * <!-- start release-specific documentation -->
2548     * <div class="ReleaseSpecificDocumentation">
2549     * <h3>HSQLDB-Specific Information:</h3> <p>
2550     *
2551     * Including 1.7.2, HSQLDB does not support updateable results. <p>
2552     *
2553     * This method always returns false.
2554     * </div>
2555     * <!-- end release-specific documentation -->
2556     * @return <code>true</code> if a row was deleted and deletions are
2557     * detected; <code>false</code> otherwise
2558     * @exception SQLException if a database access error occurs
2559     * @see DatabaseMetaData#deletesAreDetected
2560     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2561     * jdbcResultSet)
2562     */

2563    public boolean rowDeleted() throws SQLException JavaDoc {
2564
2565        checkClosed();
2566
2567        return false;
2568    }
2569
2570    /**
2571     * <!-- start generic documentation -->
2572     * Gives a nullable column a null value.
2573     *
2574     * The updater methods are used to update column values in the
2575     * current row or the insert row. The updater methods do not
2576     * update the underlying database; instead the <code>updateRow</code>
2577     * or <code>insertRow</code> methods are called to update the database.<p>
2578     * <!-- end generic documentation -->
2579     *
2580     * <!-- start release-specific documentation -->
2581     * <div class="ReleaseSpecificDocumentation">
2582     * <h3>HSQLDB-Specific Information:</h3> <p>
2583     *
2584     * Including 1.7.1, HSQLDB does not support updateable results. <p>
2585     *
2586     * This method always throws an SQLException stating that
2587     * the operation is not supported.
2588     * </div>
2589     * <!-- end release-specific documentation -->
2590     *
2591     * @param columnIndex the first column is 1, the second is 2, ...
2592     * @exception SQLException if a database access error occurs
2593     * @since JDK 1.2
2594     */

2595    public void updateNull(int columnIndex) throws SQLException JavaDoc {
2596        throw Util.notSupported();
2597    }
2598
2599    /**
2600     * <!-- start generic documentation -->
2601     * Updates the designated column with a <code>boolean</code> value.
2602     * The updater methods are used to update column values in the
2603     * current row or the insert row. The updater methods do not
2604     * update the underlying database; instead the <code>updateRow</code> or
2605     * <code>insertRow</code> methods are called to update the database. <p>
2606     * <!-- end generic documentation -->
2607     *
2608     * <!-- start release-specific documentation -->
2609     * <div class="ReleaseSpecificDocumentation">
2610     * <h3>HSQLDB-Specific Information:</h3> <p>
2611     *
2612     * Including 1.7.2, HSQLDB does not support updateable results. <p>
2613     *
2614     * This method always throws an SQLException, stating that
2615     * the operation is not supported.
2616     * </div>
2617     * <!-- end release-specific documentation -->
2618     *
2619     * @param columnIndex the first column is 1, the second is 2, ...
2620     * @param x the new column value
2621     * @exception SQLException if a database access error occurs
2622     * @since JDK 1.2
2623     */

2624    public void updateBoolean(int columnIndex,
2625                              boolean x) throws SQLException JavaDoc {
2626        throw Util.notSupported();
2627    }
2628
2629    /**
2630     * <!-- start generic documentation -->
2631     * Updates the designated column with a <code>byte</code> value.
2632     * The updater methods are used to update column values in the
2633     * current row or the insert row. The updater methods do not
2634     * update the underlying database; instead the <code>updateRow</code> or
2635     * <code>insertRow</code> methods are called to update the database. <p>
2636     * <!-- end generic documentation -->
2637     *
2638     * <!-- start release-specific documentation -->
2639     * <div class="ReleaseSpecificDocumentation">
2640     * <h3>HSQLDB-Specific Information:</h3> <p>
2641     *
2642     * Including 1.7.2, HSQLDB does not support updateable results. <p>
2643     *
2644     * This method always throws an SQLException, stating that
2645     * the operation is not supported.
2646     * </div>
2647     * <!-- end release-specific documentation -->
2648     *
2649     * @param columnIndex the first column is 1, the second is 2, ...
2650     * @param x the new column value
2651     * @exception SQLException if a database access error occurs
2652     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2653     * jdbcResultSet)
2654     */

2655    public void updateByte(int columnIndex, byte x) throws SQLException JavaDoc {
2656        throw Util.notSupported();
2657    }
2658
2659    /**
2660     * <!-- start generic documentation -->
2661     * Updates the designated column with a <code>short</code> value.
2662     * The updater methods are used to update column values in the
2663     * current row or the insert row. The updater methods do not
2664     * update the underlying database; instead the <code>updateRow</code> or
2665     * <code>insertRow</code> methods are called to update the database. <p>
2666     * <!-- end generic documentation -->
2667     *
2668     * <!-- start release-specific documentation -->
2669     * <div class="ReleaseSpecificDocumentation">
2670     * <h3>HSQLDB-Specific Information:</h3> <p>
2671     *
2672     * Including 1.7.2, HSQLDB does not support updateable results. <p>
2673     *
2674     * This method always throws an SQLException stating that
2675     * the operation is not supported.
2676     * </div>
2677     * <!-- end release-specific documentation -->
2678     *
2679     * @param columnIndex the first column is 1, the second is 2, ...
2680     * @param x the new column value
2681     * @exception SQLException if a database access error occurs
2682     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2683     * jdbcResultSet)
2684     */

2685    public void updateShort(int columnIndex, short x) throws SQLException JavaDoc {
2686        throw Util.notSupported();
2687    }
2688
2689    /**
2690     * <!-- start generic documentation -->
2691     * Updates the designated column with an <code>int</code> value.
2692     * The updater methods are used to update column values in the
2693     * current row or the insert row. The updater methods do not
2694     * update the underlying database; instead the <code>updateRow</code> or
2695     * <code>insertRow</code> methods are called to update the database. <p>
2696     * <!-- end generic documentation -->
2697     *
2698     * <!-- start release-specific documentation -->
2699     * <div class="ReleaseSpecificDocumentation">
2700     * <h3>HSQLDB-Specific Information:</h3> <p>
2701     *
2702     * Including 1.7.2, HSQLDB does not support updateable results. <p>
2703     *
2704     * This method always throws an SQLException stating that
2705     * the operation is not supported.
2706     * </div>
2707     * <!-- end release-specific documentation -->
2708     *
2709     * @param columnIndex the first column is 1, the second is 2, ...
2710     * @param x the new column value
2711     * @exception SQLException if a database access error occurs
2712     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2713     * jdbcResultSet)
2714     */

2715    public void updateInt(int columnIndex, int x) throws SQLException JavaDoc {
2716        throw Util.notSupported();
2717    }
2718
2719    /**
2720     * <!-- start generic documentation -->
2721     * Updates the designated column with a <code>long</code> value.
2722     * The updater methods are used to update column values in the
2723     * current row or the insert row. The updater methods do not
2724     * update the underlying database; instead the <code>updateRow</code> or
2725     * <code>insertRow</code> methods are called to update the database. <p>
2726     * <!-- end generic documentation -->
2727     *
2728     * <!-- start release-specific documentation -->
2729     * <div class="ReleaseSpecificDocumentation">
2730     * <h3>HSQLDB-Specific Information:</h3> <p>
2731     *
2732     * Including 1.7.2, HSQLDB does not support updateable results. <p>
2733     *
2734     * This method always throws an SQLException stating that
2735     * the operation is not supported.
2736     * </div>
2737     * <!-- end release-specific documentation -->
2738     *
2739     * @param columnIndex the first column is 1, the second is 2, ...
2740     * @param x the new column value
2741     * @exception SQLException if a database access error occurs
2742     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2743     * jdbcResultSet)
2744     */

2745    public void updateLong(int columnIndex, long x) throws SQLException JavaDoc {
2746        throw Util.notSupported();
2747    }
2748
2749    /**
2750     * <!-- start generic documentation -->
2751     * Updates the designated column with a <code>float</code> value.
2752     * The updater methods are used to update column values in the
2753     * current row or the insert row. The updater methods do not
2754     * update the underlying database; instead the <code>updateRow</code> or
2755     * <code>insertRow</code> methods are called to update the database. <p>
2756     * <!-- end generic documentation -->
2757     *
2758     * <!-- start release-specific documentation -->
2759     * <div class="ReleaseSpecificDocumentation">
2760     * <h3>HSQLDB-Specific Information:</h3> <p>
2761     *
2762     * Including 1.7.2, HSQLDB does not support updateable results. <p>
2763     *
2764     * This method always throws an SQLException, stating that
2765     * the operation is not supported.
2766     * </div>
2767     * <!-- end release-specific documentation -->
2768     *
2769     * @param columnIndex the first column is 1, the second is 2, ...
2770     * @param x the new column value
2771     * @exception SQLException if a database access error occurs
2772     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2773     * jdbcResultSet)
2774     */

2775    public void updateFloat(int columnIndex, float x) throws SQLException JavaDoc {
2776        throw Util.notSupported();
2777    }
2778
2779    /**
2780     * <!-- start generic documentation -->
2781     * Updates the designated column with a <code>double</code> value.
2782     * The updater methods are used to update column values in the
2783     * current row or the insert row. The updater methods do not
2784     * update the underlying database; instead the <code>updateRow</code> or
2785     * <code>insertRow</code> methods are called to update the database. <p>
2786     * <!-- end generic documentation -->
2787     *
2788     * <!-- start release-specific documentation -->
2789     * <div class="ReleaseSpecificDocumentation">
2790     * <h3>HSQLDB-Specific Information:</h3> <p>
2791     *
2792     * Including 1.7.2, HSQLDB does not support updateable results. <p>
2793     *
2794     * This method always throws an SQLException, stating that
2795     * the operation is not supported.
2796     * </div>
2797     * <!-- end release-specific documentation -->
2798     *
2799     * @param columnIndex the first column is 1, the second is 2, ...
2800     * @param x the new column value
2801     * @exception SQLException if a database access error occurs
2802     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2803     * jdbcResultSet)
2804     */

2805    public void updateDouble(int columnIndex, double x) throws SQLException JavaDoc {
2806        throw Util.notSupported();
2807    }
2808
2809    /**
2810     * <!-- start generic documentation -->
2811     * Updates the designated column with a <code>java.math.BigDecimal</code>
2812     * value.
2813     * The updater methods are used to update column values in the
2814     * current row or the insert row. The updater methods do not
2815     * update the underlying database; instead the <code>updateRow</code> or
2816     * <code>insertRow</code> methods are called to update the database. <p>
2817     * <!-- end generic documentation -->
2818     *
2819     * <!-- start release-specific documentation -->
2820     * <div class="ReleaseSpecificDocumentation">
2821     * <h3>HSQLDB-Specific Information:</h3> <p>
2822     *
2823     * Including 1.7.2, HSQLDB does not support updateable results. <p>
2824     *
2825     * This method always throws an SQLException stating that
2826     * the operation is not supported.
2827     * </div>
2828     * <!-- end release-specific documentation -->
2829     *
2830     * @param columnIndex the first column is 1, the second is 2, ...
2831     * @param x the new column value
2832     * @exception SQLException if a database access error occurs
2833     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2834     * jdbcResultSet)
2835     */

2836    public void updateBigDecimal(int columnIndex,
2837                                 BigDecimal JavaDoc x) throws SQLException JavaDoc {
2838        throw Util.notSupported();
2839    }
2840
2841    /**
2842     * <!-- start generic documentation -->
2843     * Updates the designated column with a <code>String</code> value.
2844     * The updater methods are used to update column values in the
2845     * current row or the insert row. The updater methods do not
2846     * update the underlying database; instead the <code>updateRow</code> or
2847     * <code>insertRow</code> methods are called to update the database. <p>
2848     * <!-- end generic documentation -->
2849     *
2850     * <!-- start release-specific documentation -->
2851     * <div class="ReleaseSpecificDocumentation">
2852     * <h3>HSQLDB-Specific Information:</h3> <p>
2853     *
2854     * Including 1.7.2, HSQLDB does not support updateable results. <p>
2855     *
2856     * This method always throws an SQLException, stating that
2857     * the operation is not supported.
2858     * </div>
2859     * <!-- end release-specific documentation -->
2860     *
2861     * @param columnIndex the first column is 1, the second is 2, ...
2862     * @param x the new column value
2863     * @exception SQLException if a database access error occurs
2864     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2865     * jdbcResultSet)
2866     */

2867    public void updateString(int columnIndex, String JavaDoc x) throws SQLException JavaDoc {
2868        throw Util.notSupported();
2869    }
2870
2871    /**
2872     * <!-- start generic documentation -->
2873     * Updates the designated column with a <code>byte</code> array value.
2874     * The updater methods are used to update column values in the
2875     * current row or the insert row. The updater methods do not
2876     * update the underlying database; instead the <code>updateRow</code> or
2877     * <code>insertRow</code> methods are called to update the database. <p>
2878     * <!-- end generic documentation -->
2879     *
2880     * <!-- start release-specific documentation -->
2881     * <div class="ReleaseSpecificDocumentation">
2882     * <h3>HSQLDB-Specific Information:</h3> <p>
2883     *
2884     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
2885     *
2886     * This method always throws an SQLException, stating that
2887     * the operation is not supported.
2888     * </div>
2889     * <!-- end release-specific documentation -->
2890     *
2891     * @param columnIndex the first column is 1, the second is 2, ...
2892     * @param x the new column value
2893     * @exception SQLException if a database access error occurs
2894     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2895     * jdbcResultSet)
2896     */

2897    public void updateBytes(int columnIndex, byte[] x) throws SQLException JavaDoc {
2898        throw Util.notSupported();
2899    }
2900
2901    /**
2902     * <!-- start generic documentation -->
2903     * Updates the designated column with a <code>java.sql.Date</code> value.
2904     * The updater methods are used to update column values in the
2905     * current row or the insert row. The updater methods do not
2906     * update the underlying database; instead the <code>updateRow</code> or
2907     * <code>insertRow</code> methods are called to update the database. <p>
2908     * <!-- end generic documentation -->
2909     *
2910     * <!-- start release-specific documentation -->
2911     * <div class="ReleaseSpecificDocumentation">
2912     * <h3>HSQLDB-Specific Information:</h3> <p>
2913     *
2914     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
2915     *
2916     * This method always throws an SQLException, stating that
2917     * the operation is not supported.
2918     * </div>
2919     * <!-- end release-specific documentation -->
2920     *
2921     * @param columnIndex the first column is 1, the second is 2, ...
2922     * @param x the new column value
2923     * @exception SQLException if a database access error occurs
2924     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2925     * jdbcResultSet)
2926     */

2927    public void updateDate(int columnIndex, Date JavaDoc x) throws SQLException JavaDoc {
2928        throw Util.notSupported();
2929    }
2930
2931    /**
2932     * <!-- start generic documentation -->
2933     * Updates the designated column with a <code>java.sql.Time</code> value.
2934     * The updater methods are used to update column values in the
2935     * current row or the insert row. The updater methods do not
2936     * update the underlying database; instead the <code>updateRow</code> or
2937     * <code>insertRow</code> methods are called to update the database. <p>
2938     * <!-- end generic documentation -->
2939     *
2940     * <!-- start release-specific documentation -->
2941     * <div class="ReleaseSpecificDocumentation">
2942     * <h3>HSQLDB-Specific Information:</h3> <p>
2943     *
2944     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
2945     *
2946     * This method always throws an SQLException stating that
2947     * the operation is not supported.
2948     * </div>
2949     * <!-- end release-specific documentation -->
2950     *
2951     * @param columnIndex the first column is 1, the second is 2, ...
2952     * @param x the new column value
2953     * @exception SQLException if a database access error occurs
2954     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2955     * jdbcResultSet)
2956     */

2957    public void updateTime(int columnIndex, Time JavaDoc x) throws SQLException JavaDoc {
2958        throw Util.notSupported();
2959    }
2960
2961    /**
2962     * <!-- start generic documentation -->
2963     * Updates the designated column with a <code>java.sql.Timestamp</code>
2964     * value.
2965     * The updater methods are used to update column values in the
2966     * current row or the insert row. The updater methods do not
2967     * update the underlying database; instead the <code>updateRow</code> or
2968     * <code>insertRow</code> methods are called to update the database. <p>
2969     * <!-- end generic documentation -->
2970     *
2971     * <!-- start release-specific documentation -->
2972     * <div class="ReleaseSpecificDocumentation">
2973     * <h3>HSQLDB-Specific Information:</h3> <p>
2974     *
2975     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
2976     *
2977     * This method always throws an SQLException stating that
2978     * the operation is not supported.
2979     * </div>
2980     * <!-- end release-specific documentation -->
2981     *
2982     * @param columnIndex the first column is 1, the second is 2, ...
2983     * @param x the new column value
2984     * @exception SQLException if a database access error occurs
2985     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
2986     * jdbcResultSet)
2987     */

2988    public void updateTimestamp(int columnIndex,
2989                                Timestamp JavaDoc x) throws SQLException JavaDoc {
2990        throw Util.notSupported();
2991    }
2992
2993    /**
2994     * <!-- start generic documentation -->
2995     * Updates the designated column with an ascii stream value.
2996     * The updater methods are used to update column values in the
2997     * current row or the insert row. The updater methods do not
2998     * update the underlying database; instead the <code>updateRow</code> or
2999     * <code>insertRow</code> methods are called to update the database. <p>
3000     * <!-- end generic documentation -->
3001     *
3002     * <!-- start release-specific documentation -->
3003     * <div class="ReleaseSpecificDocumentation">
3004     * <h3>HSQLDB-Specific Information:</h3> <p>
3005     *
3006     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3007     *
3008     * This method always throws an SQLException stating that
3009     * the operation is not supported.
3010     * </div>
3011     *
3012     * @param columnIndex the first column is 1, the second is 2, ...
3013     * @param x the new column value
3014     * @param length the length of the stream
3015     * @exception SQLException if a database access error occurs
3016     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3017     * jdbcResultSet)
3018     */

3019    public void updateAsciiStream(int columnIndex, java.io.InputStream JavaDoc x,
3020                                  int length) throws SQLException JavaDoc {
3021        throw Util.notSupported();
3022    }
3023
3024    /**
3025     * <!-- start generic documentation -->
3026     * Updates the designated column with a binary stream value.
3027     * The updater methods are used to update column values in the
3028     * current row or the insert row. The updater methods do not
3029     * update the underlying database; instead the <code>updateRow</code> or
3030     * <code>insertRow</code> methods are called to update the database. <p>
3031     * <!-- end generic documentation -->
3032     *
3033     * <!-- start release-specific documentation -->
3034     * <div class="ReleaseSpecificDocumentation">
3035     * <h3>HSQLDB-Specific Information:</h3> <p>
3036     *
3037     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3038     *
3039     * This method always throws an SQLException stating that
3040     * the operation is not supported.
3041     * </div>
3042     * <!-- end release-specific documentation -->
3043     *
3044     * @param columnIndex the first column is 1, the second is 2, ...
3045     * @param x the new column value
3046     * @param length the length of the stream
3047     * @exception SQLException if a database access error occurs
3048     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3049     * jdbcResultSet)
3050     */

3051    public void updateBinaryStream(int columnIndex, java.io.InputStream JavaDoc x,
3052                                   int length) throws SQLException JavaDoc {
3053        throw Util.notSupported();
3054    }
3055
3056    /**
3057     * <!-- start generic documentation -->
3058     * Updates the designated column with a character stream value.
3059     * The updater methods are used to update column values in the
3060     * current row or the insert row. The updater methods do not
3061     * update the underlying database; instead the <code>updateRow</code> or
3062     * <code>insertRow</code> methods are called to update the database. <p>
3063     * <!-- end generic documentation -->
3064     *
3065     * <!-- start release-specific documentation -->
3066     * <div class="ReleaseSpecificDocumentation">
3067     * <h3>HSQLDB-Specific Information:</h3> <p>
3068     *
3069     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3070     *
3071     * This method always throws an SQLException stating that
3072     * the operation is not supported.
3073     * </div>
3074     * <!-- end release-specific documentation -->
3075     *
3076     * @param columnIndex the first column is 1, the second is 2, ...
3077     * @param x the new column value
3078     * @param length the length of the stream
3079     * @exception SQLException if a database access error occurs
3080     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3081     * jdbcResultSet)
3082     */

3083    public void updateCharacterStream(int columnIndex, java.io.Reader JavaDoc x,
3084                                      int length) throws SQLException JavaDoc {
3085        throw Util.notSupported();
3086    }
3087
3088    /**
3089     * <!-- start generic documentation -->
3090     * Updates the designated column with an <code>Object</code> value.
3091     * The updater methods are used to update column values in the
3092     * current row or the insert row. The updater methods do not
3093     * update the underlying database; instead the <code>updateRow</code> or
3094     * <code>insertRow</code> methods are called to update the database. <p>
3095     * <!-- end generic documentation -->
3096     *
3097     * <!-- start release-specific documentation -->
3098     * <div class="ReleaseSpecificDocumentation">
3099     * <h3>HSQLDB-Specific Information:</h3> <p>
3100     *
3101     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3102     *
3103     * This method always throws an SQLException stating that
3104     * the operation is not supported.
3105     * </div>
3106     * <!-- end release-specific documentation -->
3107     *
3108     * @param columnIndex the first column is 1, the second is 2, ...
3109     * @param x the new column value
3110     * @param scale for <code>java.sql.Types.DECIMA</code>
3111     * or <code>java.sql.Types.NUMERIC</code> types,
3112     * this is the number of digits after the decimal point. For all other
3113     * types this value will be ignored.
3114     * @exception SQLException if a database access error occurs
3115     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3116     * jdbcResultSet)
3117     */

3118    public void updateObject(int columnIndex, Object JavaDoc x,
3119                             int scale) throws SQLException JavaDoc {
3120        throw Util.notSupported();
3121    }
3122
3123    /**
3124     * <!-- start generic documentation -->
3125     * Updates the designated column with an <code>Object</code> value.
3126     * The updater methods are used to update column values in the
3127     * current row or the insert row. The updater methods do not
3128     * update the underlying database; instead the <code>updateRow</code> or
3129     * <code>insertRow</code> methods are called to update the database. <p>
3130     * <!-- end generic documentation -->
3131     *
3132     * <!-- start release-specific documentation -->
3133     * <div class="ReleaseSpecificDocumentation">
3134     * <h3>HSQLDB-Specific Information:</h3> <p>
3135     *
3136     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3137     *
3138     * This method always throws an SQLException stating that
3139     * the operation is not supported.
3140     * </div>
3141     * <!-- end release-specific documentation -->
3142     *
3143     * @param columnIndex the first column is 1, the second is 2, ...
3144     * @param x the new column value
3145     * @exception SQLException if a database access error occurs
3146     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3147     * jdbcResultSet)
3148     */

3149    public void updateObject(int columnIndex, Object JavaDoc x) throws SQLException JavaDoc {
3150        throw Util.notSupported();
3151    }
3152
3153    /**
3154     * <!-- start generic documentation -->
3155     * Updates the designated column with a <code>null</code> value.
3156     * The updater methods are used to update column values in the
3157     * current row or the insert row. The updater methods do not
3158     * update the underlying database; instead the <code>updateRow</code> or
3159     * <code>insertRow</code> methods are called to update the database. <p>
3160     * <!-- end generic documentation -->
3161     *
3162     * <!-- start release-specific documentation -->
3163     * <div class="ReleaseSpecificDocumentation">
3164     * <h3>HSQLDB-Specific Information:</h3> <p>
3165     *
3166     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3167     *
3168     * This method always throws an SQLException stating that
3169     * the operation is not supported.
3170     * </div>
3171     * <!-- end release-specific documentation -->
3172     *
3173     * @param columnName the name of the column
3174     * @exception SQLException if a database access error occurs
3175     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3176     * jdbcResultSet)
3177     */

3178    public void updateNull(String JavaDoc columnName) throws SQLException JavaDoc {
3179        updateNull(findColumn(columnName));
3180    }
3181
3182    /**
3183     * <!-- start generic documentation -->
3184     * Updates the designated column with a <code>boolean</code> value.
3185     * The updater methods are used to update column values in the
3186     * current row or the insert row. The updater methods do not
3187     * update the underlying database; instead the <code>updateRow</code> or
3188     * <code>insertRow</code> methods are called to update the database. <p>
3189     * <!-- end generic documentation -->
3190     *
3191     * <!-- start release-specific documentation -->
3192     * <div class="ReleaseSpecificDocumentation">
3193     * <h3>HSQLDB-Specific Information:</h3> <p>
3194     *
3195     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3196     *
3197     * This method always throws an SQLException stating that
3198     * the operation is not supported.
3199     * </div>
3200     * <!-- end release-specific documentation -->
3201     *
3202     * @param columnName the name of the column
3203     * @param x the new column value
3204     * @exception SQLException if a database access error occurs
3205     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3206     * jdbcResultSet)
3207     */

3208    public void updateBoolean(String JavaDoc columnName,
3209                              boolean x) throws SQLException JavaDoc {
3210        updateBoolean(findColumn(columnName), x);
3211    }
3212
3213    /**
3214     * <!-- start generic documentation -->
3215     * Updates the designated column with a <code>byte</code> value.
3216     * The updater methods are used to update column values in the
3217     * current row or the insert row. The updater methods do not
3218     * update the underlying database; instead the <code>updateRow</code> or
3219     * <code>insertRow</code> methods are called to update the database. <p>
3220     * <!-- end generic documentation -->
3221     *
3222     * <!-- start release-specific documentation -->
3223     * <div class="ReleaseSpecificDocumentation">
3224     * <h3>HSQLDB-Specific Information:</h3> <p>
3225     *
3226     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3227     *
3228     * This method always throws an SQLException stating that
3229     * the operation is not supported.
3230     * </div>
3231     * <!-- end release-specific documentation -->
3232     *
3233     * @param columnName the name of the column
3234     * @param x the new column value
3235     * @exception SQLException if a database access error occurs
3236     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3237     * jdbcResultSet)
3238     */

3239    public void updateByte(String JavaDoc columnName, byte x) throws SQLException JavaDoc {
3240        updateByte(findColumn(columnName), x);
3241    }
3242
3243    /**
3244     * <!-- start generic documentation -->
3245     * Updates the designated column with a <code>short</code> value.
3246     * The updater methods are used to update column values in the
3247     * current row or the insert row. The updater methods do not
3248     * update the underlying database; instead the <code>updateRow</code> or
3249     * <code>insertRow</code> methods are called to update the database. <p>
3250     * <!-- end generic documentation -->
3251     *
3252     * <!-- start release-specific documentation -->
3253     * <div class="ReleaseSpecificDocumentation">
3254     * <h3>HSQLDB-Specific Information:</h3> <p>
3255     *
3256     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3257     *
3258     * This method always throws an SQLException stating that
3259     * the operation is not supported.
3260     * </div>
3261     * <!-- end release-specific documentation -->
3262     *
3263     * @param columnName the name of the column
3264     * @param x the new column value
3265     * @exception SQLException if a database access error occurs
3266     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3267     * jdbcResultSet)
3268     */

3269    public void updateShort(String JavaDoc columnName, short x) throws SQLException JavaDoc {
3270        updateShort(findColumn(columnName), x);
3271    }
3272
3273    /**
3274     * <!-- start generic documentation -->
3275     * Updates the designated column with an <code>int</code> value.
3276     * The updater methods are used to update column values in the
3277     * current row or the insert row. The updater methods do not
3278     * update the underlying database; instead the <code>updateRow</code> or
3279     * <code>insertRow</code> methods are called to update the database. <p>
3280     * <!-- end generic documentation -->
3281     *
3282     * <!-- start release-specific documentation -->
3283     * <div class="ReleaseSpecificDocumentation">
3284     * <h3>HSQLDB-Specific Information:</h3> <p>
3285     *
3286     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3287     *
3288     * This method always throws an SQLException stating that
3289     * the operation is not supported.
3290     * </div>
3291     * <!-- end release-specific documentation -->
3292     *
3293     * @param columnName the name of the column
3294     * @param x the new column value
3295     * @exception SQLException if a database access error occurs
3296     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3297     * jdbcResultSet)
3298     */

3299    public void updateInt(String JavaDoc columnName, int x) throws SQLException JavaDoc {
3300        updateInt(findColumn(columnName), x);
3301    }
3302
3303    /**
3304     * <!-- start generic documentation -->
3305     * Updates the designated column with a <code>long</code> value.
3306     * The updater methods are used to update column values in the
3307     * current row or the insert row. The updater methods do not
3308     * update the underlying database; instead the <code>updateRow</code> or
3309     * <code>insertRow</code> methods are called to update the database. <p>
3310     * <!-- end generic documentation -->
3311     *
3312     * <!-- start release-specific documentation -->
3313     * <div class="ReleaseSpecificDocumentation">
3314     * <h3>HSQLDB-Specific Information:</h3> <p>
3315     *
3316     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3317     *
3318     * This method always throws an SQLException stating that
3319     * the operation is not supported.
3320     * </div>
3321     * <!-- end release-specific documentation -->
3322     *
3323     * @param columnName the name of the column
3324     * @param x the new column value
3325     * @exception SQLException if a database access error occurs
3326     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3327     * jdbcResultSet)
3328     */

3329    public void updateLong(String JavaDoc columnName, long x) throws SQLException JavaDoc {
3330        updateLong(findColumn(columnName), x);
3331    }
3332
3333    /**
3334     * <!-- start generic documentation -->
3335     * Updates the designated column with a <code>float</code> value.
3336     * The updater methods are used to update column values in the
3337     * current row or the insert row. The updater methods do not
3338     * update the underlying database; instead the <code>updateRow</code> or
3339     * <code>insertRow</code> methods are called to update the database. <p>
3340     * <!-- end generic documentation -->
3341     *
3342     * <!-- start release-specific documentation -->
3343     * <div class="ReleaseSpecificDocumentation">
3344     * <h3>HSQLDB-Specific Information:</h3> <p>
3345     *
3346     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3347     *
3348     * This method always throws an SQLException stating that
3349     * the operation is not supported.
3350     * </div>
3351     * <!-- end release-specific documentation -->
3352     *
3353     * @param columnName the name of the column
3354     * @param x the new column value
3355     * @exception SQLException if a database access error occurs
3356     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3357     * jdbcResultSet)
3358     */

3359    public void updateFloat(String JavaDoc columnName, float x) throws SQLException JavaDoc {
3360        updateFloat(findColumn(columnName), x);
3361    }
3362
3363    /**
3364     * <!-- start generic documentation -->
3365     * Updates the designated column with a <code>double</code> value.
3366     * The updater methods are used to update column values in the
3367     * current row or the insert row. The updater methods do not
3368     * update the underlying database; instead the <code>updateRow</code> or
3369     * <code>insertRow</code> methods are called to update the database. <p>
3370     * <!-- end generic documentation -->
3371     *
3372     * <!-- start release-specific documentation -->
3373     * <div class="ReleaseSpecificDocumentation">
3374     * <h3>HSQLDB-Specific Information:</h3> <p>
3375     *
3376     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3377     *
3378     * This method always throws an SQLException stating that
3379     * the operation is not supported.
3380     * </div>
3381     * <!-- end release-specific documentation -->
3382     *
3383     * @param columnName the name of the column
3384     * @param x the new column value
3385     * @exception SQLException if a database access error occurs
3386     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3387     * jdbcResultSet)
3388     */

3389    public void updateDouble(String JavaDoc columnName,
3390                             double x) throws SQLException JavaDoc {
3391        updateDouble(findColumn(columnName), x);
3392    }
3393
3394    /**
3395     * <!-- start generic documentation -->
3396     * Updates the designated column with a <code>java.sql.BigDecimal</code>
3397     * value.
3398     * The updater methods are used to update column values in the
3399     * current row or the insert row. The updater methods do not
3400     * update the underlying database; instead the <code>updateRow</code> or
3401     * <code>insertRow</code> methods are called to update the database. <p>
3402     * <!-- end generic documentation -->
3403     *
3404     * <!-- start release-specific documentation -->
3405     * <div class="ReleaseSpecificDocumentation">
3406     * <h3>HSQLDB-Specific Information:</h3> <p>
3407     *
3408     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3409     *
3410     * This method always throws an SQLException stating that
3411     * the operation is not supported.
3412     * </div>
3413     * <!-- end release-specific documentation -->
3414     *
3415     * @param columnName the name of the column
3416     * @param x the new column value
3417     * @exception SQLException if a database access error occurs
3418     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3419     * jdbcResultSet)
3420     */

3421    public void updateBigDecimal(String JavaDoc columnName,
3422                                 BigDecimal JavaDoc x) throws SQLException JavaDoc {
3423        updateBigDecimal(findColumn(columnName), x);
3424    }
3425
3426    /**
3427     * <!-- start generic documentation -->
3428     * Updates the designated column with a <code>String</code> value.
3429     * The updater methods are used to update column values in the
3430     * current row or the insert row. The updater methods do not
3431     * update the underlying database; instead the <code>updateRow</code> or
3432     * <code>insertRow</code> methods are called to update the database. <p>
3433     * <!-- end generic documentation -->
3434     *
3435     * <!-- start release-specific documentation -->
3436     * <div class="ReleaseSpecificDocumentation">
3437     * <h3>HSQLDB-Specific Information:</h3> <p>
3438     *
3439     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3440     *
3441     * This method always throws an SQLException stating that
3442     * the operation is not supported.
3443     * </div>
3444     * <!-- end release-specific documentation -->
3445     *
3446     * @param columnName the name of the column
3447     * @param x the new column value
3448     * @exception SQLException if a database access error occurs
3449     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3450     * jdbcResultSet)
3451     */

3452    public void updateString(String JavaDoc columnName,
3453                             String JavaDoc x) throws SQLException JavaDoc {
3454        updateString(findColumn(columnName), x);
3455    }
3456
3457    /**
3458     * <!-- start generic documentation -->
3459     * Updates the designated column with a byte array value.
3460     *
3461     * The updater methods are used to update column values in the
3462     * current row or the insert row. The updater methods do not
3463     * update the underlying database; instead the <code>updateRow</code> or
3464     * <code>insertRow</code> methods are called to update the database. <p>
3465     * <!-- end generic documentation -->
3466     *
3467     * <!-- start release-specific documentation -->
3468     * <div class="ReleaseSpecificDocumentation">
3469     * <h3>HSQLDB-Specific Information:</h3> <p>
3470     *
3471     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3472     *
3473     * This method always throws an SQLException stating that
3474     * the operation is not supported.
3475     * </div>
3476     * <!-- end release-specific documentation -->
3477     *
3478     * @param columnName the name of the column
3479     * @param x the new column value
3480     * @exception SQLException if a database access error occurs
3481     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3482     * jdbcResultSet)
3483     */

3484    public void updateBytes(String JavaDoc columnName, byte[] x) throws SQLException JavaDoc {
3485        updateBytes(findColumn(columnName), x);
3486    }
3487
3488    /**
3489     * <!-- start generic documentation -->
3490     * Updates the designated column with a <code>java.sql.Date</code> value.
3491     * The updater methods are used to update column values in the
3492     * current row or the insert row. The updater methods do not
3493     * update the underlying database; instead the <code>updateRow</code> or
3494     * <code>insertRow</code> methods are called to update the database. <p>
3495     * <!-- end generic documentation -->
3496     *
3497     * <!-- start release-specific documentation -->
3498     * <div class="ReleaseSpecificDocumentation">
3499     * <h3>HSQLDB-Specific Information:</h3> <p>
3500     *
3501     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3502     *
3503     * This method always throws an SQLException stating that
3504     * the operation is not supported.
3505     * </div>
3506     * <!-- end release-specific documentation -->
3507     *
3508     * @param columnName the name of the column
3509     * @param x the new column value
3510     * @exception SQLException if a database access error occurs
3511     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3512     * jdbcResultSet)
3513     */

3514    public void updateDate(String JavaDoc columnName, Date JavaDoc x) throws SQLException JavaDoc {
3515        updateDate(findColumn(columnName), x);
3516    }
3517
3518    /**
3519     * <!-- start generic documentation -->
3520     * Updates the designated column with a <code>java.sql.Time</code> value.
3521     * The updater methods are used to update column values in the
3522     * current row or the insert row. The updater methods do not
3523     * update the underlying database; instead the <code>updateRow</code> or
3524     * <code>insertRow</code> methods are called to update the database. <p>
3525     * <!-- end generic documentation -->
3526     *
3527     * <!-- start release-specific documentation -->
3528     * <div class="ReleaseSpecificDocumentation">
3529     * <h3>HSQLDB-Specific Information:</h3> <p>
3530     *
3531     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3532     *
3533     * This method always throws an SQLException stating that
3534     * the operation is not supported.
3535     * </div>
3536     * <!-- end release-specific documentation -->
3537     *
3538     * @param columnName the name of the column
3539     * @param x the new column value
3540     * @exception SQLException if a database access error occurs
3541     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3542     * jdbcResultSet)
3543     */

3544    public void updateTime(String JavaDoc columnName, Time JavaDoc x) throws SQLException JavaDoc {
3545        updateTime(findColumn(columnName), x);
3546    }
3547
3548    /**
3549     * <!-- start generic documentation -->
3550     * Updates the designated column with a <code>java.sql.Timestamp</code>
3551     * value.
3552     * The updater methods are used to update column values in the
3553     * current row or the insert row. The updater methods do not
3554     * update the underlying database; instead the <code>updateRow</code> or
3555     * <code>insertRow</code> methods are called to update the database. <p>
3556     * <!-- end generic documentation -->
3557     *
3558     * <!-- start release-specific documentation -->
3559     * <div class="ReleaseSpecificDocumentation">
3560     * <h3>HSQLDB-Specific Information:</h3> <p>
3561     *
3562     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3563     *
3564     * This method always throws an SQLException stating that
3565     * the operation is not supported.
3566     * </div>
3567     * <!-- end release-specific documentation -->
3568     *
3569     * @param columnName the name of the column
3570     * @param x the new column value
3571     * @exception SQLException if a database access error occurs
3572     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3573     * jdbcResultSet)
3574     */

3575    public void updateTimestamp(String JavaDoc columnName,
3576                                Timestamp JavaDoc x) throws SQLException JavaDoc {
3577        updateTimestamp(findColumn(columnName), x);
3578    }
3579
3580    /**
3581     * <!-- start generic documentation -->
3582     * Updates the designated column with an ascii stream value.
3583     * The updater methods are used to update column values in the
3584     * current row or the insert row. The updater methods do not
3585     * update the underlying database; instead the <code>updateRow</code> or
3586     * <code>insertRow</code> methods are called to update the database. <p>
3587     * <!-- end generic documentation -->
3588     *
3589     * <!-- start release-specific documentation -->
3590     * <div class="ReleaseSpecificDocumentation">
3591     * <h3>HSQLDB-Specific Information:</h3> <p>
3592     *
3593     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3594     *
3595     * This method always throws an SQLException stating that
3596     * the operation is not supported.
3597     * </div>
3598     * <!-- end release-specific documentation -->
3599     *
3600     * @param columnName the name of the column
3601     * @param x the new column value
3602     * @param length the length of the stream
3603     * @exception SQLException if a database access error occurs
3604     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3605     * jdbcResultSet)
3606     */

3607    public void updateAsciiStream(String JavaDoc columnName, java.io.InputStream JavaDoc x,
3608                                  int length) throws SQLException JavaDoc {
3609        updateAsciiStream(findColumn(columnName), x, length);
3610    }
3611
3612    /**
3613     * <!-- start generic documentation -->
3614     * Updates the designated column with a binary stream value.
3615     * The updater methods are used to update column values in the
3616     * current row or the insert row. The updater methods do not
3617     * update the underlying database; instead the <code>updateRow</code> or
3618     * <code>insertRow</code> methods are called to update the database. <p>
3619     * <!-- end generic documentation -->
3620     *
3621     * <!-- start release-specific documentation -->
3622     * <div class="ReleaseSpecificDocumentation">
3623     * <h3>HSQLDB-Specific Information:</h3> <p>
3624     *
3625     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3626     *
3627     * This method always throws an SQLException stating that
3628     * the operation is not supported.
3629     * </div>
3630     * <!-- end release-specific documentation -->
3631     *
3632     * @param columnName the name of the column
3633     * @param x the new column value
3634     * @param length the length of the stream
3635     * @exception SQLException if a database access error occurs
3636     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3637     * jdbcResultSet)
3638     */

3639    public void updateBinaryStream(String JavaDoc columnName, java.io.InputStream JavaDoc x,
3640                                   int length) throws SQLException JavaDoc {
3641        updateBinaryStream(findColumn(columnName), x, length);
3642    }
3643
3644    /**
3645     * <!-- start generic documentation -->
3646     * Updates the designated column with a character stream value.
3647     * The updater methods are used to update column values in the
3648     * current row or the insert row. The updater methods do not
3649     * update the underlying database; instead the <code>updateRow</code> or
3650     * <code>insertRow</code> methods are called to update the database. <p>
3651     * <!-- end generic documentation -->
3652     *
3653     * <!-- start release-specific documentation -->
3654     * <div class="ReleaseSpecificDocumentation">
3655     * <h3>HSQLDB-Specific Information:</h3> <p>
3656     *
3657     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3658     *
3659     * This method always throws an SQLException stating that
3660     * the operation is not supported.
3661     * </div>
3662     * <!-- end release-specific documentation -->
3663     *
3664     * @param columnName the name of the column
3665     * @param reader the <code>java.io.Reader</code> object containing
3666     * the new column value
3667     * @param length the length of the stream
3668     * @exception SQLException if a database access error occurs
3669     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3670     * jdbcResultSet)
3671     */

3672    public void updateCharacterStream(String JavaDoc columnName,
3673                                      java.io.Reader JavaDoc reader,
3674                                      int length) throws SQLException JavaDoc {
3675        updateCharacterStream(findColumn(columnName), reader, length);
3676    }
3677
3678    /**
3679     * <!-- start generic documentation -->
3680     * Updates the designated column with an <code>Object</code> value.
3681     * The updater methods are used to update column values in the
3682     * current row or the insert row. The updater methods do not
3683     * update the underlying database; instead the <code>updateRow</code> or
3684     * <code>insertRow</code> methods are called to update the database. <p>
3685     * <!-- end generic documentation -->
3686     *
3687     * <!-- start release-specific documentation -->
3688     * <div class="ReleaseSpecificDocumentation">
3689     * <h3>HSQLDB-Specific Information:</h3> <p>
3690     *
3691     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3692     *
3693     * This method always throws an SQLException stating that
3694     * the operation is not supported.
3695     * </div>
3696     * <!-- end release-specific documentation -->
3697     *
3698     * @param columnName the name of the column
3699     * @param x the new column value
3700     * @param scale for <code>java.sql.Types.DECIMAL</code>
3701     * or <code>java.sql.Types.NUMERIC</code> types,
3702     * this is the number of digits after the decimal point. For all other
3703     * types this value will be ignored.
3704     * @exception SQLException if a database access error occurs
3705     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3706     * jdbcResultSet)
3707     */

3708    public void updateObject(String JavaDoc columnName, Object JavaDoc x,
3709                             int scale) throws SQLException JavaDoc {
3710        updateObject(findColumn(columnName), x, scale);
3711    }
3712
3713    /**
3714     * <!-- start generic documentation -->
3715     * Updates the designated column with an <code>Object</code> value.
3716     * The updater methods are used to update column values in the
3717     * current row or the insert row. The updater methods do not
3718     * update the underlying database; instead the <code>updateRow</code> or
3719     * <code>insertRow</code> methods are called to update the database. <p>
3720     * <!-- end generic documentation -->
3721     *
3722     * <!-- start release-specific documentation -->
3723     * <div class="ReleaseSpecificDocumentation">
3724     * <h3>HSQLDB-Specific Information:</h3> <p>
3725     *
3726     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3727     *
3728     * This method always throws an SQLException stating that
3729     * the operation is not supported.
3730     * </div>
3731     * <!-- end release-specific documentation -->
3732     *
3733     * @param columnName the name of the column
3734     * @param x the new column value
3735     * @exception SQLException if a database access error occurs
3736     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3737     * jdbcResultSet)
3738     */

3739    public void updateObject(String JavaDoc columnName,
3740                             Object JavaDoc x) throws SQLException JavaDoc {
3741        updateObject(findColumn(columnName), x);
3742    }
3743
3744    /**
3745     * <!-- start generic documentation -->
3746     * Inserts the contents of the insert row into this
3747     * <code>ResultSet</code> object and into the database.
3748     * The cursor must be on the insert row when this method is called. <p>
3749     * <!-- end generic documentation -->
3750     *
3751     * <!-- start release-specific documentation -->
3752     * <div class="ReleaseSpecificDocumentation">
3753     * <h3>HSQLDB-Specific Information:</h3> <p>
3754     *
3755     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3756     *
3757     * This method always throws an SQLException stating that
3758     * the operation is not supported.
3759     * </div>
3760     * <!-- end release-specific documentation -->
3761     *
3762     * @exception SQLException if a database access error occurs,
3763     * if this method is called when the cursor is not on the insert row,
3764     * or if not all of non-nullable columns in
3765     * the insert row have been given a value
3766     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3767     * jdbcResultSet)
3768     */

3769    public void insertRow() throws SQLException JavaDoc {
3770        throw Util.notSupported();
3771    }
3772
3773    /**
3774     * <!-- start generic documentation -->
3775     * Updates the underlying database with the new contents of the
3776     * current row of this <code>ResultSet</code> object.
3777     * This method cannot be called when the cursor is on the insert row. <p>
3778     * <!-- end generic documentation -->
3779     *
3780     * <!-- start release-specific documentation -->
3781     * <div class="ReleaseSpecificDocumentation">
3782     * <h3>HSQLDB-Specific Information:</h3> <p>
3783     *
3784     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3785     *
3786     * This method always throws an SQLException stating that
3787     * the operation is not supported.
3788     * </div>
3789     * <!-- end release-specific documentation -->
3790     *
3791     * @exception SQLException if a database access error occurs or
3792     * if this method is called when the cursor is on the insert row
3793     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3794     * jdbcResultSet)
3795     */

3796    public void updateRow() throws SQLException JavaDoc {
3797        throw Util.notSupported();
3798    }
3799
3800    /**
3801     * <!-- start generic documentation -->
3802     * Deletes the current row from this <code>ResultSet</code> object
3803     * and from the underlying database. This method cannot be called when
3804     * the cursor is on the insert row. <p>
3805     * <!-- end generic documentation -->
3806     *
3807     * <!-- start release-specific documentation -->
3808     * <div class="ReleaseSpecificDocumentation">
3809     * <h3>HSQLDB-Specific Information:</h3> <p>
3810     *
3811     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3812     *
3813     * This method always throws an SQLException stating that
3814     * the operation is not supported.
3815     * </div>
3816     * <!-- end release-specific documentation -->
3817     *
3818     * @exception SQLException if a database access error occurs
3819     * or if this method is called when the cursor is on the insert row
3820     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3821     * jdbcResultSet)
3822     */

3823    public void deleteRow() throws SQLException JavaDoc {
3824        throw Util.notSupported();
3825    }
3826
3827    /**
3828     * <!-- start generic documentation -->
3829     * Refreshes the current row with its most recent value in
3830     * the database. This method cannot be called when
3831     * the cursor is on the insert row.
3832     *
3833     * <P>The <code>refreshRow</code> method provides a way for an
3834     * application to
3835     * explicitly tell the JDBC driver to refetch a row(s) from the
3836     * database. An application may want to call <code>refreshRow</code> when
3837     * caching or prefetching is being done by the JDBC driver to
3838     * fetch the latest value of a row from the database. The JDBC driver
3839     * may actually refresh multiple rows at once if the fetch size is
3840     * greater than one.
3841     *
3842     * <P> All values are refetched subject to the transaction isolation
3843     * level and cursor sensitivity. If <code>refreshRow</code> is called
3844     * after calling an updater method, but before calling
3845     * the method <code>updateRow</code>, then the
3846     * updates made to the row are lost. Calling the method
3847     * <code>refreshRow</code> frequently will likely slow performance. <p>
3848     * <!-- end generic documentation -->
3849     *
3850     * <!-- start release-specific documentation -->
3851     * <div class="ReleaseSpecificDocumentation">
3852     * <h3>HSQLDB-Specific Information:</h3> <p>
3853     *
3854     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3855     *
3856     * This method always throws an SQLException stating that
3857     * the operation is not supported.
3858     * </div>
3859     * <!-- end release-specific documentation -->
3860     *
3861     * @exception SQLException if a database access error
3862     * occurs or if this method is called when the cursor is on the insert row
3863     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3864     * jdbcResultSet)
3865     */

3866    public void refreshRow() throws SQLException JavaDoc {
3867        throw Util.notSupported();
3868    }
3869
3870    /**
3871     * <!-- start generic documentation -->
3872     * Cancels the updates made to the current row in this
3873     * <code>ResultSet</code> object.
3874     * This method may be called after calling an
3875     * updater method(s) and before calling
3876     * the method <code>updateRow</code> to roll back
3877     * the updates made to a row. If no updates have been made or
3878     * <code>updateRow</code> has already been called, this method has no
3879     * effect. <p>
3880     * <!-- end generic documentation -->
3881     *
3882     * <!-- start release-specific documentation -->
3883     * <div class="ReleaseSpecificDocumentation">
3884     * <h3>HSQLDB-Specific Information:</h3> <p>
3885     *
3886     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3887     *
3888     * This method always throws an SQLException stating that
3889     * the operation is not supported.
3890     * </div>
3891     * <!-- end release-specific documentation -->
3892     *
3893     * @exception SQLException if a database access error
3894     * occurs or if this method is called when the cursor is
3895     * on the insert row
3896     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3897     * jdbcResultSet)
3898     */

3899    public void cancelRowUpdates() throws SQLException JavaDoc {
3900        throw Util.notSupported();
3901    }
3902
3903    /**
3904     * <!-- start generic documentation -->
3905     * Moves the cursor to the insert row. The current cursor position is
3906     * remembered while the cursor is positioned on the insert row.
3907     *
3908     * The insert row is a special row associated with an updatable
3909     * result set. It is essentially a buffer where a new row may
3910     * be constructed by calling the updater methods prior to
3911     * inserting the row into the result set.
3912     *
3913     * Only the updater, getter,
3914     * and <code>insertRow</code> methods may be
3915     * called when the cursor is on the insert row. All of the columns in
3916     * a result set must be given a value each time this method is
3917     * called before calling <code>insertRow</code>.
3918     * An updater method must be called before a
3919     * getter method can be called on a column value. <p>
3920     * <!-- end generic documentation -->
3921     *
3922     * <!-- start release-specific documentation -->
3923     * <div class="ReleaseSpecificDocumentation">
3924     * <h3>HSQLDB-Specific Information:</h3> <p>
3925     *
3926     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3927     *
3928     * This method always throws an SQLException stating that
3929     * the operation is not supported.
3930     * </div>
3931     * <!-- end release-specific documentation -->
3932     *
3933     * @exception SQLException if a database access error occurs
3934     * or the result set is not updatable
3935     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3936     * jdbcResultSet)
3937     */

3938    public void moveToInsertRow() throws SQLException JavaDoc {
3939        throw Util.notSupported();
3940    }
3941
3942    /**
3943     * <!-- start generic documentation -->
3944     * Moves the cursor to the remembered cursor position, usually the
3945     * current row. This method has no effect if the cursor is not on
3946     * the insert row. <p>
3947     * <!-- end generic documentation -->
3948     *
3949     * <!-- start release-specific documentation -->
3950     * <div class="ReleaseSpecificDocumentation">
3951     * <h3>HSQLDB-Specific Information:</h3> <p>
3952     *
3953     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
3954     *
3955     * This method is ignored.
3956     * </div>
3957     * <!-- end release-specific documentation -->
3958     * @exception SQLException if a database access error occurs
3959     * or the result set is not updatable
3960     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3961     * jdbcResultSet)
3962     */

3963    public void moveToCurrentRow() throws SQLException JavaDoc {}
3964
3965    /**
3966     * <!-- start generic documentation -->
3967     * Retrieves the <code>Statement</code> object that produced this
3968     * <code>ResultSet</code> object.
3969     * If the result set was generated some other way, such as by a
3970     * <code>DatabaseMetaData</code> method, this method returns
3971     * <code>null</code>. <p>
3972     * <!-- end generic documentation -->
3973     *
3974     * @return the <code>Statment</code> object that produced
3975     * this <code>ResultSet</code> object or <code>null</code>
3976     * if the result set was produced some other way
3977     * @exception SQLException if a database access error occurs
3978     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
3979     * jdbcResultSet)
3980     */

3981    public Statement JavaDoc getStatement() throws SQLException JavaDoc {
3982        return (Statement JavaDoc) sqlStatement;
3983    }
3984
3985    /**
3986     * <!-- start generic documentation -->
3987     * Retrieves the value of the designated column in the current row
3988     * of this <code>ResultSet</code> object as an <code>Object</code>
3989     * in the Java programming language.
3990     * If the value is an SQL <code>NULL</code>,
3991     * the driver returns a Java <code>null</code>.
3992     * This method uses the given <code>Map</code> object
3993     * for the custom mapping of the
3994     * SQL structured or distinct type that is being retrieved. <p>
3995     * <!-- end generic documentation -->
3996     *
3997     * <!-- start release-specific documentation -->
3998     * <div class="ReleaseSpecificDocumentation">
3999     * <h3>HSQLDB-Specific Information:</h3> <p>
4000     *
4001     * Including 1.7.2, HSQLDB does not support this feature. <p>
4002     *
4003     * This method always throws an <code>SQLException</code>,
4004     * stating that the operation is not supported.
4005     * </div>
4006     * <!-- end release-specific documentation -->
4007     *
4008     * @param i the first column is 1, the second is 2, ...
4009     * @param map a <code>java.util.Map</code> object that contains the
4010     * mapping from SQL type names to classes in the Java programming
4011     * language
4012     * @return an <code>Object</code> in the Java programming language
4013     * representing the SQL value
4014     * @exception SQLException if a database access error occurs
4015     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4016     * jdbcResultSet)
4017     */

4018    public Object JavaDoc getObject(int i, Map JavaDoc map) throws SQLException JavaDoc {
4019        throw Util.notSupported();
4020    }
4021
4022    /**
4023     * <!-- start generic documentation -->
4024     * Retrieves the value of the designated column in the current row
4025     * of this <code>ResultSet</code> object as a <code>Ref</code> object
4026     * in the Java programming language. <p>
4027     * <!-- end generic documentation -->
4028     *
4029     * <!-- start release-specific documentation -->
4030     * <div class="ReleaseSpecificDocumentation">
4031     * <h3>HSQLDB-Specific Information:</h3> <p>
4032     *
4033     * Including 1.7.2, HSQLDB does not support this feature. <p>
4034     *
4035     * This method always throws an <code>SQLException</code>
4036     * stating that the operation is not supported.
4037     * </div>
4038     * <!-- end release-specific documentation -->
4039     *
4040     * @param i the first column is 1, the second is 2, ...
4041     * @return a <code>Ref</code> object representing an SQL <code>REF</code>
4042     * value
4043     * @exception SQLException if a database access error occurs
4044     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4045     * jdbcResultSet)
4046     */

4047    public Ref JavaDoc getRef(int i) throws SQLException JavaDoc {
4048        throw Util.notSupported();
4049    }
4050
4051    /**
4052     * <!-- start generic documentation -->
4053     * Retrieves the value of the designated column in the current row
4054     * of this <code>ResultSet</code> object as a <code>Blob</code> object
4055     * in the Java programming language. <p>
4056     * <!-- end generic documentation -->
4057     *
4058     * <!-- start release-specific documentation -->
4059     * <div class="ReleaseSpecificDocumentation">
4060     * <h3>HSQLDB-Specific Information:</h3> <p>
4061     *
4062     * Starting with 1.7.2, this feature is supported.
4063     * </div>
4064     * <!-- end release-specific documentation -->
4065     *
4066     * @param i the first column is 1, the second is 2, ...
4067     * @return a <code>Blob</code> object representing the SQL
4068     * <code>BLOB</code> value in the specified column
4069     * @exception SQLException if a database access error occurs
4070     * @since JDK 1.2
4071     */

4072
4073//#ifdef JAVA2
4074
public Blob JavaDoc getBlob(int i) throws SQLException JavaDoc {
4075
4076        byte[] b = getBytes(i);
4077
4078        return b == null ? null
4079                         : new jdbcBlob(b);
4080    }
4081
4082//#endif JAVA2
4083

4084    /**
4085     * <!-- start generic documentation -->
4086     * Retrieves the value of the designated column in the current row
4087     * of this <code>ResultSet</code> object as a <code>Clob</code> object
4088     * in the Java programming language. <p>
4089     * <!-- end generic documentation -->
4090     *
4091     * <!-- start release-specific documentation -->
4092     * <div class="ReleaseSpecificDocumentation">
4093     * <h3>HSQLDB-Specific Information:</h3> <p>
4094     *
4095     * Starting with 1.7.2, this feature is supported. <p>
4096     * </div>
4097     * <!-- end release-specific documentation -->
4098     *
4099     * @param i the first column is 1, the second is 2, ...
4100     * @return a <code>Clob</code> object representing the SQL
4101     * <code>CLOB</code> value in the specified column
4102     * @exception SQLException if a database access error occurs
4103     * @since JDK 1.2
4104     */

4105//#ifdef JAVA2
4106
public Clob JavaDoc getClob(int i) throws SQLException JavaDoc {
4107
4108        String JavaDoc s = getString(i);
4109
4110        return s == null ? null
4111                         : new jdbcClob(s);
4112    }
4113
4114//#endif JAVA2
4115

4116    /**
4117     * <!-- start generic documentation -->
4118     * Retrieves the value of the designated column in the current row
4119     * of this <code>ResultSet</code> object as an <code>Array</code> object
4120     * in the Java programming language. <p>
4121     * <!-- end generic documentation -->
4122     *
4123     * <!-- start release-specific documentation -->
4124     * <div class="ReleaseSpecificDocumentation">
4125     * <h3>HSQLDB-Specific Information:</h3> <p>
4126     *
4127     * Including 1.7.2, HSQLDB does not support this feature. <p>
4128     *
4129     * This method always throws an <code>SQLException</code>
4130     * stating that the operation is not supported.
4131     * </div>
4132     * <!-- end release-specific documentation -->
4133     *
4134     * @param i the first column is 1, the second is 2, ...
4135     * @return an <code>Array</code> object representing the SQL
4136     * <code>ARRAY</code> value in the specified column
4137     * @exception SQLException if a database access error occurs
4138     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4139     * jdbcResultSet)
4140     */

4141    public Array JavaDoc getArray(int i) throws SQLException JavaDoc {
4142        throw Util.notSupported();
4143    }
4144
4145    /**
4146     * <!-- start generic documentation -->
4147     * Retrieves the value of the designated column in the current row
4148     * of this <code>ResultSet</code> object as an <code>Object</code>
4149     * in the Java programming language.
4150     * If the value is an SQL <code>NULL</code>,
4151     * the driver returns a Java <code>null</code>.
4152     * This method uses the specified <code>Map</code> object for
4153     * custom mapping if appropriate. <p>
4154     * <!-- end generic documentation -->
4155     *
4156     * <!-- start release-specific documentation -->
4157     * <div class="ReleaseSpecificDocumentation">
4158     * <h3>HSQLDB-Specific Information:</h3> <p>
4159     *
4160     * Including 1.7.2, HSQLDB does not support this feature. <p>
4161     *
4162     * This method always throws an <code>SQLException</code>
4163     * stating that the operation is not supported.
4164     * </div>
4165     * <!-- end release-specific documentation -->
4166     *
4167     * @param colName the name of the column from which to retrieve the value
4168     * @param map a <code>java.util.Map</code> object that contains the
4169     * mapping from SQL type names to classes in the Java programming
4170     * language
4171     * @return an <code>Object</code> representing the SQL value in the
4172     * specified column
4173     * @exception SQLException if a database access error occurs
4174     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4175     * jdbcResultSet)
4176     */

4177    public Object JavaDoc getObject(String JavaDoc colName, Map JavaDoc map) throws SQLException JavaDoc {
4178
4179        // MODIFIED:
4180
// made this consistent with all other
4181
// column name oriented methods
4182
// boucherb@users 2002013
4183
return getObject(findColumn(colName), map);
4184    }
4185
4186    /**
4187     * <!-- start generic documentation -->
4188     * Retrieves the value of the designated column in the current row
4189     * of this <code>ResultSet</code> object as a <code>Ref</code> object
4190     * in the Java programming language. <p>
4191     * <!-- end generic documentation -->
4192     *
4193     * <!-- start release-specific documentation -->
4194     * <div class="ReleaseSpecificDocumentation">
4195     * <h3>HSQLDB-Specific Information:</h3> <p>
4196     *
4197     * Including 1.7.2, HSQLDB does not support this feature. <p>
4198     *
4199     * This method always throws an <code>SQLException</code>,
4200     * stating that the operartion is not supported.
4201     * </div>
4202     * <!-- end release-specific documentation -->
4203     * @param colName the column name
4204     * @return a <code>Ref</code> object representing the SQL <code>REF</code>
4205     * value in the specified column
4206     * @exception SQLException if a database access error occurs
4207     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4208     * jdbcResultSet)
4209     */

4210    public Ref JavaDoc getRef(String JavaDoc colName) throws SQLException JavaDoc {
4211        return getRef(findColumn(colName));
4212    }
4213
4214    /**
4215     * <!-- start generic documentation -->
4216     * Retrieves the value of the designated column in the current row
4217     * of this <code>ResultSet</code> object as a <code>Blob</code> object
4218     * in the Java programming language. <p>
4219     * <!-- end generic documentation -->
4220     *
4221     * <!-- start release-specific documentation -->
4222     * <div class="ReleaseSpecificDocumentation">
4223     * <h3>HSQLDB-Specific Information:</h3> <p>
4224     *
4225     * Starting with 1.7.2, this feature is supported.
4226     * </div>
4227     * <!-- end release-specific documentation -->
4228     *
4229     * @param colName the name of the column from which to retrieve the value
4230     * @return a <code>Blob</code> object representing the
4231     * SQL <code>BLOB</code> value in the specified column
4232     * @exception SQLException if a database access error occurs
4233     * @since JDK 1.2
4234     */

4235
4236//#ifdef JAVA2
4237
public Blob JavaDoc getBlob(String JavaDoc colName) throws SQLException JavaDoc {
4238        return getBlob(findColumn(colName));
4239    }
4240
4241//#endif JAVA2
4242

4243    /**
4244     * <!-- start generic documentation -->
4245     * Retrieves the value of the designated column in the current row
4246     * of this <code>ResultSet</code> object as a <code>Clob</code> object
4247     * in the Java programming language. <p>
4248     * <!-- end generic documentation -->
4249     *
4250     * <!-- start release-specific documentation -->
4251     * <div class="ReleaseSpecificDocumentation">
4252     * <h3>HSQLDB-Specific Information:</h3> <p>
4253     *
4254     * Starting with 1.7.2, this feature is supported.
4255     * </div>
4256     * <!-- end release-specific documentation -->
4257     *
4258     * @param colName the name of the column from which to retrieve the value
4259     * @return a <code>Clob</code> object representing the SQL
4260     * <code>CLOB</code> value in the specified column
4261     * @exception SQLException if a database access error occurs
4262     * @since JDK 1.2
4263     */

4264//#ifdef JAVA2
4265
public Clob JavaDoc getClob(String JavaDoc colName) throws SQLException JavaDoc {
4266        return getClob(findColumn(colName));
4267    }
4268
4269//#endif JAVA2
4270

4271    /**
4272     * <!-- start generic documentation -->
4273     * Retrieves the value of the designated column in the current row
4274     * of this <code>ResultSet</code> object as an <code>Array</code> object
4275     * in the Java programming language. <p>
4276     * <!-- end generic documentation -->
4277     *
4278     * <!-- start release-specific documentation -->
4279     * <div class="ReleaseSpecificDocumentation">
4280     * <h3>HSQLDB-Specific Information:</h3> <p>
4281     *
4282     * Including 1.7.2, HSQLDB does not support this feature. <p>
4283     *
4284     * This method always throws an <code>SQLException</code>
4285     * stating that the operation is not supported.
4286     * </div>
4287     * <!-- end release-specific documentation -->
4288     *
4289     * @param colName the name of the column from which to retrieve the value
4290     * @return an <code>Array</code> object representing the SQL
4291     * <code>ARRAY</code> value in the specified column
4292     * @exception SQLException if a database access error occurs
4293     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4294     * jdbcResultSet)
4295     */

4296    public Array JavaDoc getArray(String JavaDoc colName) throws SQLException JavaDoc {
4297        return getArray(findColumn(colName));
4298    }
4299
4300    /**
4301     * <!-- start generic documentation -->
4302     * Retrieves the value of the designated column in the current row
4303     * of this <code>ResultSet</code> object as a
4304     * <code>java.sql.Date</code> object
4305     * in the Java programming language.
4306     * This method uses the given calendar to construct an appropriate
4307     * millisecond value for the date if the underlying database does
4308     * not store timezone information. <p>
4309     * <!-- end generic documentation -->
4310     *
4311     * @param columnIndex the first column is 1, the second is 2, ...
4312     * @param cal the <code>java.util.Calendar</code> object
4313     * to use in constructing the date
4314     * @return the column value as a <code>java.sql.Date</code> object;
4315     * if the value is SQL <code>NULL</code>, the value returned is
4316     * <code>null</code> in the Java programming language
4317     * @exception SQLException if a database access error occurs
4318     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4319     * jdbcResultSet)
4320     */

4321    public Date JavaDoc getDate(int columnIndex, Calendar JavaDoc cal) throws SQLException JavaDoc {
4322
4323        Date JavaDoc date = getDate(columnIndex);
4324
4325        if (date == null) {
4326            return null;
4327        }
4328
4329        if (cal == null) {
4330            return date;
4331        }
4332
4333        cal.setTime(date);
4334        HsqlDateTime.resetToDate(cal);
4335
4336        return new Date JavaDoc(cal.getTime().getTime());
4337    }
4338
4339    /**
4340     * <!-- start generic documentation -->
4341     * Retrieves the value of the designated column in the current row
4342     * of this <code>ResultSet</code> object as a <code>java.sql.Date</code>
4343     * object in the Java programming language.
4344     * This method uses the given calendar to construct an appropriate
4345     * millisecond
4346     * value for the date if the underlying database does not store
4347     * timezone information. <p>
4348     * <!-- end generic documentation -->
4349     *
4350     * @param columnName the SQL name of the column from which to retrieve the
4351     * value
4352     * @param cal the <code>java.util.Calendar</code> object
4353     * to use in constructing the date
4354     * @return the column value as a <code>java.sql.Date</code> object;
4355     * if the value is SQL <code>NULL</code>,
4356     * the value returned is <code>null</code> in the Java programming
4357     * language
4358     * @exception SQLException if a database access error occurs
4359     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4360     * jdbcResultSet)
4361     */

4362    public Date JavaDoc getDate(String JavaDoc columnName, Calendar JavaDoc cal) throws SQLException JavaDoc {
4363        return getDate(findColumn(columnName), cal);
4364    }
4365
4366    /**
4367     * <!-- start generic documentation -->
4368     * Retrieves the value of the designated column in the current row
4369     * of this <code>ResultSet</code> object as a <code>java.sql.Time</code>
4370     * object in the Java programming language.
4371     * This method uses the given calendar to construct an appropriate
4372     * millisecond value for the time if the underlying database does not
4373     * store timezone information. <p>
4374     * <!-- end generic documentation -->
4375     *
4376     * @param columnIndex the first column is 1, the second is 2, ...
4377     * @param cal the <code>java.util.Calendar</code> object
4378     * to use in constructing the time
4379     * @return the column value as a <code>java.sql.Time</code> object;
4380     * if the value is SQL <code>NULL</code>,
4381     * the value returned is <code>null</code> in the Java programming
4382     * language
4383     * @exception SQLException if a database access error occurs
4384     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4385     * jdbcResultSet)
4386     */

4387    public Time JavaDoc getTime(int columnIndex, Calendar JavaDoc cal) throws SQLException JavaDoc {
4388
4389        Time JavaDoc t = getTime(columnIndex);
4390
4391        if (t == null) {
4392            return null;
4393        }
4394
4395        if (cal == null) {
4396            return t;
4397        }
4398
4399        cal.setTime(t);
4400        HsqlDateTime.resetToTime(cal);
4401
4402        return new Time JavaDoc(cal.getTime().getTime());
4403    }
4404
4405    /**
4406     * <!-- start generic documentation -->
4407     * Retrieves the value of the designated column in the current row
4408     * of this <code>ResultSet</code> object as
4409     * a <code>java.sql.Time</code> object
4410     * in the Java programming language.
4411     * This method uses the given calendar to construct an appropriate
4412     * millisecond
4413     * value for the time if the underlying database does not store
4414     * timezone information. <p>
4415     * <!-- end generic documentation -->
4416     *
4417     * @param columnName the SQL name of the column
4418     * @param cal the <code>java.util.Calendar</code> object
4419     * to use in constructing the time
4420     * @return the column value as a <code>java.sql.Time</code> object;
4421     * if the value is SQL <code>NULL</code>,
4422     * the value returned is <code>null</code> in the Java programming
4423     * language
4424     * @exception SQLException if a database access error occurs
4425     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4426     * jdbcResultSet)
4427     */

4428    public Time JavaDoc getTime(String JavaDoc columnName, Calendar JavaDoc cal) throws SQLException JavaDoc {
4429        return getTime(findColumn(columnName), cal);
4430    }
4431
4432    /**
4433     * <!-- start generic documentation -->
4434     * Retrieves the value of the designated column in the current row
4435     * of this <code>ResultSet</code> object as a
4436     * <code>java.sql.Timestamp</code> object in the Java programming
4437     * anguage.
4438     * This method uses the given calendar to construct an appropriate
4439     * millisecond value for the timestamp if the underlying database does
4440     * not store timezone information. <p>
4441     * <!-- end generic documentation -->
4442     *
4443     * @param columnIndex the first column is 1, the second is 2, ...
4444     * @param cal the <code>java.util.Calendar</code> object
4445     * to use in constructing the timestamp
4446     * @return the column value as a <code>java.sql.Timestamp</code> object;
4447     * if the value is SQL <code>NULL</code>,
4448     * the value returned is <code>null</code> in the Java programming
4449     * language
4450     * @exception SQLException if a database access error occurs
4451     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4452     * jdbcResultSet)
4453     */

4454    public Timestamp JavaDoc getTimestamp(int columnIndex,
4455                                  Calendar JavaDoc cal) throws SQLException JavaDoc {
4456
4457        Timestamp JavaDoc ts = getTimestamp(columnIndex);
4458
4459        if (cal != null && ts != null) {
4460            ts.setTime(HsqlDateTime.getTimeInMillis(ts, null, cal));
4461        }
4462
4463        return ts;
4464    }
4465
4466    /**
4467     * <!-- start generic documentation -->
4468     * Retrieves the value of the designated column in the current row
4469     * of this <code>ResultSet</code> object as a
4470     * <code>java.sql.Timestamp</code> object in the Java programming
4471     * language.
4472     * This method uses the given calendar to construct an appropriate
4473     * millisecond value for the timestamp if the underlying database does
4474     * not store timezone information. <p>
4475     * <!-- end generic documentation -->
4476     *
4477     * @param columnName the SQL name of the column
4478     * @param cal the <code>java.util.Calendar</code> object
4479     * to use in constructing the date
4480     * @return the column value as a <code>java.sql.Timestamp</code> object;
4481     * if the value is SQL <code>NULL</code>,
4482     * the value returned is <code>null</code> in the Java programming
4483     * language
4484     * @exception SQLException if a database access error occurs
4485     * @since JDK 1.2 (JDK 1.1.x developers: read the new overview for
4486     * jdbcResultSet)
4487     */

4488    public Timestamp JavaDoc getTimestamp(String JavaDoc columnName,
4489                                  Calendar JavaDoc cal) throws SQLException JavaDoc {
4490        return getTimestamp(findColumn(columnName), cal);
4491    }
4492
4493    //-------------------------- JDBC 3.0 ----------------------------------------
4494

4495    /**
4496     * <!-- start generic documentation -->
4497     * Retrieves the value of the designated column in the current row
4498     * of this <code>ResultSet</code> object as a <code>java.net.URL</code>
4499     * object in the Java programming language. <p>
4500     * <!-- end generic documentation -->
4501     *
4502     * <!-- start release-specific documentation -->
4503     * <div class="ReleaseSpecificDocumentation">
4504     * <h3>HSQLDB-Specific Information:</h3> <p>
4505     *
4506     * Including 1.7.2, HSQLDB does not support this feature. <p>
4507     *
4508     * This method always throws an <code>SQLException</code>
4509     * stating that the operation is not supported.
4510     * </div>
4511     * <!-- end release-specific documentation -->
4512     *
4513     * @param columnIndex the index of the column 1 is the first, 2
4514     * is the second,...
4515     * @return the column value as a <code>java.net.URL</code> object;
4516     * if the value is SQL <code>NULL</code>, the value returned
4517     * is <code>null</code> in the Java programming language
4518     * @exception SQLException if a database access error occurs,
4519     * or if a URL is malformed
4520     * @since JDK 1.4, HSQLDB 1.7.0
4521     */

4522//#ifdef JDBC3
4523
public java.net.URL JavaDoc getURL(int columnIndex) throws SQLException JavaDoc {
4524        throw Util.notSupported();
4525    }
4526
4527//#endif JDBC3
4528

4529    /**
4530     * <!-- start generic documentation -->
4531     * Retrieves the value of the designated column in the current row
4532     * of this <code>ResultSet</code> object as a <code>java.net.URL</code>
4533     * object in the Java programming language. <p>
4534     * <!-- end generic documentation -->
4535     *
4536     * <!-- start release-specific documentation -->
4537     * <div class="ReleaseSpecificDocumentation">
4538     * <h3>HSQLDB-Specific Information:</h3> <p>
4539     *
4540     * Including 1.7.2, HSQLDB does not support this feature. <p>
4541     *
4542     * This method always throws an <code>SQLException</code>
4543     * stating that the operation is not supported.
4544     * </div>
4545     * <!-- end release-specific documentation -->
4546     *
4547     * @param columnName the SQL name of the column
4548     * @return the column value as a <code>java.net.URL</code> object;
4549     * if the value is SQL <code>NULL</code>, the value returned
4550     * is <code>null</code> in the Java programming language
4551     * @exception SQLException if a database access error occurs
4552     * or if a URL is malformed
4553     * @since JDK 1.4, HSQLDB 1.7.0
4554     */

4555//#ifdef JDBC3
4556
public java.net.URL JavaDoc getURL(String JavaDoc columnName) throws SQLException JavaDoc {
4557        throw Util.notSupported();
4558    }
4559
4560//#endif JDBC3
4561

4562    /**
4563     * <!-- start generic documentation -->
4564     * Updates the designated column with a <code>java.sql.Ref</code> value.
4565     * The updater methods are used to update column values in the
4566     * current row or the insert row. The updater methods do not
4567     * update the underlying database; instead the <code>updateRow</code> or
4568     * <code>insertRow</code> methods are called to update the database. <p>
4569     * <!-- end generic documentation -->
4570     *
4571     * <!-- start release-specific documentation -->
4572     * <div class="ReleaseSpecificDocumentation">
4573     * <h3>HSQLDB-Specific Information:</h3> <p>
4574     *
4575     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
4576     *
4577     * This method always throws an SQLException, stating that
4578     * the operation is not supported.
4579     * </div>
4580     * <!-- end release-specific documentation -->
4581     *
4582     * @param columnIndex the first column is 1, the second is 2, ...
4583     * @param x the new column value
4584     * @exception SQLException if a database access error occurs
4585     * @since JDK 1.4, HSQLDB 1.7.0
4586     */

4587//#ifdef JDBC3
4588
public void updateRef(int columnIndex,
4589                          java.sql.Ref JavaDoc x) throws SQLException JavaDoc {
4590        throw Util.notSupported();
4591    }
4592
4593//#endif JDBC3
4594

4595    /**
4596     * <!-- start generic documentation -->
4597     * Updates the designated column with a <code>java.sql.Ref</code> value.
4598     * The updater methods are used to update column values in the
4599     * current row or the insert row. The updater methods do not
4600     * update the underlying database; instead the <code>updateRow</code> or
4601     * <code>insertRow</code> methods are called to update the database. <p>
4602     * <!-- end generic documentation -->
4603     *
4604     * <!-- start release-specific documentation -->
4605     * <div class="ReleaseSpecificDocumentation">
4606     * <h3>HSQLDB-Specific Information:</h3> <p>
4607     *
4608     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
4609     *
4610     * This method always throws an SQLException, stating that
4611     * the operation is not supported.
4612     * </div>
4613     * <!-- end release-specific documentation -->
4614     *
4615     * @param columnName the name of the column
4616     * @param x the new column value
4617     * @exception SQLException if a database access error occurs
4618     * @since JDK 1.4, HSQLDB 1.7.0
4619     */

4620//#ifdef JDBC3
4621
public void updateRef(String JavaDoc columnName,
4622                          java.sql.Ref JavaDoc x) throws SQLException JavaDoc {
4623        throw Util.notSupported();
4624    }
4625
4626//#endif JDBC3
4627

4628    /**
4629     * <!-- start generic documentation -->
4630     * Updates the designated column with a <code>java.sql.Blob</code> value.
4631     * The updater methods are used to update column values in the
4632     * current row or the insert row. The updater methods do not
4633     * update the underlying database; instead the <code>updateRow</code> or
4634     * <code>insertRow</code> methods are called to update the database. <p>
4635     * <!-- end generic documentation -->
4636     *
4637     * <!-- start release-specific documentation -->
4638     * <div class="ReleaseSpecificDocumentation">
4639     * <h3>HSQLDB-Specific Information:</h3> <p>
4640     *
4641     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
4642     *
4643     * This method always throws an SQLException, stating that
4644     * the operation is not supported.
4645     * </div>
4646     * <!-- end release-specific documentation -->
4647     *
4648     * @param columnIndex the first column is 1, the second is 2, ...
4649     * @param x the new column value
4650     * @exception SQLException if a database access error occurs
4651     * @since JDK 1.4, HSQLDB 1.7.0
4652     */

4653//#ifdef JDBC3
4654
public void updateBlob(int columnIndex,
4655                           java.sql.Blob JavaDoc x) throws SQLException JavaDoc {
4656        throw Util.notSupported();
4657    }
4658
4659//#endif JDBC3
4660

4661    /**
4662     * <!-- start generic documentation -->
4663     * Updates the designated column with a <code>java.sql.Blob</code> value.
4664     * The updater methods are used to update column values in the
4665     * current row or the insert row. The updater methods do not
4666     * update the underlying database; instead the <code>updateRow</code> or
4667     * <code>insertRow</code> methods are called to update the database. <p>
4668     * <!-- end generic documentation -->
4669     *
4670     * <!-- start release-specific documentation -->
4671     * <div class="ReleaseSpecificDocumentation">
4672     * <h3>HSQLDB-Specific Information:</h3> <p>
4673     *
4674     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
4675     *
4676     * This method always throws an SQLException, stating that
4677     * the operation is not supported.
4678     * </div>
4679     * <!-- end release-specific documentation -->
4680     *
4681     * @param columnName the name of the column
4682     * @param x the new column value
4683     * @exception SQLException if a database access error occurs
4684     * @since JDK 1.4, HSQLDB 1.7.0
4685     */

4686//#ifdef JDBC3
4687
public void updateBlob(String JavaDoc columnName,
4688                           java.sql.Blob JavaDoc x) throws SQLException JavaDoc {
4689        throw Util.notSupported();
4690    }
4691
4692//#endif JDBC3
4693

4694    /**
4695     * <!-- start generic documentation -->
4696     * Updates the designated column with a <code>java.sql.Clob</code> value.
4697     * The updater methods are used to update column values in the
4698     * current row or the insert row. The updater methods do not
4699     * update the underlying database; instead the <code>updateRow</code> or
4700     * <code>insertRow</code> methods are called to update the database. <p>
4701     * <!-- end generic documentation -->
4702     *
4703     * <!-- start release-specific documentation -->
4704     * <div class="ReleaseSpecificDocumentation">
4705     * <h3>HSQLDB-Specific Information:</h3> <p>
4706     *
4707     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
4708     *
4709     * This method always throws an SQLException, stating that
4710     * the operation is not supported.
4711     * </div>
4712     * <!-- end release-specific documentation -->
4713     *
4714     * @param columnIndex the first column is 1, the second is 2, ...
4715     * @param x the new column value
4716     * @exception SQLException if a database access error occurs
4717     * @since JDK 1.4, HSQLDB 1.7.0
4718     */

4719//#ifdef JDBC3
4720
public void updateClob(int columnIndex,
4721                           java.sql.Clob JavaDoc x) throws SQLException JavaDoc {
4722        throw Util.notSupported();
4723    }
4724
4725//#endif JDBC3
4726

4727    /**
4728     * <!-- start generic documentation -->
4729     * Updates the designated column with a <code>java.sql.Clob</code> value.
4730     * The updater methods are used to update column values in the
4731     * current row or the insert row. The updater methods do not
4732     * update the underlying database; instead the <code>updateRow</code> or
4733     * <code>insertRow</code> methods are called to update the database. <p>
4734     * <!-- end generic documentation -->
4735     *
4736     * <!-- start release-specific documentation -->
4737     * <div class="ReleaseSpecificDocumentation">
4738     * <h3>HSQLDB-Specific Information:</h3> <p>
4739     *
4740     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
4741     *
4742     * This method always throws an SQLException, stating that
4743     * the operation is not supported.
4744     * </div>
4745     * <!-- end release-specific documentation -->
4746     *
4747     * @param columnName the name of the column
4748     * @param x the new column value
4749     * @exception SQLException if a database access error occurs
4750     * @since JDK 1.4, HSQLDB 1.7.0
4751     */

4752//#ifdef JDBC3
4753
public void updateClob(String JavaDoc columnName,
4754                           java.sql.Clob JavaDoc x) throws SQLException JavaDoc {
4755        throw Util.notSupported();
4756    }
4757
4758//#endif JDBC3
4759

4760    /**
4761     * <!-- start generic documentation -->
4762     * Updates the designated column with a <code>java.sql.Array</code> value.
4763     * The updater methods are used to update column values in the
4764     * current row or the insert row. The updater methods do not
4765     * update the underlying database; instead the <code>updateRow</code> or
4766     * <code>insertRow</code> methods are called to update the database. <p>
4767     * <!-- end generic documentation -->
4768     *
4769     * <!-- start release-specific documentation -->
4770     * <div class="ReleaseSpecificDocumentation">
4771     * <h3>HSQLDB-Specific Information:</h3> <p>
4772     *
4773     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
4774     *
4775     * This method always throws an SQLException stating that
4776     * the operation is not supported.
4777     * </div>
4778     * <!-- end release-specific documentation -->
4779     *
4780     * @param columnIndex the first column is 1, the second is 2, ...
4781     * @param x the new column value
4782     * @exception SQLException if a database access error occurs
4783     * @since JDK 1.4, HSQLDB 1.7.0
4784     */

4785//#ifdef JDBC3
4786
public void updateArray(int columnIndex,
4787                            java.sql.Array JavaDoc x) throws SQLException JavaDoc {
4788        throw Util.notSupported();
4789    }
4790
4791//#endif JDBC3
4792

4793    /**
4794     * <!-- start generic documentation -->
4795     * Updates the designated column with a <code>java.sql.Array</code> value.
4796     * The updater methods are used to update column values in the
4797     * current row or the insert row. The updater methods do not
4798     * update the underlying database; instead the <code>updateRow</code> or
4799     * <code>insertRow</code> methods are called to update the database. <p>
4800     * <!-- end generic documentation -->
4801     *
4802     * <!-- start release-specific documentation -->
4803     * <div class="ReleaseSpecificDocumentation">
4804     * <h3>HSQLDB-Specific Information:</h3> <p>
4805     *
4806     * Including 1.7.2, HSQLDB does not support updateable result sets. <p>
4807     *
4808     * This method always throws an SQLException, stating that
4809     * the operation is not supported.
4810     * </div>
4811     * <!-- end release-specific documentation -->
4812     *
4813     * @param columnName the name of the column
4814     * @param x the new column value
4815     * @exception SQLException if a database access error occurs
4816     * @since JDK 1.4, HSQLDB 1.7.0
4817     */

4818//#ifdef JDBC3
4819
public void updateArray(String JavaDoc columnName,
4820                            java.sql.Array JavaDoc x) throws SQLException JavaDoc {
4821        throw Util.notSupported();
4822    }
4823
4824//#endif JDBC3
4825
//-------------------- Internal Implementation -------------------------
4826
// Support for JDBC 2 from JRE 1.1.x
4827

4828    /** Copy of java.sql.ResultSet constant, for JDK 1.1 clients. */
4829    public static final int FETCH_FORWARD = 1000;
4830
4831    /** Copy of java.sql.ResultSet constant, for JDK 1.1 clients. */
4832    public static final int FETCH_REVERSE = 1001;
4833
4834    /** Copy of java.sql.ResultSet constant, for JDK 1.1 clients. */
4835    public static final int FETCH_UNKNOWN = 1002;
4836
4837    /** Copy of java.sql.ResultSet constant, for JDK 1.1 clients. */
4838    public static final int TYPE_FORWARD_ONLY = 1003;
4839
4840    /** Copy of java.sql.ResultSet constant, for JDK 1.1 clients. */
4841    public static final int TYPE_SCROLL_INSENSITIVE = 1004;
4842
4843    /** Copy of java.sql.ResultSet constant, for JDK 1.1 clients. */
4844    public static final int TYPE_SCROLL_SENSITIVE = 1005;
4845
4846    /** Copy of java.sql.ResultSet constant, for JDK 1.1 clients. */
4847    public static final int CONCUR_READ_ONLY = 1007;
4848
4849    /** Copy of java.sql.ResultSet constant, for JDK 1.1 clients. */
4850    public static final int CONCUR_UPDATABLE = 1008;
4851
4852    /** Copy of java.sql.ResultSet constant, for JDK 1.1 clients. */
4853    public static final int HOLD_CURSORS_OVER_COMMIT = 1;
4854
4855    /** Copy of java.sql.ResultSet constant, for JDK 1.1 clients. */
4856    public static final int CLOSE_CURSORS_AT_COMMIT = 2;
4857
4858    //---------------------------- Private ---------------------------------
4859

4860    /**
4861     * Internal row data availability check.
4862     *
4863     * @throws SQLException when no row data is available
4864     */

4865    private void checkAvailable() throws SQLException JavaDoc {
4866
4867        if (rResult == null ||!bInit || nCurrent == null) {
4868            throw Util.sqlException(Trace.NO_DATA_IS_AVAILABLE);
4869        }
4870    }
4871
4872    /**
4873     * Internal closed state check.
4874     *
4875     * @throws SQLException when this result set is closed
4876     */

4877    private void checkClosed() throws SQLException JavaDoc {
4878
4879        if (rResult == null
4880                || (sqlStatement != null && sqlStatement.isClosed)) {
4881            throw Util.sqlException(Trace.JDBC_RESULTSET_IS_CLOSED);
4882        }
4883    }
4884
4885    /**
4886     * Internal column index validity check.
4887     *
4888     * @param columnIndex to check
4889     * @throws SQLException when this ResultSet has no such column
4890     */

4891    void checkColumn(int columnIndex) throws SQLException JavaDoc {
4892
4893        if (columnIndex < 1 || columnIndex > iColumnCount) {
4894            throw Util.sqlException(Trace.COLUMN_NOT_FOUND,
4895                                    String.valueOf(columnIndex));
4896        }
4897    }
4898
4899    /**
4900     * Internal wasNull tracker.
4901     *
4902     * @param o the Object to track
4903     */

4904    private boolean checkNull(Object JavaDoc o) {
4905
4906        if (o == null) {
4907            bWasNull = true;
4908
4909            return true;
4910        } else {
4911            bWasNull = false;
4912
4913            return false;
4914        }
4915    }
4916
4917    /**
4918     * Internal value converter. <p>
4919     *
4920     * All trivially successful getXXX methods eventually go through this
4921     * method, converting if neccessary from the hsqldb-native representation
4922     * of a column's value to the requested representation. <p>
4923     *
4924     * @return an Object of the requested type, representing the value of the
4925     * specified column
4926     * @param columnIndex of the column value for which to perform the
4927     * conversion
4928     * @param type the org.hsqldb.Types code for type
4929     * @throws SQLException when there is no data, the column index is
4930     * invalid, or the conversion cannot be performed
4931     */

4932    private Object JavaDoc getColumnInType(int columnIndex,
4933                                   int type) throws SQLException JavaDoc {
4934
4935        checkAvailable();
4936
4937        int t;
4938        Object JavaDoc o;
4939
4940        try {
4941            t = rResult.metaData.colTypes[--columnIndex];
4942            o = nCurrent.data[columnIndex];
4943        } catch (ArrayIndexOutOfBoundsException JavaDoc e) {
4944            throw Util.sqlException(Trace.COLUMN_NOT_FOUND,
4945                                    String.valueOf(++columnIndex));
4946        }
4947
4948        if (checkNull(o)) {
4949            return null;
4950        }
4951
4952        if (t != type) {
4953            if (o instanceof Binary && type != Types.CHAR) {
4954                throw Util.sqlException(Trace.WRONG_DATA_TYPE);
4955            }
4956
4957            // try to convert
4958
try {
4959                o = Column.convertObject(o, type);
4960            } catch (Exception JavaDoc e) {
4961                String JavaDoc s = "type: " + Types.getTypeString(t) + " (" + t
4962                           + ") expected: " + Types.getTypeString(type)
4963                           + " value: " + o.toString();
4964
4965                throw Util.sqlException(Trace.WRONG_DATA_TYPE, s);
4966            }
4967        }
4968
4969        // treat datetime stuff
4970
switch (type) {
4971
4972            case Types.DATE :
4973                return new Date JavaDoc(((Date JavaDoc) o).getTime());
4974
4975            case Types.TIME :
4976                return new Time JavaDoc(((Time JavaDoc) o).getTime());
4977
4978            case Types.TIMESTAMP :
4979                long m = ((Timestamp JavaDoc) o).getTime();
4980                int n = ((Timestamp JavaDoc) o).getNanos();
4981                Timestamp JavaDoc ts = new Timestamp JavaDoc(m);
4982
4983                ts.setNanos(n);
4984
4985                return ts;
4986        }
4987
4988        return o;
4989    }
4990
4991    //-------------------------- Package Private ---------------------------
4992

4993    /**
4994     * Constructs a new <code>jdbcResultSet</code> object using the specified
4995     * <code>org.hsqldb.Result</code>. <p>
4996     *
4997     * @param s the statement
4998     * @param r the internal result form that the new
4999     * <code>jdbcResultSet</code> represents
5000     * @param props the connection properties
5001     * @exception SQLException when the supplied Result is of type
5002     * org.hsqldb.Result.ERROR
5003     */

5004    jdbcResultSet(jdbcStatement s, Result r, HsqlProperties props,
5005                  boolean isNetConnection) throws SQLException JavaDoc {
5006
5007        sqlStatement = s;
5008        connProperties = props;
5009        this.isNetConn = isNetConnection;
5010
5011        if (r.mode == ResultConstants.UPDATECOUNT) {
5012            iUpdateCount = r.getUpdateCount();
5013        } else if (r.isError()) {
5014            Util.throwError(r);
5015        } else {
5016            if (s != null) {
5017                this.rsType = s.rsType;
5018            }
5019
5020            iUpdateCount = -1;
5021            rResult = r;
5022            iColumnCount = r.getColumnCount();
5023        }
5024
5025        bWasNull = false;
5026    }
5027
5028    /**
5029     * If executing the statement updated rows on the database, how many were
5030     * affected?
5031     *
5032     * @return the number of rows affected by executing my statement
5033     */

5034    int getUpdateCount() {
5035        return iUpdateCount;
5036    }
5037
5038    /**
5039     * Does this Result contain actual row data? <p>
5040     *
5041     * Not all results have row data. Some are ERROR results
5042     * (an execption occured while executing my statement), and
5043     * some are UPDATE results, in which case updates occured to rows
5044     * on the database, but no rows were actually returned.
5045     *
5046     * @return true if Result has row data, false if not.
5047     */

5048    boolean isResult() {
5049        return rResult == null ? false
5050                               : true;
5051    }
5052}
5053
Popular Tags