KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > quadcap > jdbc > ResultSet


1 package com.quadcap.jdbc;
2
3 /* Copyright 1999 - 2003 Quadcap Software. All rights reserved.
4  *
5  * This software is distributed under the Quadcap Free Software License.
6  * This software may be used or modified for any purpose, personal or
7  * commercial. Open Source redistributions are permitted. Commercial
8  * redistribution of larger works derived from, or works which bundle
9  * this software requires a "Commercial Redistribution License"; see
10  * http://www.quadcap.com/purchase.
11  *
12  * Redistributions qualify as "Open Source" under one of the following terms:
13  *
14  * Redistributions are made at no charge beyond the reasonable cost of
15  * materials and delivery.
16  *
17  * Redistributions are accompanied by a copy of the Source Code or by an
18  * irrevocable offer to provide a copy of the Source Code for up to three
19  * years at the cost of materials and delivery. Such redistributions
20  * must allow further use, modification, and redistribution of the Source
21  * Code under substantially the same terms as this license.
22  *
23  * Redistributions of source code must retain the copyright notices as they
24  * appear in each source code file, these license terms, and the
25  * disclaimer/limitation of liability set forth as paragraph 6 below.
26  *
27  * Redistributions in binary form must reproduce this Copyright Notice,
28  * these license terms, and the disclaimer/limitation of liability set
29  * forth as paragraph 6 below, in the documentation and/or other materials
30  * provided with the distribution.
31  *
32  * The Software is provided on an "AS IS" basis. No warranty is
33  * provided that the Software is free of defects, or fit for a
34  * particular purpose.
35  *
36  * Limitation of Liability. Quadcap Software shall not be liable
37  * for any damages suffered by the Licensee or any third party resulting
38  * from use of the Software.
39  */

40
41 import java.io.Externalizable JavaDoc;
42 import java.io.IOException JavaDoc;
43 import java.io.ObjectInput JavaDoc;
44 import java.io.ObjectOutput JavaDoc;
45 import java.io.InputStream JavaDoc;
46 import java.io.Reader JavaDoc;
47
48 import java.util.Calendar JavaDoc;
49 import java.util.Vector JavaDoc;
50
51 import java.math.BigDecimal JavaDoc;
52 import java.math.BigInteger JavaDoc;
53
54 //#ifndef JDK11
55
import java.util.Map JavaDoc;
56
57 import java.sql.Array JavaDoc;
58 import java.sql.Blob JavaDoc;
59 import java.sql.Clob JavaDoc;
60 import java.sql.Ref JavaDoc;
61 //#endif
62

63 import java.sql.Date JavaDoc;
64 import java.sql.SQLException JavaDoc;
65 import java.sql.SQLWarning JavaDoc;
66 import java.sql.Time JavaDoc;
67 import java.sql.Timestamp JavaDoc;
68 import java.sql.Types JavaDoc;
69
70 import com.quadcap.util.Debug;
71
72 import com.quadcap.sql.Column;
73 import com.quadcap.sql.Cursor;
74 import com.quadcap.sql.Database;
75 import com.quadcap.sql.QedResultSet;
76 import com.quadcap.sql.Row;
77 import com.quadcap.sql.SelectExpression;
78 import com.quadcap.sql.Session;
79
80 import com.quadcap.sql.types.*;
81
82 import com.quadcap.sql.file.BlockFile;
83 import com.quadcap.sql.file.Log;
84
85 import com.quadcap.io.AsciiInputStream;
86 import com.quadcap.io.AsciiReader;
87 import com.quadcap.io.InputStreamReader;
88 import com.quadcap.io.ReaderInputStream;
89
90 import com.quadcap.util.ConfigNumber;
91 import com.quadcap.util.Util;
92
93 /**
94  * This class implements the <code>java.sql.ResultSet</code> interface,
95  * and provides facilities for accessing the results of a SQL query.
96  * QED supports updateable <code>ResultSet</code>s.
97  *
98  * <p>TODO: update{BC}lob</p>
99  *
100  * @author Stan Bailes
101  */

102 public class ResultSet implements QedResultSet {
103     /*{com.quadcap.qed.Trace-vars.xml-1056}
104      * <config-var>
105      * <config-name>qed.trace.ResultSet</config-name>
106      * <config-dflt>0</config-dflt>
107      * <config-desc>
108      * <pre>
109      * bit 0: API execution
110      * bit 1: findColumn
111      * bit 2: rows
112      * bit 3: row + column -> object
113      * bit 5: updateObject(row, col, obj)
114      * </pre>
115      * </config-desc>
116      * </config-var>
117      */

118     //#ifdef DEBUG
119
static final ConfigNumber trace =
120     ConfigNumber.find("qed.trace.ResultSet", "0");
121     //#endif
122

123     Statement stmt;
124     Cursor cursor;
125     Row row;
126     int rowNum = 0;
127     boolean onInsertRow = false;
128     boolean onUpdateRow = false;
129     boolean bf = false;
130     boolean rowUpdated = false;
131     boolean rowDeleted = false;
132
133     Row insertRow = null;
134     boolean wasNull = false;
135     Object JavaDoc lock = new Object JavaDoc();
136     int rowCount = 0;
137
138     
139     /**
140      * Constructor that wraps a cursor. Used internally to QED.
141      * @deprecated
142      * @param cursor a cursor
143      */

144     public ResultSet(Cursor cursor) {
145         this.cursor = cursor;
146     }
147
148     /**
149      * My database session/connection
150      */

151     final private Session getSession() {
152         return cursor.getSession();
153     }
154
155     /**
156      * I have been granted access to The File itself. I am most humble.
157      */

158     final private BlockFile getBlockFile() {
159         return getSession().getFile();
160     }
161
162     /**
163      * My "handle" for this op.
164      */

165     final private long getTransactionId() throws IOException JavaDoc, SQLException JavaDoc {
166         return getSession().getTransactionId();
167     }
168
169     /**
170      * Return the current cursor row.
171      */

172     final Row getCursorRow() throws SQLException JavaDoc {
173         if (onInsertRow) {
174             if (insertRow == null) {
175                 insertRow = new Row(cursor.getColumnCount());
176                 for (int i = 1; i <= insertRow.size(); i++) {
177                     insertRow.set(i, ValueNull.valueNull);
178                 }
179             }
180             return insertRow;
181         } else if (onUpdateRow) {
182             if (insertRow == null) {
183                 insertRow = new Row(cursor.getColumnCount());
184                 for (int i = 1; i < insertRow.size(); i++) {
185                     insertRow.set(i, row.item(i));
186                 }
187             }
188             return insertRow;
189         } else {
190             if (row == null) {
191                 row = cursor.getRow();
192                 //#ifdef DEBUG
193
if (trace.bit(2)) {
194                     Debug.println("cursor.getRow: " + row);
195                 }
196                 //#endif
197
}
198             return row;
199         }
200     }
201
202     /**
203      * Return the value in the specified column.
204      */

205     Value getValue(int col) throws SQLException JavaDoc {
206         Value v = null;
207         Row r = getCursorRow();
208         if (r != null) {
209             v = r.item(col);
210             if (v != null) {
211                 wasNull = Value.isNull(v);
212             } else {
213                 throw new SQLException JavaDoc("Can't return column " + col);
214             }
215         } else {
216             throw new SQLException JavaDoc("ResultSet isn't positioned on a valid row");
217         }
218         return v;
219     }
220
221     /**
222      * Convert the value in the specified column to the given type.
223      */

224     final Value getValue(int col, Type type) throws SQLException JavaDoc {
225         return type.convert(getValue(col));
226     }
227
228     /**
229      * Return the value in the specified column as a Java "Object"
230      * after performing the indicated type conversion.
231      */

232     public Object JavaDoc getObject(int col, Type type) throws SQLException JavaDoc {
233         Value v = getValue(col, type);
234         //#ifdef DEBUG
235
if (trace.bit(3)) {
236             Debug.println("get(" + col + ", " + type.getTypeName() +
237                           ") = " + v);
238         }
239         //#endif
240
return v.asJavaObject();
241     }
242
243     //------------------------------------------------------------------
244
// java.sql.ResultSet implementation
245
//------------------------------------------------------------------
246

247     /**
248      * Position the resultset to the specified row. If positive, the
249      * row number indicates an offset from the beginning of the
250      * <code>ResultSet</code> (row 1 is the first row). If negative,
251      * the row number indicates an offset from the end of the
252      * <code>ResultSet</code> (row -1 is the last row).
253      * <p>
254      * In general, this release of QED supports absolute positioning
255      * to the first row of the <code>ResultSet</code> only.
256      *
257      * @param row the row number
258      * @return true if we're positioned on a valid row, false if we're
259      * before the first row or after the last row.
260      * @exception SQLException if row is zero.
261      */

262     public boolean absolute(int x) throws SQLException JavaDoc {
263         checkScrollable();
264         //#ifdef DEBUG
265
if (trace.bit(0)) {
266             Debug.println("ResultSet.absolute(" + x + ")");
267             //Debug.println("cursor: " + cursor.getClass() + ": " + cursor);
268
}
269         //#endif
270
if (x == 0) {
271             throw new SQLException JavaDoc("ResultSet.absolute(0), bad parameter");
272         }
273         rowNum = x;
274         resetRow();
275         bf = false;
276         return cursor.absolute(rowNum);
277     }
278
279     private final void resetRow() {
280         onInsertRow = false;
281         onUpdateRow = false;
282         row = null;
283         rowUpdated = false;
284         rowDeleted = false;
285     }
286         
287
288     /**
289      * Position the cursor to the end of the <code>ResultSet</code>,
290      * after the last row. Our underlying cursor doesn't support this
291      * operation, so we use 'absolute()' to get to the end, then 'next()'
292      * to move past the end.
293      *
294      * @exception SQLException may be thrown.
295      */

296     public void afterLast() throws SQLException JavaDoc {
297         checkScrollable();
298         cursor.afterLast();
299         resetRow();
300         bf = false;
301     }
302     
303     /**
304      * Position the cursor to the beginning of the <code>ResultSet</code>,
305      * before the first row.
306      *
307      * @exception SQLException may be thrown.
308      */

309     public void beforeFirst() throws SQLException JavaDoc {
310         checkScrollable();
311         cursor.beforeFirst();
312         resetRow();
313         bf = true;
314     }
315     
316     /**
317      * This function rolls back row updates, as long as
318      * <code>updateRow()</code> hasn't been called yet.
319      *
320      * @exception SQLException may be thrown
321      */

322     public void cancelRowUpdates() throws SQLException JavaDoc {
323         if (onInsertRow) {
324             throw new SQLException JavaDoc("ResultSet.cancelRowUpdates() called " +
325                                    "while on insert row");
326         }
327         resetRow();
328     }
329
330     /**
331      * Clears all warnings that have been reported on this
332      * <code>ResultSet</code> object.
333      * QED doesn't currently throw any SQLWarnings,
334      * so this operation does nothing.
335      */

336     public void clearWarnings() throws SQLException JavaDoc {
337     }
338
339     /**
340      * We will clean up the user's mess for him.
341      */

342     public void finalize() throws Throwable JavaDoc {
343         try {
344             if (cursor != null) close();
345         } catch (Throwable JavaDoc t) {}
346         super.finalize();
347     }
348     
349     /**
350      * Close this <code>ResultSet</code> object. If this is an
351      * updatable <code>ResultSet</code>, and the connection that this
352      * <code>ResultSet</code> was created from is in <code>autoCommit</code>
353      * mode, the transaction is committed at this time.
354      *
355      * @exception SQLException may be thrown
356      */

357     public void close() throws SQLException JavaDoc {
358         if (cursor == null) return;
359         
360         Session s = cursor.getSession();
361
362         synchronized (lock) {
363             cursor = null;
364             if (s != null) {
365                 try {
366                     s.endStatement(false);
367                 } catch (IOException JavaDoc e) {
368                     throw new SQLException JavaDoc(e.toString());
369                 }
370             }
371         }
372     }
373
374     /**
375      * Delete the current row from the <code>ResultSet</code> and the
376      * underlying database.
377      *
378      * @exception SQLException may be thrown
379      */

380     public void deleteRow() throws SQLException JavaDoc {
381         //#ifdef DEBUG
382
if (trace.bit(0)) {
383             Debug.println("ResultSet.deleteRow()");
384         }
385         //#endif
386
checkUpdatable();
387         if (onInsertRow) {
388             throw new SQLException JavaDoc(
389                 "ResultSet.deleteRow(): Can't delete while on insert row");
390         }
391         cursor.deleteRow();
392         rowDeleted = true;
393     }
394
395     /**
396      * Return the column number of the specified column.
397      *
398      * @param column the name of the column
399      * @return the number of the column in the resultset.
400      */

401     public int findColumn(String JavaDoc column) throws SQLException JavaDoc {
402         Column col = cursor.getColumn(column.toUpperCase());
403         if (col == null) {
404             //#ifdef DEBUG
405
SelectExpression.showCursor(cursor, true);
406             //#endif
407
throw new SQLException JavaDoc("Bad column name: " + column,
408                                    "42000");
409         }
410         int coln = col.getColumn();
411         //#ifdef DEBUG
412
if (trace.bit(1)) {
413             Debug.println("ResultSet.findColumn(" + column + ") = " + coln);
414         }
415         //#endif
416
return coln;
417     }
418     
419     /**
420      * Position the cursor on the first row of the <code>ResultSet</code>.
421      * Return true if the <code>ResultSet</code> has at least one row.
422      *
423      *
424      * @exception SQLException may be thrown
425      */

426     public boolean first() throws SQLException JavaDoc {
427         return absolute(1);
428     }
429     
430     /**
431      * Return an <code>InputStream</code> object that can be used to read
432      * the specified character value as a stream of ASCII bytes.
433      *
434      * @param col the column number
435      * @return an <code>InputStream</code>
436      * @exception SQLException may be thrown
437      */

438     public InputStream JavaDoc getAsciiStream(int col) throws SQLException JavaDoc {
439         Value v = getValue(col);
440         if (Value.isNull(v)) return null;
441         return new AsciiInputStream(getCharacterStream(col));
442     }
443     
444     /**
445      * Return an <code>InputStream</code> object that can be used to read
446      * the specified character value as a stream of ASCII bytes.
447      *
448      * @param column the column name
449      * @return an <code>InputStream</code>
450      * @exception SQLException may be thrown
451      */

452     public InputStream JavaDoc getAsciiStream(String JavaDoc column) throws SQLException JavaDoc {
453         return getAsciiStream(findColumn(column));
454     }
455     
456     /**
457      * Retrieve the specified column as a <code>BigDecimal</code> object.
458      *
459      * @param col the column number
460      * @return the column's value in the current row
461      * @exception SQLException may be thrown
462      */

463     public BigDecimal JavaDoc getBigDecimal(int col) throws SQLException JavaDoc {
464         try {
465             ValueScaledInteger v =
466                 (ValueScaledInteger)getValue(col, TypeDecimal.typeDecimal);
467             if (v != null) return v.bigDecimalValue();
468         } catch (ClassCastException JavaDoc e) {
469             if (wasNull) return null;
470         }
471         throw new SQLException JavaDoc("Can't return column " + col +
472                                " as BigDecimal", "22003");
473     }
474
475     /**
476      * @deprecated
477      */

478     public BigDecimal JavaDoc getBigDecimal(int col, int scale) throws SQLException JavaDoc {
479         BigDecimal JavaDoc big = getBigDecimal(col);
480         return big.setScale(scale);
481     }
482     
483     /**
484      * Retrieve the specified column as a <code>BigDecimal</code> object.
485      *
486      * @param column the column name
487      * @return the column's value in the current row
488      * @exception SQLException may be thrown
489      */

490     public BigDecimal JavaDoc getBigDecimal(String JavaDoc column) throws SQLException JavaDoc {
491         return getBigDecimal(findColumn(column));
492     }
493
494     /**
495      * @deprecated
496      */

497     public BigDecimal JavaDoc getBigDecimal(String JavaDoc column, int scale)
498         throws SQLException JavaDoc
499     {
500         return getBigDecimal(findColumn(column), scale);
501     }
502     
503     /**
504      * Return an <code>InputStream</code> object that can be used to read
505      * the specified column value as a stream of bytes.
506      *
507      * @param col the column number
508      * @return an <code>InputStream</code>
509      * @exception SQLException may be thrown
510      */

511     public InputStream JavaDoc getBinaryStream(int col) throws SQLException JavaDoc {
512         try {
513             Value v = getValue(col);
514             if (Value.isNull(v)) return null;
515             int type = v.getType().getJDBCType();
516             switch (type) {
517             case Types.CHAR:
518             case Types.VARCHAR:
519                 return ((ValueString)v).getBinaryStream();
520             case Types.BINARY:
521             case Types.VARBINARY:
522                 return ((ValueOctets)v).getBinaryStream();
523 //-//#ifdef JDK11
524
//- case Type.BLOB:
525
//#else
526
case Types.BLOB:
527 //#endif
528
return ((ValueBlob)v).getBinaryStream();
529 //-//#ifdef JDK11
530
//- case Type.CLOB:
531
//#else
532
case Types.CLOB:
533 //#endif
534
return ((ValueClob)v).getBinaryStream();
535             default:
536                 throw new ValueException("Can't convert: " + type +
537                                          " to binary stream");
538             }
539         } catch (ValueException e) {
540             throw new SQLException JavaDoc("Can't return column " + col +
541                                    " as Binary Stream", "22003");
542         }
543     }
544     
545     /**
546      * Return an <code>InputStream</code> object that can be used to read
547      * the specified column value as a stream of bytes.
548      *
549      * @param column the column name
550      * @return an <code>InputStream</code>
551      * @exception SQLException may be thrown
552      */

553     public InputStream JavaDoc getBinaryStream(String JavaDoc column) throws SQLException JavaDoc {
554         return getBinaryStream(findColumn(column));
555     }
556     
557     /**
558      * Retrieve the specified column as a <code>boolean</code>.
559      *
560      * @param col the column number
561      * @return the column's value in the current row
562      * @exception SQLException may be thrown
563      */

564     public boolean getBoolean(int col) throws SQLException JavaDoc {
565         Object JavaDoc obj = getObject(col);
566         if (obj == null) return false;
567         if (obj instanceof Boolean JavaDoc) {
568             return ((Boolean JavaDoc)obj).booleanValue();
569         }
570         Number JavaDoc num = asNumber(obj);
571         if (num != null) {
572             return num.doubleValue() != 0;
573         }
574         return obj.toString().toLowerCase().equals("true");
575     }
576     
577     /**
578      * Retrieve the specified column as a <code>boolean</code>.
579      *
580      * @param column the column name
581      * @return the column's value in the current row
582      * @exception SQLException may be thrown
583      */

584     public boolean getBoolean(String JavaDoc column) throws SQLException JavaDoc {
585         return getBoolean(findColumn(column));
586     }
587
588     /**
589      * Are you a number?
590      *
591      * Any sort of number?
592      *
593      * Even some fancy schmancy number?
594      *
595      * Are you?
596      *
597      * Or not.
598      */

599     final Number JavaDoc asNumber(Object JavaDoc obj) {
600         if (obj instanceof Number JavaDoc) return (Number JavaDoc)obj;
601         if (obj instanceof String JavaDoc) {
602             try {
603                 return new Long JavaDoc(obj.toString());
604             } catch (NumberFormatException JavaDoc e) {
605             }
606         }
607         if (obj instanceof byte[]) {
608             return new BigDecimal JavaDoc(new BigInteger JavaDoc((byte[])obj));
609         }
610         if (obj instanceof Boolean JavaDoc) {
611             int val = ((Boolean JavaDoc)obj).booleanValue() ? 1 : 0;
612             return new Integer JavaDoc(val);
613         }
614         return null;
615     }
616     
617     /**
618      * Retrieve the specified column as a <code>byte</code>.
619      *
620      * @param col the column number
621      * @return the column's value in the current row
622      * @exception SQLException may be thrown
623      */

624     public byte getByte(int col) throws SQLException JavaDoc {
625         try {
626             ValueByte v = (ValueByte)getValue(col, TypeTinyInt.typeTinyInt);
627             if (v != null) return v.byteValue();
628         } catch (ClassCastException JavaDoc e) {
629             if (wasNull) return 0;
630         }
631         throw new SQLException JavaDoc("Can't return column " + col +
632                                " as byte", "22003");
633     }
634     
635     /**
636      * Retrieve the specified column as a <code>byte</code>.
637      *
638      * @param column the column name
639      * @return the column's value in the current row
640      * @exception SQLException may be thrown
641      */

642     public byte getByte(String JavaDoc column) throws SQLException JavaDoc {
643         return getByte(findColumn(column));
644     }
645     
646     /**
647      * Retrieve the specified column as an array of <code>byte</code>s.
648      *
649      * @param col the column number
650      * @return the column's value in the current row
651      * @exception SQLException may be thrown
652      */

653     public byte[] getBytes(int col) throws SQLException JavaDoc {
654         try {
655             Value v1 = getValue(col, TypeVarBinary.typeVarBinary);
656             if (wasNull) return null;
657             ValueOctets v = (ValueOctets)v1;
658             return v.getBytes();
659         } catch (Exception JavaDoc e) {
660             throw new SQLException JavaDoc("Can't return column " + col +
661                                    " as bytes", "22003");
662         }
663     }
664     
665     /**
666      * Retrieve the specified column as an array of <code>byte</code>s.
667      *
668      * @param column the column name
669      * @return the column's value in the current row
670      * @exception SQLException may be thrown
671      */

672     public byte[] getBytes(String JavaDoc column) throws SQLException JavaDoc {
673         return getBytes(findColumn(column));
674     }
675     
676     /**
677      * Return a <code>Reader</code> object that can be used to read
678      * the specified column value as a stream of characters.
679      *
680      * @param col the column number
681      * @return a <code>Reader</code>
682      * @exception SQLException may be thrown
683      */

684     public Reader JavaDoc getCharacterStream(int col) throws SQLException JavaDoc {
685         try {
686             Value v = getValue(col);
687             if (Value.isNull(v)) return null;
688             int type = v.getType().getJDBCType();
689             switch (type) {
690             case Types.CHAR:
691             case Types.VARCHAR:
692                 return ((ValueString)v).getCharacterStream();
693             case Types.BINARY:
694             case Types.VARBINARY:
695                 return new ByteReader(((ValueOctets)v).getBinaryStream());
696             case Types.BLOB:
697                 return new ByteReader(((ValueBlob)v).getBinaryStream());
698             case Types.CLOB:
699                 return ((ValueClob)v).getCharacterStream();
700             default:
701                 throw new ValueException("Can't convert: " + type +
702                                          " to character stream");
703             }
704         } catch (ValueException e) {
705             throw new SQLException JavaDoc("Can't return column " + col +
706                                    " as character stream", "22003");
707         }
708         
709     }
710     
711     /**
712      * Return a <code>Reader</code> object that can be used to read
713      * the specified column value as a stream of characters.
714      *
715      * @param column the column name
716      * @return a <code>Reader</code>
717      * @exception SQLException may be thrown
718      */

719     public Reader JavaDoc getCharacterStream(String JavaDoc column) throws SQLException JavaDoc {
720         return getCharacterStream(findColumn(column));
721     }
722     
723     /**
724      * QED doesn't support named cursors, so this method throws a
725      * SQLException "not implemented"
726      *
727      * @return never
728      * @exception SQLException not implemented
729      */

730     public String JavaDoc getCursorName() throws SQLException JavaDoc {
731         throw new SQLException JavaDoc("named cursors not supported", "0A000");
732     }
733     
734     /**
735      * Retrieve the specified column as a <code>Date</code> object.
736      *
737      * @param col the column number
738      * @return the column's value in the current row
739      * @exception SQLException may be thrown
740      */

741     public Date JavaDoc getDate(int col) throws SQLException JavaDoc {
742         Date JavaDoc d = null;
743         Value v = getValue(col);
744         if (!Value.isNull(v)) {
745             try {
746                 ValueDate vd = (ValueDate)v.convert(TypeDate.typeDate);
747                 d = new Date JavaDoc(vd.getTime());
748             } catch (Exception JavaDoc e) {
749                 throw new SQLException JavaDoc("Can't convert column " + col +
750                                        " to date", "22003");
751             }
752         }
753         return d;
754     }
755     
756     /**
757      * Retrieve the specified column as a <code>Date</code> object.
758      *
759      * @param col the column number
760      * @param c a <code>Calendar<code> object that is used for converting
761      * the database date to the local timezone. The database date is
762      * adjusted based on the <code>Calendar</code> timezone and DST offset.
763      * @return the column's value in the current row
764      * @exception SQLException may be thrown
765      */

766     public Date JavaDoc getDate(int col, Calendar JavaDoc c) throws SQLException JavaDoc {
767         Date JavaDoc d = getDate(col);
768         if (d != null) {
769             long t = d.getTime();
770             c.setTime(d);
771             t += (c.get(Calendar.ZONE_OFFSET) + c.get(Calendar.DST_OFFSET));
772             d = new Date JavaDoc(t);
773         }
774         return d;
775     }
776     
777     /**
778      * Retrieve the specified column as a <code>Date</code> object.
779      *
780      * @param column the column name
781      * @return the column's value in the current row
782      * @exception SQLException may be thrown
783      */

784     public Date JavaDoc getDate(String JavaDoc column) throws SQLException JavaDoc {
785         return getDate(findColumn(column));
786     }
787     
788     /**
789      * Retrieve the specified column as a <code>Date</code> object.
790      *
791      * @param column the column name
792      * @param c a <code>Calendar<code> object that is used for converting
793      * the database date to the local timezone. The database date is
794      * adjusted based on the <code>Calendar</code> timezone and DST offset.
795      * @return the column's value in the current row
796      * @exception SQLException may be thrown
797      */

798     public Date JavaDoc getDate(String JavaDoc column, Calendar JavaDoc c) throws SQLException JavaDoc {
799         return getDate(findColumn(column), c);
800     }
801     
802     /**
803      * Retrieve the specified column as a <code>double</code>.
804      *
805      * @param col the column number
806      * @return the column's value in the current row
807      * @exception SQLException may be thrown
808      */

809     public double getDouble(int col) throws SQLException JavaDoc {
810         try {
811             ValueDouble v = (ValueDouble)getValue(col, TypeReal.typeDouble);
812             if (v != null) return v.doubleValue();
813         } catch (ClassCastException JavaDoc e) {
814             if (wasNull) return 0;
815         }
816         throw new SQLException JavaDoc("Can't return column " + col +
817                                " as double", "22003");
818     }
819     
820     /**
821      * Retrieve the specified column as a <code>double</code>.
822      *
823      * @param column the column name
824      * @return the column's value in the current row
825      * @exception SQLException may be thrown
826      */

827     public double getDouble(String JavaDoc column) throws SQLException JavaDoc {
828         return getDouble(findColumn(column));
829     }
830     
831     /**
832      * QED, being an embedded driver, fetches rows only when they are
833      * needed, with no performance penalty. Thus, the fetch size is
834      * always <code>one</code>.
835      *
836      * @return one.
837      */

838     public int getFetchSize() {
839         return 1;
840     }
841     
842     /**
843      * Retrieve the specified column as a <code>float</code>.
844      *
845      * @param col the column number
846      * @return the column's value in the current row
847      * @exception SQLException may be thrown
848      */

849     public float getFloat(int col) throws SQLException JavaDoc {
850         try {
851             ValueFloat v = (ValueFloat)getValue(col, TypeReal.typeFloat);
852             if (v != null) return v.floatValue();
853         } catch (ClassCastException JavaDoc e) {
854             if (wasNull) return 0;
855         }
856         throw new SQLException JavaDoc("Can't return column " + col +
857                                " as float", "22003");
858     }
859     
860     /**
861      * Retrieve the specified column as a <code>float</code>.
862      *
863      * @param column the column name
864      * @return the column's value in the current row
865      * @exception SQLException may be thrown
866      */

867     public float getFloat(String JavaDoc column) throws SQLException JavaDoc {
868         return getFloat(findColumn(column));
869     }
870     
871     /**
872      * Retrieve the specified column as an <code>int</code>.
873      *
874      * @param col the column number
875      * @return the column's value in the current row
876      * @exception SQLException may be thrown
877      */

878     public int getInt(int col) throws SQLException JavaDoc {
879         try {
880             ValueInteger v = (ValueInteger)getValue(col, TypeInt.typeInt);
881             if (v != null) return v.intValue();
882         } catch (ClassCastException JavaDoc e) {
883             if (wasNull) return 0;
884         }
885         throw new SQLException JavaDoc("Can't return column " + col +
886                                " as int", "22003");
887     }
888     
889     /**
890      * Retrieve the specified column as an <code>int</code>.
891      *
892      * @param column the column name
893      * @return the column's value in the current row
894      * @exception SQLException may be thrown
895      */

896     public int getInt(String JavaDoc column) throws SQLException JavaDoc {
897         return getInt(findColumn(column));
898     }
899     
900     /**
901      * Retrieve the specified column as a <code>long</code>.
902      *
903      * @param col the column number
904      * @return the column's value in the current row
905      * @exception SQLException may be thrown
906      */

907     public long getLong(int col) throws SQLException JavaDoc {
908         try {
909             ValueLong v = (ValueLong)getValue(col, TypeBigInt.typeBigInt);
910             if (v != null) return v.longValue();
911         } catch (ClassCastException JavaDoc e) {
912             if (wasNull) return 0;
913         }
914         throw new SQLException JavaDoc("Can't return column " + col +
915                                " as long", "22003");
916     }
917     
918     /**
919      * Retrieve the specified column as a <code>long</code>.
920      *
921      * @param column the column name
922      * @return the column's value in the current row
923      * @exception SQLException may be thrown
924      */

925     public long getLong(String JavaDoc column) throws SQLException JavaDoc {
926         return getLong(findColumn(column));
927     }
928     
929     /**
930      * Return a <code>ResultSetMetaData</code> object that can be used
931      * to obtain information about the columns of this
932      * <code>ResultSet</code>.
933      *
934      * @return a <code>ResultSetMetaData</code> object that describes
935      * the columns of this <code>ResultSet</code>.
936      * @exception SQLException may be thrown
937      */

938     public java.sql.ResultSetMetaData JavaDoc getMetaData() throws SQLException JavaDoc {
939         return new ResultSetMetaData(cursor);
940     }
941
942     /**
943      * Retrieve the specified column as a Java <code>Object</code>.
944      * The type of the object is based on the underlying SQL datatype,
945      * using the conversions as specified by JDBC.
946      *
947      * @param col the column number
948      * @return the column's value in the current row
949      * @exception SQLException may be thrown
950      */

951     public Object JavaDoc getObject(int col) throws SQLException JavaDoc {
952         try {
953             Value v = getValue(col);
954             //#ifdef DEBUG
955
if (trace.bit(3)) {
956                 Debug.println("get(" + col + ") = " + v);
957             }
958             //#endif
959
return v.asJavaObject();
960         } catch (SQLException JavaDoc e) {
961             throw e;
962         } catch (Exception JavaDoc ex) {
963             Debug.print(ex);
964             throw new SQLException JavaDoc("Invalid column index: " + col, "22003");
965         }
966     }
967
968     /**
969      * Retrieve the specified column as a Java <code>Object</code>.
970      * The type of the object is based on the underlying SQL datatype,
971      * using the conversions as specified by JDBC.
972      *
973      * @param column the column name
974      * @return the column's value in the current row
975      * @exception SQLException may be thrown
976      */

977     public Object JavaDoc getObject(String JavaDoc column) throws SQLException JavaDoc {
978         return getObject(findColumn(column));
979     }
980
981     /**
982      * Return the row number of the current row in the
983      * <code>ResultSet</code>.
984      */

985     public int getRow() throws SQLException JavaDoc {
986         if (rowNum < 0) {
987             int siz = (int)cursor.size();
988             if (siz >= 0) {
989                 rowNum = siz + 1 + rowNum;
990             } else {
991                 throw new SQLException JavaDoc(
992                     "Sorry, but the underlying cursor (" +
993                     cursor + ") doesn't supply row number information");
994             }
995         }
996         return rowNum;
997     }
998     
999     /**
1000     * Retrieve the specified column as a <code>short</code>.
1001     *
1002     * @param col the column number
1003     * @return the column's value in the current row
1004     * @exception SQLException may be thrown
1005     */

1006    public short getShort(int col) throws SQLException JavaDoc {
1007        try {
1008            ValueShort v =
1009                (ValueShort)getValue(col, TypeSmallInt.typeSmallInt);
1010            if (v != null) return v.shortValue();
1011        } catch (ClassCastException JavaDoc e) {
1012            if (wasNull) return 0;
1013        }
1014        throw new SQLException JavaDoc("Can't return column " + col +
1015                               " as short", "22003");
1016    }
1017        
1018    /**
1019     * Retrieve the specified column as a <code>short</code>.
1020     *
1021     * @param column the column name
1022     * @return the column's value in the current row
1023     * @exception SQLException may be thrown
1024     */

1025    public short getShort(String JavaDoc column) throws SQLException JavaDoc {
1026        return getShort(findColumn(column));
1027    }
1028   
1029    /**
1030     * Attach this result set to its parent statement.
1031     */

1032    public void setStatement(java.sql.Statement JavaDoc stmt) {
1033        this.stmt = (Statement)stmt;
1034        this.resultSetType = this.stmt.resultSetType;
1035        this.resultSetConcurrency = this.stmt.resultSetConcurrency;
1036    }
1037    
1038    /**
1039     * Return the <code>Statement</code> object that generated this
1040     * <code>ResultSet</code>.
1041     *
1042     * @return the <code>Statement</code> object that generated this
1043     * <code>ResultSet</code>
1044     */

1045    public java.sql.Statement JavaDoc getStatement() {
1046        return stmt;
1047    }
1048    
1049    /**
1050     * Retrieve the specified column as a <code>String</code> object.
1051     *
1052     * @param col the column number
1053     * @return the column's value in the current row
1054     * @exception SQLException may be thrown
1055     */

1056    public String JavaDoc getString(int col) throws SQLException JavaDoc {
1057        Object JavaDoc obj = getObject(col, TypeVarChar.typeVarChar);
1058        if (obj == null) return null;
1059        return obj.toString();
1060    }
1061    
1062    /**
1063     * Retrieve the specified column as a <code>String</code> object.
1064     *
1065     * @param column the column name
1066     * @return the column's value in the current row
1067     * @exception SQLException may be thrown
1068     */

1069    public String JavaDoc getString(String JavaDoc column) throws SQLException JavaDoc {
1070        return getString(findColumn(column));
1071    }
1072    
1073    /**
1074     * Retrieve the specified column as a <code>Time</code> object.
1075     *
1076     * @param col the column number
1077     * @return the column's value in the current row
1078     * @exception SQLException may be thrown
1079     */

1080    public Time JavaDoc getTime(int col) throws SQLException JavaDoc {
1081        Time JavaDoc t = null;
1082        Value v = getValue(col);
1083        if (!Value.isNull(v)) {
1084            try {
1085                ValueTime vt = (ValueTime)v.convert(TypeTime.typeTime);
1086                t = new Time JavaDoc(vt.getTime());
1087            } catch (Exception JavaDoc e) {
1088                throw new SQLException JavaDoc("Can't convert column " + col +
1089                                       " to time", "22003");
1090            }
1091        }
1092        return t;
1093    }
1094    
1095    /**
1096     * Retrieve the specified column as a <code>Time</code> object.
1097     *
1098     * @param col the column number
1099     * @param c a <code>Calendar<code> object that is used for converting
1100     * the database time to the local timezone. The database time is
1101     * adjusted based on the <code>Calendar</code> timezone and DST offset.
1102     * @return the column's value in the current row
1103     * @exception SQLException may be thrown
1104     */

1105    public Time JavaDoc getTime(int col, Calendar JavaDoc c) throws SQLException JavaDoc {
1106        Time JavaDoc d = getTime(col);
1107        if (d != null) {
1108            long t = d.getTime();
1109            c.setTime(d);
1110            t += (c.get(Calendar.ZONE_OFFSET) + c.get(Calendar.DST_OFFSET));
1111            d = new Time JavaDoc(t);
1112        }
1113        return d;
1114    }
1115    
1116    /**
1117     * Retrieve the specified column as a <code>Time</code> object.
1118     *
1119     * @param column the column name
1120     * @return the column's value in the current row
1121     * @exception SQLException may be thrown
1122     */

1123    public Time JavaDoc getTime(String JavaDoc column) throws SQLException JavaDoc {
1124        return getTime(findColumn(column));
1125    }
1126    
1127    /**
1128     * Retrieve the specified column as a <code>Time</code> object.
1129     *
1130     * @param column the column name
1131     * @param c a <code>Calendar<code> object that is used for converting
1132     * the database time to the local timezone. The database time is
1133     * adjusted based on the <code>Calendar</code> timezone and DST offset.
1134     * @return the column's value in the current row
1135     * @exception SQLException may be thrown
1136     */

1137    public Time JavaDoc getTime(String JavaDoc column, Calendar JavaDoc c) throws SQLException JavaDoc {
1138        return getTime(findColumn(column));
1139    }
1140    
1141    /**
1142     * Retrieve the specified column as a <code>Timestamp</code> object.
1143     *
1144     * @param col the column number
1145     * @return the column's value in the current row
1146     * @exception SQLException may be thrown
1147     */

1148    public Timestamp JavaDoc getTimestamp(int col) throws SQLException JavaDoc {
1149        Timestamp JavaDoc t = null;
1150        Value v = getValue(col, TypeTimestamp.typeTimestamp);
1151        if (!wasNull) {
1152            try {
1153                ValueTimestamp vt = (ValueTimestamp)v;
1154                t = new Timestamp JavaDoc(vt.getTime());
1155            } catch (ClassCastException JavaDoc e) {
1156                throw new SQLException JavaDoc("Can't convert column " + col +
1157                                       " to timestamp", "22003");
1158            }
1159        }
1160        return t;
1161    }
1162
1163    /**
1164     * Retrieve the specified column as a <code>Timestamp</code> object.
1165     *
1166     * @param col the column number
1167     * @param c a <code>Calendar<code> object that is used for converting
1168     * the database time to the local timezone. The database time is
1169     * adjusted based on the <code>Calendar</code> timezone and DST offset.
1170     * @return the column's value in the current row
1171     * @exception SQLException may be thrown
1172     */

1173    public Timestamp JavaDoc getTimestamp(int col, Calendar JavaDoc c) throws SQLException JavaDoc {
1174        Timestamp JavaDoc d = getTimestamp(col);
1175        if (d != null) {
1176            long t = d.getTime();
1177            c.setTime(d);
1178            t += (c.get(Calendar.ZONE_OFFSET) + c.get(Calendar.DST_OFFSET));
1179            Timestamp JavaDoc r = new Timestamp JavaDoc(t);
1180            r.setNanos(d.getNanos());
1181            d = r;
1182        }
1183        return d;
1184    }
1185    
1186    /**
1187     * Retrieve the specified column as a <code>Timestamp</code> object.
1188     *
1189     * @param column the column name
1190     * @return the column's value in the current row
1191     * @exception SQLException may be thrown
1192     */

1193    public Timestamp JavaDoc getTimestamp(String JavaDoc column) throws SQLException JavaDoc {
1194        return getTimestamp(findColumn(column));
1195    }
1196    
1197    /**
1198     * Retrieve the specified column as a <code>Timestamp</code> object.
1199     *
1200     * @param column the column name
1201     * @param c a <code>Calendar<code> object that is used for converting
1202     * the database time to the local timezone. The database time is
1203     * adjusted based on the <code>Calendar</code> timezone and DST offset.
1204     * @return the column's value in the current row
1205     * @exception SQLException may be thrown
1206     */

1207    public Timestamp JavaDoc getTimestamp(String JavaDoc column, Calendar JavaDoc c)
1208        throws SQLException JavaDoc
1209    {
1210        return getTimestamp(findColumn(column), c);
1211    }
1212    
1213    /**
1214     * @deprecated
1215     */

1216    public InputStream JavaDoc getUnicodeStream(int col) throws SQLException JavaDoc {
1217        return getBinaryStream(col);
1218    }
1219
1220    /**
1221     * @deprecated
1222     */

1223    public InputStream JavaDoc getUnicodeStream(String JavaDoc column) throws SQLException JavaDoc {
1224        return getBinaryStream(column);
1225    }
1226    
1227    /**
1228     * QED doesn't implement any <code>SQLWarning</code>s, so this
1229     * function always returns <code>null</code>
1230     *
1231     * @return null
1232     */

1233    public SQLWarning JavaDoc getWarnings() {
1234        return null;
1235    }
1236    
1237    /**
1238     * If this <code>ResultSet</code> is currently positioned on the
1239     * insert row, then insert the current row into the database.
1240     *
1241     * @exception SQLException may be thrown if we're not currently
1242     * on the insert row, or if there is an error reported from the
1243     * database for the insert operation
1244     */

1245    public void insertRow() throws SQLException JavaDoc {
1246        //#ifdef DEBUG
1247
if (trace.bit(0)) {
1248            Debug.println("ResultSet.insertRow()");
1249        }
1250        //#endif
1251
checkUpdatable();
1252        if (onInsertRow && insertRow != null) {
1253            cursor.insertRow(insertRow);
1254            rowUpdated = true;
1255        } else {
1256            throw new SQLException JavaDoc("Can't insert -- no insert row");
1257        }
1258    }
1259    
1260    /**
1261     * Update the current row (based on previous calls to the
1262     * <code>updateXXX</code> methods) in the database.
1263     *
1264     * @exception SQLException may be thrown if we're currently
1265     * on the insert row, or if there is an error reported from the
1266     * database for the update operation
1267     */

1268    public void updateRow() throws SQLException JavaDoc {
1269        //#ifdef DEBUG
1270
if (trace.bit(0)) {
1271            Debug.println("ResultSet.updateRow()");
1272        }
1273        //#endif
1274
checkUpdatable();
1275        if (onInsertRow) {
1276            throw new SQLException JavaDoc(
1277                "updateRow(): Can't update while on insert row");
1278        }
1279        Row rowX = onUpdateRow ? insertRow : row;
1280        if (rowX != null) {
1281            cursor.getSession().clearViewCheck();
1282            cursor.updateRow(rowX);
1283            rowUpdated = true;
1284        }
1285    }
1286    
1287    /**
1288     * Return <b>true</b> if this cursor is positioned after the
1289     * last row.
1290     *
1291     * @exception SQLException may be thrown
1292     */

1293    public boolean isAfterLast() throws SQLException JavaDoc {
1294        checkScrollable();
1295        return !onInsertRow && rowNum == 0 && !bf;
1296    }
1297    
1298    /**
1299     * Return <b>true</b> if this cursor is positioned before the
1300     * first row.
1301     *
1302     * @exception SQLException may be thrown
1303     */

1304    public boolean isBeforeFirst() throws SQLException JavaDoc {
1305        checkScrollable();
1306        return !onInsertRow && rowNum == 0 && bf;
1307    }
1308    
1309    /**
1310     * Return <b>true</b> if this cursor is positioned on the
1311     * first row.
1312     *
1313     * @exception SQLException may be thrown
1314     */

1315    public boolean isFirst() throws SQLException JavaDoc {
1316        checkScrollable();
1317        return !onInsertRow && rowNum == 1;
1318    }
1319    
1320    /**
1321     * Return <b>true</b> if this cursor is positioned on the
1322     * last row.
1323     *
1324     * @exception SQLException may be thrown
1325     */

1326    public boolean isLast() throws SQLException JavaDoc {
1327        checkScrollable();
1328        if (!onInsertRow) {
1329            if (rowNum > 0) {
1330                int siz = (int)cursor.size();
1331                if (siz > 0) {
1332                    return rowNum == siz;
1333                }
1334            } else if (rowNum < 0) {
1335                return rowNum == -1;
1336            }
1337            if (!next()) {
1338                return true;
1339            } else {
1340                previous();
1341            }
1342        }
1343        return false;
1344    }
1345
1346    /**
1347     * Move to the last row of the <code>ResultSet</code>.
1348     *
1349     * @return true if we manage to successfully position the
1350     * <code>ResultSet</code> on the last row
1351     * @exception SQLException is likely to be thrown ;-)
1352     */

1353    public boolean last() throws SQLException JavaDoc {
1354        return absolute(-1);
1355    }
1356    
1357    /**
1358     * If the cursor is on the insert row, move it back to the previous
1359     * position in the <code>ResultSet</code>. If the cursor is not
1360     * on the insert row, this function has no effect.
1361     */

1362    public void moveToCurrentRow() {
1363        //#ifdef DEBUG
1364
if (trace.bit(0)) {
1365            Debug.println("ResultSet.moveToCurrentRow()");
1366        }
1367        //#endif
1368
onInsertRow = false;
1369    }
1370    
1371    /**
1372     * Move the cursor to the insert row.
1373     */

1374    public void moveToInsertRow() {
1375        //#ifdef DEBUG
1376
if (trace.bit(0)) {
1377            Debug.println("ResultSet.moveToInsertRow()");
1378        }
1379        //#endif
1380
insertRow = null;
1381        onInsertRow = true;
1382    }
1383    
1384    /**
1385     * Advance the cursor to the next row in the <code>ResultSet</code>.
1386     *
1387     * @return true if the cursor is positioned on a valid row, false
1388     * if the cursor has passed the end of the <code>ResultSet</code>.
1389     *
1390     * @exception SQLException may be thrown
1391     */

1392    public boolean next() throws SQLException JavaDoc {
1393        resetRow();
1394        boolean ret = false;
1395        if (stmt != null && stmt.maxRows > 0 && rowCount >= stmt.maxRows) {
1396            ret = false;
1397        } else if (cursor != null) {
1398            rowCount++;
1399            ret = cursor.next();
1400            if (ret) rowNum++;
1401        }
1402        //#ifdef DEBUG
1403
if (trace.bit(0)) {
1404            Debug.println("ResultSet.next() (cursor " +
1405                          cursor.getClass().getName() +
1406                          ") returns " + ret);
1407        }
1408        //#endif
1409
return ret;
1410    }
1411    
1412    /**
1413     * Advance the cursor to the next row in the <code>ResultSet</code>.
1414     *
1415     * @return true if the cursor is positioned on a valid row, false
1416     * if the cursor has passed the end of the <code>ResultSet</code>.
1417     *
1418     * @exception SQLException may be thrown
1419     */

1420    public boolean previous() throws SQLException JavaDoc {
1421        resetRow();
1422        boolean ret = false;
1423        if (stmt != null && cursor != null) {
1424            ret = cursor.prev();
1425            if (ret) {
1426                rowNum--;
1427                rowCount--;
1428            }
1429        }
1430        //#ifdef DEBUG
1431
if (trace.bit(0)) {
1432            Debug.println("ResultSet.next() (cursor " +
1433                          cursor.getClass().getName() +
1434                          ") returns " + ret);
1435        }
1436        //#endif
1437
return ret;
1438    }
1439    
1440    /**
1441     * Refresh the row from the underlying data store
1442     */

1443    public void refreshRow() throws SQLException JavaDoc {
1444        this.row = null;
1445    }
1446    
1447    /**
1448     * Move the cursor <code>rows</code> units forward
1449     * (if <code>rows &gt; 0</code>) or backward
1450     * (if <code>rows &lt; 0</code>)
1451     */

1452    public boolean relative(int rows) throws SQLException JavaDoc {
1453        if (rowNum != 0) {
1454            return absolute(rowNum + rows);
1455        } else {
1456            return false;
1457        }
1458    }
1459    
1460    /**
1461     * Return <code>true</code> if the current row has been deleted.
1462     *
1463     * @return false
1464     */

1465    public boolean rowDeleted() {
1466        return rowDeleted;
1467    }
1468    
1469    /**
1470     * Return <code>true</code> if the current row has been inserted.
1471     */

1472    public boolean rowInserted() {
1473        return rowUpdated && onInsertRow;
1474    }
1475    
1476    /**
1477     * Return <code>true</code> if the current row has been updated.
1478     */

1479    public boolean rowUpdated() throws SQLException JavaDoc {
1480        return rowUpdated && !onInsertRow;
1481    }
1482    
1483    /**
1484     * This release of QED ignores the 'fetch direction' hint
1485     */

1486    public void setFetchDirection(int direction) throws SQLException JavaDoc {
1487    }
1488
1489    /**
1490     * QED, being an embedded driver, fetches rows only when they are
1491     * needed, with no performance penalty. Thus, the fetch size is
1492     * always <code>one</code>, and this function has no effect.
1493     */

1494    public void setFetchSize(int size) {
1495    }
1496    
1497    /**
1498     * Update the specified character value using an
1499     * <code>InputStream</code> that contains a stream of ASCII bytes.
1500     * The ASCII bytes are converted to Unicode character values before
1501     * being inserted into the database.
1502     *
1503     * @param col the column number
1504     * @param is an input stream containing ASCII bytes.
1505     * @param length the number of bytes to read from the stream
1506     * @return an <code>InputStream</code>
1507     * @exception SQLException may be thrown
1508     */

1509    public void updateAsciiStream(int col, InputStream JavaDoc is, int length)
1510        throws SQLException JavaDoc
1511    {
1512        updateCharacterStream(col, new AsciiReader(is), length);
1513    }
1514    
1515    /**
1516     * Update the specified character value using an
1517     * <code>InputStream</code> that contains a stream of ASCII bytes.
1518     * The ASCII bytes are converted to Unicode character values before
1519     * being inserted into the database.
1520     *
1521     * @param column the column name
1522     * @param is an input stream containing ASCII bytes.
1523     * @param length the number of bytes to read from the stream
1524     * @return an <code>InputStream</code>
1525     * @exception SQLException may be thrown
1526     */

1527    public void updateAsciiStream(String JavaDoc column, InputStream JavaDoc is, int length)
1528        throws SQLException JavaDoc
1529    {
1530        updateAsciiStream(findColumn(column), is, length);
1531    }
1532    
1533    /**
1534     * Update the specified column with a <code>BigDecimal</code> value.
1535     *
1536     * @param column the column name
1537     * @param val the new value
1538     * @exception SQLException may be thrown
1539     */

1540    public void updateBigDecimal(int col, BigDecimal JavaDoc val)
1541        throws SQLException JavaDoc
1542    {
1543        checkWritable(col);
1544        getCursorRow().set(col, new ValueScaledInteger(val));
1545    }
1546    
1547    /**
1548     * Update the specified column with a <code>BigDecimal</code> value.
1549     *
1550     * @param column the column name
1551     * @param val the new value
1552     * @exception SQLException may be thrown
1553     */

1554    public void updateBigDecimal(String JavaDoc column, BigDecimal JavaDoc val)
1555        throws SQLException JavaDoc
1556    {
1557        updateBigDecimal(findColumn(column), val);
1558    }
1559    
1560    /**
1561     * Update the specified value using an
1562     * <code>InputStream</code> that contains a stream of bytes.
1563     *
1564     * @param col the column number
1565     * @param is an input stream
1566     * @param length the number of bytes to read from the stream
1567     * @return an <code>InputStream</code>
1568     * @exception SQLException may be thrown
1569     */

1570    public void updateBinaryStream(int col, InputStream JavaDoc is, int length)
1571        throws SQLException JavaDoc
1572    {
1573        checkWritable(col);
1574        try {
1575            ValueBlob val = new ValueBlob(getSession().getDatabase(),
1576                                          getTransactionId(), is, length);
1577            getCursorRow().set(col, val);
1578        } catch (IOException JavaDoc e) {
1579            Debug.print(e);
1580            throw new SQLException JavaDoc("Can't update binary stream", "22000");
1581        }
1582
1583    }
1584    
1585    /**
1586     * Update the specified value using an
1587     * <code>InputStream</code> that contains a stream of bytes.
1588     *
1589     * @param column the column name
1590     * @param is an input stream
1591     * @param length the number of bytes to read from the stream
1592     * @return an <code>InputStream</code>
1593     * @exception SQLException may be thrown
1594     */

1595    public void updateBinaryStream(String JavaDoc column, InputStream JavaDoc is, int length)
1596        throws SQLException JavaDoc
1597    {
1598        updateBinaryStream(findColumn(column), is, length);
1599    }
1600    
1601    /**
1602     * Update the specified column with a <code>boolean</code> value.
1603     *
1604     * @param col the column numbere
1605     * @param val the new value
1606     * @exception SQLException may be thrown
1607     */

1608    public void updateBoolean(int col, boolean val) throws SQLException JavaDoc {
1609        checkWritable(col);
1610        getCursorRow().set(col, new ValueBoolean(val));
1611    }
1612    
1613    /**
1614     * Update the specified column with a <code>boolean</code> value.
1615     *
1616     * @param column the column name
1617     * @param val the new value
1618     * @exception SQLException may be thrown
1619     */

1620    public void updateBoolean(String JavaDoc column, boolean val)
1621        throws SQLException JavaDoc
1622    {
1623        updateBoolean(findColumn(column), val);
1624    }
1625    
1626    /**
1627     * Update the specified column with a <code>byte</code> value.
1628     *
1629     * @param col the column number
1630     * @param val the new value
1631     * @exception SQLException may be thrown
1632     */

1633    public void updateByte(int col, byte val) throws SQLException JavaDoc {
1634        checkWritable(col);
1635        getCursorRow().set(col, new ValueShort(val));
1636    }
1637    
1638    /**
1639     * Update the specified column with a <code>byte</code> value.
1640     *
1641     * @param column the column name
1642     * @param val the new value
1643     * @exception SQLException may be thrown
1644     */

1645    public void updateByte(String JavaDoc column, byte val) throws SQLException JavaDoc {
1646        updateByte(findColumn(column), val);
1647    }
1648    
1649    /**
1650     * Update the specified column with a <code>byte</code> array value.
1651     *
1652     * @param col the column number
1653     * @param val the new value
1654     * @exception SQLException may be thrown
1655     */

1656    public void updateBytes(int col, byte[] val) throws SQLException JavaDoc {
1657        checkWritable(col);
1658        getCursorRow().set(col, new ValueOctets(val));
1659    }
1660    
1661    /**
1662     * Update the specified column with a <code>byte</code> array value.
1663     *
1664     * @param column the column name
1665     * @param val the new value
1666     * @exception SQLException may be thrown
1667     */

1668    public void updateBytes(String JavaDoc column, byte[] val) throws SQLException JavaDoc {
1669        updateBytes(findColumn(column), val);
1670    }
1671    
1672    /**
1673     * Update the specified character value using a
1674     * <code>Reader</code> that contains a stream of characters.
1675     *
1676     * @param col the column number
1677     * @param r an input reader
1678     * @param length the number of characters to read from the reader
1679     * @return an <code>InputStream</code>
1680     * @exception SQLException may be thrown
1681     */

1682    public void updateCharacterStream(int col, Reader JavaDoc r, int length)
1683        throws SQLException JavaDoc
1684    {
1685        updateBinaryStream(col, new ReaderInputStream(r), length*2);
1686    }
1687    
1688    /**
1689     * Update the specified character value using a
1690     * <code>Reader</code> that contains a stream of characters.
1691     *
1692     * @param column the column name
1693     * @param r an input reader
1694     * @param length the number of characters to read from the reader
1695     * @return an <code>InputStream</code>
1696     * @exception SQLException may be thrown
1697     */

1698    public void updateCharacterStream(String JavaDoc column, Reader JavaDoc r, int length)
1699        throws SQLException JavaDoc
1700    {
1701        updateCharacterStream(findColumn(column), r, length);
1702    }
1703    
1704    /**
1705     * Update the specified column with a <code>Date</code> value.
1706     *
1707     * @param col the column number
1708     * @param val the new value
1709     * @exception SQLException may be thrown
1710     */

1711    public void updateDate(int col, Date JavaDoc val) throws SQLException JavaDoc {
1712        checkWritable(col);
1713        getCursorRow().set(col, new ValueDate(val.getTime()));
1714    }
1715    
1716    /**
1717     * Update the specified column with a <code>Date</code> value.
1718     *
1719     * @param column the column name
1720     * @param val the new value
1721     * @exception SQLException may be thrown
1722     */

1723    public void updateDate(String JavaDoc column, Date JavaDoc val) throws SQLException JavaDoc {
1724        updateDate(findColumn(column), val);
1725    }
1726    
1727    /**
1728     * Update the specified column with a <code>double</code> value.
1729     *
1730     * @param col the column number
1731     * @param val the new value
1732     * @exception SQLException may be thrown
1733     */

1734    public void updateDouble(int col, double val) throws SQLException JavaDoc {
1735        checkWritable(col);
1736        getCursorRow().set(col, new ValueDouble(val));
1737    }
1738    
1739    /**
1740     * Update the specified column with a <code>double</code> value.
1741     *
1742     * @param column the column name
1743     * @param val the new value
1744     * @exception SQLException may be thrown
1745     */

1746    public void updateDouble(String JavaDoc column, double val) throws SQLException JavaDoc {
1747        updateDouble(findColumn(column), val);
1748    }
1749    
1750    /**
1751     * Update the specified column with a <code>float</code> value.
1752     *
1753     * @param col the column number
1754     * @param val the new value
1755     * @exception SQLException may be thrown
1756     */

1757    public void updateFloat(int col, float val) throws SQLException JavaDoc {
1758        checkWritable(col);
1759        getCursorRow().set(col, new ValueDouble(val));
1760    }
1761    
1762    /**
1763     * Update the specified column with a <code>float</code> value.
1764     *
1765     * @param column the column name
1766     * @param val the new value
1767     * @exception SQLException may be thrown
1768     */

1769    public void updateFloat(String JavaDoc column, float val) throws SQLException JavaDoc {
1770        updateFloat(findColumn(column), val);
1771    }
1772    
1773    /**
1774     * Update the specified column with a <code>int</code> value.
1775     *
1776     * @param col the column number
1777     * @param val the new value
1778     * @exception SQLException may be thrown
1779     */

1780    public void updateInt(int col, int val) throws SQLException JavaDoc {
1781        //#ifdef DEBUG
1782
if (trace.bit(5)) {
1783            Debug.println("updateInt(" + col + ", " + val + ")");
1784        }
1785        //#endif
1786
checkWritable(col);
1787        Row row1 = getCursorRow();
1788        row1.set(col, new ValueInteger(val));
1789    }
1790    
1791    /**
1792     * Update the specified column with a <code>int</code> value.
1793     *
1794     * @param column the column name
1795     * @param val the new value
1796     * @exception SQLException may be thrown
1797     */

1798    public void updateInt(String JavaDoc column, int val) throws SQLException JavaDoc {
1799        updateInt(findColumn(column), val);
1800    }
1801    
1802    /**
1803     * Update the specified column with a <code>long</code> value.
1804     *
1805     * @param col the column number
1806     * @param val the new value
1807     * @exception SQLException may be thrown
1808     */

1809    public void updateLong(int col, long val) throws SQLException JavaDoc {
1810        checkWritable(col);
1811        getCursorRow().set(col, new ValueLong(val));
1812    }
1813    
1814    /**
1815     * Update the specified column with a <code>long</code> value.
1816     *
1817     * @param column the column name
1818     * @param val the new value
1819     * @exception SQLException may be thrown
1820     */

1821    public void updateLong(String JavaDoc column, long val) throws SQLException JavaDoc {
1822        updateLong(findColumn(column), val);
1823    }
1824    
1825    /**
1826     * Update the specified column with a <code>null</code> value.
1827     *
1828     * @param column the column name
1829     * @exception SQLException may be thrown
1830     */

1831    public void updateNull(int col) throws SQLException JavaDoc {
1832        checkWritable(col);
1833        getCursorRow().set(col, ValueNull.valueNull);
1834    }
1835    
1836    /**
1837     * Update the specified column with a <code>null</code> value.
1838     *
1839     * @param column the column name
1840     * @exception SQLException may be thrown
1841     */

1842    public void updateNull(String JavaDoc column) throws SQLException JavaDoc {
1843        updateNull(findColumn(column));
1844    }
1845    
1846    /**
1847     * Update the specified column with the value of a
1848     * Java <code>Object</code>.
1849     *
1850     * @param col the column number
1851     * @param val the new value
1852     * @exception SQLException may be thrown
1853     */

1854    public void updateObject(int col, Object JavaDoc val) throws SQLException JavaDoc {
1855        //#ifdef DEBUG
1856
if (trace.bit(5)) {
1857            Debug.println("updateObject(" + col + ", " + val + ")");
1858        }
1859        //#endif
1860
checkWritable(col);
1861        getCursorRow().set(col, Value.fromObject(val));
1862    }
1863    
1864    /**
1865     * Update the specified column with the value of a
1866     * Java <code>Object</code>.
1867     *
1868     * @param col the column number
1869     * @param val the new value
1870     * @param scale ignored in this release of QED
1871     * @exception SQLException may be thrown
1872     */

1873    public void updateObject(int col, Object JavaDoc val, int scale)
1874        throws SQLException JavaDoc
1875    {
1876        updateObject(col, val); // XXX tossing scale!
1877
}
1878    
1879    /**
1880     * Update the specified column with the value of a
1881     * Java <code>Object</code>.
1882     *
1883     * @param column the column name
1884     * @param val the new value
1885     * @exception SQLException may be thrown
1886     */

1887    public void updateObject(String JavaDoc column, Object JavaDoc val) throws SQLException JavaDoc {
1888        updateObject(findColumn(column), val);
1889        
1890    }
1891    
1892    /**
1893     * Update the specified column with the value of a
1894     * Java <code>Object</code>.
1895     *
1896     * @param col the column number
1897     * @param val the new value
1898     * @param scale ignored in this release of QED
1899     * @exception SQLException may be thrown
1900     */

1901    public void updateObject(String JavaDoc column, Object JavaDoc val, int scale)
1902        throws SQLException JavaDoc
1903    {
1904        updateObject(findColumn(column), val, scale);
1905    }
1906    
1907    /**
1908     * Update the specified column with a <code>short</code> value.
1909     *
1910     * @param col the column number
1911     * @param val the new value
1912     * @exception SQLException may be thrown
1913     */

1914    public void updateShort(int col, short val) throws SQLException JavaDoc {
1915        checkWritable(col);
1916        getCursorRow().set(col, new ValueShort(val));
1917    }
1918    
1919    /**
1920     * Update the specified column with a <code>short</code> value.
1921     *
1922     * @param column the column name
1923     * @param val the new value
1924     * @exception SQLException may be thrown
1925     */

1926    public void updateShort(String JavaDoc column, short val) throws SQLException JavaDoc {
1927        updateShort(findColumn(column), val);
1928    }
1929    
1930    /**
1931     * Update the specified column with a <code>String</code> value.
1932     *
1933     * @param col the column number
1934     * @param val the new value
1935     * @exception SQLException may be thrown
1936     */

1937    public void updateString(int col, String JavaDoc val) throws SQLException JavaDoc {
1938        checkWritable(col);
1939        getCursorRow().set(col, new ValueString(val));
1940    }
1941    
1942    /**
1943     * Update the specified column with a <code>String</code> value.
1944     *
1945     * @param column the column name
1946     * @param val the new value
1947     * @exception SQLException may be thrown
1948     */

1949    public void updateString(String JavaDoc column, String JavaDoc val) throws SQLException JavaDoc {
1950        updateString(findColumn(column), val);
1951    }
1952    
1953    /**
1954     * Update the specified column with a <code>Time</code> value.
1955     *
1956     * @param col the column number
1957     * @param val the new value
1958     * @exception SQLException may be thrown
1959     */

1960    public void updateTime(int col, Time JavaDoc val) throws SQLException JavaDoc {
1961        checkWritable(col);
1962        getCursorRow().set(col, new ValueTime(val.getTime()));
1963    }
1964    
1965    /**
1966     * Update the specified column with a <code>Time</code> value.
1967     *
1968     * @param column the column name
1969     * @param val the new value
1970     * @exception SQLException may be thrown
1971     */

1972    public void updateTime(String JavaDoc column, Time JavaDoc val) throws SQLException JavaDoc {
1973        updateTime(findColumn(column), val);
1974    }
1975    
1976    /**
1977     * Update the specified column with a <code>Timestamp</code> value.
1978     *
1979     * @param col the column number
1980     * @param val the new value
1981     * @exception SQLException may be thrown
1982     */

1983    public void updateTimestamp(int col, Timestamp JavaDoc val) throws SQLException JavaDoc {
1984        checkWritable(col);
1985        getCursorRow().set(col, new ValueTimestamp(val));
1986    }
1987    
1988    /**
1989     * Update the specified column with a <code>Timestamp</code> value.
1990     *
1991     * @param column the column name
1992     * @param val the new value
1993     * @exception SQLException may be thrown
1994     */

1995    public void updateTimestamp(String JavaDoc column, Timestamp JavaDoc val)
1996        throws SQLException JavaDoc
1997    {
1998        updateTimestamp(findColumn(column), val);
1999    }
2000    
2001    /**
2002     * Return <code>true</code> if the last value fetched (via a
2003     * <code>getXXX()</code> method) was <code>NULL</code>.
2004     *
2005     * @return true if the last value fetched was <code>NULL</code>.
2006     */

2007    public boolean wasNull() {
2008        return wasNull;
2009    }
2010
2011    
2012    int resultSetType = ResultSet.TYPE_FORWARD_ONLY;
2013    int resultSetConcurrency = ResultSet.CONCUR_READ_ONLY;
2014
2015    /**
2016     * Ensure that this ResultSet is scrollable. This method is a
2017     * factorization of the common check necessary for all ResultSet
2018     * scoll methods.
2019     */

2020    final void checkScrollable() throws SQLException JavaDoc {
2021        if (resultSetType == ResultSet.TYPE_FORWARD_ONLY) {
2022            throw new SQLException JavaDoc(
2023                "checkScrollable(): type == ResultSet.TYPE_FORWARD_ONLY");
2024        }
2025    }
2026                                   
2027    /**
2028     * Ensure that this ResultSet is updatable. This method is a
2029     * factorization of the common check necessary for all ResultSet
2030     * update methods.
2031     */

2032    final void checkUpdatable() throws SQLException JavaDoc {
2033        if (resultSetConcurrency == ResultSet.CONCUR_READ_ONLY) {
2034            throw new SQLException JavaDoc(
2035                "checkUpdatable(): concurrency == CONCUR_READ_ONLY");
2036        }
2037    }
2038                                   
2039    /**
2040     * Throw an exception if the specified column number isn't writable.
2041     */

2042    final private void checkWritable(int col) throws SQLException JavaDoc {
2043        checkUpdatable();
2044        if (!cursor.isWritable(col)) {
2045            //#ifdef DEBUG
2046
Debug.println("cursor = " + cursor);
2047            //#endif
2048
throw new SQLException JavaDoc("Not writable: " +
2049                                   cursor.getColumn(col).getName(),
2050                                   "42000");
2051        }
2052        if (!(onInsertRow || onUpdateRow)) {
2053            onUpdateRow = true;
2054            insertRow = null;
2055        }
2056    }
2057
2058
2059    /**
2060     * Return the concurrency level of this <code>ResultSet</code>.
2061     *
2062     * @return this <code>ResultSet</code>s concurrency level
2063     */

2064    public int getConcurrency() {
2065        return resultSetConcurrency;
2066    }
2067    
2068    /**
2069     * This release of QED only supports forward cursor movement.
2070     *
2071     * @return <code>FETCH_FORWARD</code>
2072     */

2073    public int getFetchDirection() {
2074        return FETCH_FORWARD;
2075    }
2076
2077    //#ifndef JDK11
2078
/**
2079     * This release of QED doesn't support <code>ARRAY</code> types.
2080     *
2081     * @exception SQLException "not implemented"
2082     */

2083    public Array JavaDoc getArray(int col) throws SQLException JavaDoc {
2084        throw new SQLException JavaDoc("not implemented", "0A000");
2085    }
2086    
2087    /**
2088     * This release of QED doesn't support <code>ARRAY</code> types.
2089     *
2090     * @exception SQLException "not implemented"
2091     */

2092    public Array JavaDoc getArray(String JavaDoc column) throws SQLException JavaDoc {
2093        return getArray(findColumn(column));
2094    }
2095    
2096    /**
2097     * Retrieve the specified column as a <code>Blob</code> object.
2098     *
2099     * @param col the column number
2100     * @return the column's value in the current row
2101     * @exception SQLException may be thrown
2102     */

2103    public Blob JavaDoc getBlob(int col) throws SQLException JavaDoc {
2104        Value v = getValue(col);
2105        if (Value.isNull(v)) return null;
2106        v = v.convert(TypeBlob.typeBlob);
2107        ValueBlob vb = (ValueBlob)v;
2108        return vb;
2109    }
2110    
2111    /**
2112     * Retrieve the specified column as a <code>Blob</code> object.
2113     *
2114     * @param column the column name
2115     * @return the column's value in the current row
2116     * @exception SQLException may be thrown
2117     */

2118    public Blob JavaDoc getBlob(String JavaDoc column) throws SQLException JavaDoc {
2119        return getBlob(findColumn(column));
2120    }
2121    
2122    /**
2123     * Retrieve the specified column as a Java <code>Object</code>,
2124     * using the supplied type map. This feature is not supported
2125     * by this release of QED.
2126     *
2127     * @exception SQLException "not implemented"
2128     */

2129    public Object JavaDoc getObject(int col, Map JavaDoc map) throws SQLException JavaDoc {
2130        throw new SQLException JavaDoc("not implemented", "0A000");
2131    }
2132
2133    /**
2134     * Retrieve the specified column as a Java <code>Object</code>,
2135     * using the supplied type map. This feature is not supported
2136     * by this release of QED.
2137     *
2138     * @exception SQLException "not implemented"
2139     */

2140    public Object JavaDoc getObject(String JavaDoc column, Map JavaDoc map) throws SQLException JavaDoc {
2141        return getObject(findColumn(column), map);
2142    }
2143    
2144    /**
2145     * This release of QED doesn't support <code>REF</code> types.
2146     *
2147     * @exception SQLException "not implemented"
2148     */

2149    public Ref JavaDoc getRef(int col) throws SQLException JavaDoc {
2150        throw new SQLException JavaDoc("not implemented", "0A000");
2151    }
2152    
2153    /**
2154     * This release of QED doesn't support <code>REF</code> types.
2155     *
2156     * @exception SQLException "not implemented"
2157     */

2158    public Ref JavaDoc getRef(String JavaDoc column) throws SQLException JavaDoc {
2159        return getRef(findColumn(column));
2160    }
2161
2162    /**
2163     * This QED release only supports <code>ResultSet.TYPE_FORWARD_ONLY</code>.
2164     *
2165     * @return <code>ResultSet.TYPE_FORWARD_ONLY</code>
2166     */

2167    public int getType() {
2168        return resultSetType;
2169    }
2170
2171    /**
2172     * Retrieve the specified column as a <code>Clob</code> object.
2173     *
2174     * @param col the column number
2175     * @return the column's value in the current row
2176     * @exception SQLException may be thrown
2177     */

2178    public Clob JavaDoc getClob(int col) throws SQLException JavaDoc {
2179        Value v = getValue(col);
2180        if (Value.isNull(v)) return null;
2181        v = v.convert(TypeClob.typeClob);
2182        ValueClob vb = (ValueClob)v;
2183        return vb;
2184    }
2185    
2186    /**
2187     * Retrieve the specified column as a <code>Clob</code> object.
2188     *
2189     * @param column the column name
2190     * @return the column's value in the current row
2191     * @exception SQLException may be thrown
2192     */

2193    public Clob JavaDoc getClob(String JavaDoc column) throws SQLException JavaDoc {
2194        return getClob(findColumn(column));
2195    }
2196    
2197    //#endif
2198

2199    //#ifdef JDK14
2200
//-------------------------- JDBC 3.0 -----------------------------------
2201
/**
2202     * The constant indicating that <code>ResultSet</code> objects should not
2203     * be closed when the method <code>Connection.commit</code> is called.
2204     *
2205     * @since 1.4
2206     */

2207    //int HOLD_CURSORS_OVER_COMMIT = 1;
2208

2209    /**
2210     * The constant indicating that <code>ResultSet</code> objects should be
2211     * closed when the method <code>Connection.commit</code> is called.
2212     *
2213     * @since 1.4
2214     */

2215    //int CLOSE_CURSORS_AT_COMMIT = 2;
2216

2217    /**
2218     * Retrieves the value of the designated column in the current row
2219     * of this <code>ResultSet</code> object as a <code>java.net.URL</code>
2220     * object in the Java programming language.
2221     *
2222     * @param columnIndex the index of the column 1 is the first, 2 is the second,...
2223     * @return the column value as a <code>java.net.URL</code> object;
2224     * if the value is SQL <code>NULL</code>,
2225     * the value returned is <code>null</code> in the Java programming language
2226     * @exception SQLException if a database access error occurs,
2227     * or if a URL is malformed
2228     * @since 1.4
2229     */

2230    public java.net.URL JavaDoc getURL(int columnIndex) throws SQLException JavaDoc {
2231        try {
2232            return new java.net.URL JavaDoc(getString(columnIndex));
2233        } catch (java.net.MalformedURLException JavaDoc e) {
2234            throw new SQLException JavaDoc(e.toString());
2235        }
2236    }
2237
2238    /**
2239     * Retrieves the value of the designated column in the current row
2240     * of this <code>ResultSet</code> object as a <code>java.net.URL</code>
2241     * object in the Java programming language.
2242     *
2243     * @param columnName the SQL name of the column
2244     * @return the column value as a <code>java.net.URL</code> object;
2245     * if the value is SQL <code>NULL</code>,
2246     * the value returned is <code>null</code> in the Java programming language
2247     * @exception SQLException if a database access error occurs
2248     * or if a URL is malformed
2249     * @since 1.4
2250     */

2251    public java.net.URL JavaDoc getURL(String JavaDoc columnName) throws SQLException JavaDoc {
2252        return getURL(findColumn(columnName));
2253    }
2254
2255    /**
2256     * Updates the designated column with a <code>java.sql.Ref</code> value.
2257     * The updater methods are used to update column values in the
2258     * current row or the insert row. The updater methods do not
2259     * update the underlying database; instead the <code>updateRow</code> or
2260     * <code>insertRow</code> methods are called to update the database.
2261     *
2262     * @param columnIndex the first column is 1, the second is 2, ...
2263     * @param x the new column value
2264     * @exception SQLException if a database access error occurs
2265     * @since 1.4
2266     */

2267    public void updateRef(int columnIndex, java.sql.Ref JavaDoc x)
2268        throws SQLException JavaDoc
2269    {
2270        throw new SQLException JavaDoc("Not implemented");
2271    }
2272            
2273    
2274    /**
2275     * Updates the designated column with a <code>java.sql.Ref</code> value.
2276     * The updater methods are used to update column values in the
2277     * current row or the insert row. The updater methods do not
2278     * update the underlying database; instead the <code>updateRow</code> or
2279     * <code>insertRow</code> methods are called to update the database.
2280     *
2281     * @param columnName the name of the column
2282     * @param x the new column value
2283     * @exception SQLException if a database access error occurs
2284     * @since 1.4
2285     */

2286    public void updateRef(String JavaDoc columnName, java.sql.Ref JavaDoc x)
2287        throws SQLException JavaDoc
2288    {
2289        throw new SQLException JavaDoc("Not implemented");
2290    }
2291
2292    /**
2293     * Updates the designated column with a <code>java.sql.Blob</code> value.
2294     * The updater methods are used to update column values in the
2295     * current row or the insert row. The updater methods do not
2296     * update the underlying database; instead the <code>updateRow</code> or
2297     * <code>insertRow</code> methods are called to update the database.
2298     *
2299     * @param columnIndex the first column is 1, the second is 2, ...
2300     * @param x the new column value
2301     * @exception SQLException if a database access error occurs
2302     * @since 1.4
2303     */

2304    public void updateBlob(int columnIndex, java.sql.Blob JavaDoc x)
2305        throws SQLException JavaDoc
2306    {
2307        throw new SQLException JavaDoc("Not implemented");
2308    }
2309
2310    /**
2311     * Updates the designated column with a <code>java.sql.Blob</code> value.
2312     * The updater methods are used to update column values in the
2313     * current row or the insert row. The updater methods do not
2314     * update the underlying database; instead the <code>updateRow</code> or
2315     * <code>insertRow</code> methods are called to update the database.
2316     *
2317     * @param columnName the name of the column
2318     * @param x the new column value
2319     * @exception SQLException if a database access error occurs
2320     * @since 1.4
2321     */

2322    public void updateBlob(String JavaDoc columnName, java.sql.Blob JavaDoc x)
2323        throws SQLException JavaDoc
2324    {
2325        throw new SQLException JavaDoc("Not implemented");
2326    }
2327
2328    /**
2329     * Updates the designated column with a <code>java.sql.Clob</code> value.
2330     * The updater methods are used to update column values in the
2331     * current row or the insert row. The updater methods do not
2332     * update the underlying database; instead the <code>updateRow</code> or
2333     * <code>insertRow</code> methods are called to update the database.
2334     *
2335     * @param columnIndex the first column is 1, the second is 2, ...
2336     * @param x the new column value
2337     * @exception SQLException if a database access error occurs
2338     * @since 1.4
2339     */

2340    public void updateClob(int columnIndex, java.sql.Clob JavaDoc x)
2341        throws SQLException JavaDoc
2342    {
2343        throw new SQLException JavaDoc("Not implemented");
2344    }
2345
2346    /**
2347     * Updates the designated column with a <code>java.sql.Clob</code> value.
2348     * The updater methods are used to update column values in the
2349     * current row or the insert row. The updater methods do not
2350     * update the underlying database; instead the <code>updateRow</code> or
2351     * <code>insertRow</code> methods are called to update the database.
2352     *
2353     * @param columnName the name of the column
2354     * @param x the new column value
2355     * @exception SQLException if a database access error occurs
2356     * @since 1.4
2357     */

2358    public void updateClob(String JavaDoc columnName, java.sql.Clob JavaDoc x)
2359        throws SQLException JavaDoc
2360    {
2361        throw new SQLException JavaDoc("Not implemented");
2362    }
2363
2364    /**
2365     * Updates the designated column with a <code>java.sql.Array</code> value.
2366     * The updater methods are used to update column values in the
2367     * current row or the insert row. The updater methods do not
2368     * update the underlying database; instead the <code>updateRow</code> or
2369     * <code>insertRow</code> methods are called to update the database.
2370     *
2371     * @param columnIndex the first column is 1, the second is 2, ...
2372     * @param x the new column value
2373     * @exception SQLException if a database access error occurs
2374     * @since 1.4
2375     */

2376    public void updateArray(int columnIndex, java.sql.Array JavaDoc x)
2377        throws SQLException JavaDoc
2378    {
2379        throw new SQLException JavaDoc("Not implemented");
2380    }
2381
2382    /**
2383     * Updates the designated column with a <code>java.sql.Array</code> value.
2384     * The updater methods are used to update column values in the
2385     * current row or the insert row. The updater methods do not
2386     * update the underlying database; instead the <code>updateRow</code> or
2387     * <code>insertRow</code> methods are called to update the database.
2388     *
2389     * @param columnName the name of the column
2390     * @param x the new column value
2391     * @exception SQLException if a database access error occurs
2392     * @since 1.4
2393     */

2394    public void updateArray(String JavaDoc columnName, java.sql.Array JavaDoc x)
2395        throws SQLException JavaDoc
2396    {
2397        throw new SQLException JavaDoc("Not implemented");
2398    }
2399    //#endif
2400
}
2401
Popular Tags