KickJava   Java API By Example, From Geeks To Geeks.

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


1
2 /**
3  * RmiJdbc client/server JDBC Driver
4  * (C) GIE Dyade (Groupe BULL / INRIA Research Center) 1997
5  *
6  * @version 1.0
7  * @author Pierre-Yves Gibello (pierreyves.gibello@experlog.com)
8  * Additional SSL Support
9  * Douglas Hammond(djhammond@sympatico.ca)
10  */

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

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

68
69 public class RJResultSetServer
70 extends UnicastRemoteObject JavaDoc
71 implements RJResultSetInterface, Unreferenced JavaDoc {
72
73   java.sql.ResultSet JavaDoc jdbcResultSet_;
74
75   public RJResultSetServer(java.sql.ResultSet JavaDoc s)
76   throws java.rmi.RemoteException JavaDoc {
77        super(RJJdbcServer.rmiJdbcListenerPort, RJJdbcServer.rmiClientSocketFactory, RJJdbcServer.rmiServerSocketFactory);
78     jdbcResultSet_ = s;
79   }
80
81   public void unreferenced() { Runtime.getRuntime().gc(); }
82
83   protected void finalize() throws Throwable JavaDoc {
84     if(jdbcResultSet_ != null) jdbcResultSet_.close();
85   }
86
87   /**
88    * A ResultSet is initially positioned before its first row; the
89    * first call to next makes the first row the current row; the
90    * second call makes the second row the current row, etc.
91    *
92    * <P>If an input stream from the previous row is open, it is
93    * implicitly closed. The ResultSet's warning chain is cleared
94    * when a new row is read.
95    *
96    * @return true if the new current row is valid; false if there
97    * are no more rows
98    */

99   public boolean next() throws RemoteException, SQLException {
100     return jdbcResultSet_.next();
101   }
102
103
104   /**
105    * In some cases, it is desirable to immediately release a
106    * ResultSet's database and JDBC resources instead of waiting for
107    * this to happen when it is automatically closed; the close
108    * method provides this immediate release.
109    *
110    * <P><B>Note:</B> A ResultSet is automatically closed by the
111    * Statement that generated it when that Statement is closed,
112    * re-executed, or is used to retrieve the next result from a
113    * sequence of multiple results. A ResultSet is also automatically
114    * closed when it is garbage collected.
115    */

116   public void close() throws RemoteException, SQLException {
117     if(jdbcResultSet_ != null) jdbcResultSet_.close();
118   }
119
120   /**
121    * A column may have the value of SQL NULL; wasNull reports whether
122    * the last column read had this special value.
123    * Note that you must first call getXXX on a column to try to read
124    * its value and then call wasNull() to find if the value was
125    * the SQL NULL.
126    *
127    * @return true if last column read was SQL NULL
128    */

129   public boolean wasNull() throws RemoteException, SQLException {
130     return jdbcResultSet_.wasNull();
131   }
132     
133   //======================================================================
134
// Methods for accessing results by column index
135
//======================================================================
136

137   /**
138    * Get the value of a column in the current row as a Java String.
139    *
140    * @param columnIndex the first column is 1, the second is 2, ...
141    * @return the column value; if the value is SQL NULL, the result is null
142    */

143   public String JavaDoc getString(int columnIndex) throws RemoteException, SQLException {
144     return jdbcResultSet_.getString(columnIndex);
145   }
146
147   /**
148    * Get the value of a column in the current row as a Java boolean.
149    *
150    * @param columnIndex the first column is 1, the second is 2, ...
151    * @return the column value; if the value is SQL NULL, the result is false
152    */

153   public boolean getBoolean(int columnIndex) throws RemoteException, SQLException {
154     return jdbcResultSet_.getBoolean(columnIndex);
155   }
156
157     /**
158      * Get the value of a column in the current row as a Java byte.
159      *
160      * @param columnIndex the first column is 1, the second is 2, ...
161      * @return the column value; if the value is SQL NULL, the result is 0
162      */

163   public byte getByte(int columnIndex) throws RemoteException, SQLException {
164     return jdbcResultSet_.getByte(columnIndex);
165   }
166
167     /**
168      * Get the value of a column in the current row as a Java short.
169      *
170      * @param columnIndex the first column is 1, the second is 2, ...
171      * @return the column value; if the value is SQL NULL, the result is 0
172      */

173   public short getShort(int columnIndex) throws RemoteException, SQLException {
174     return jdbcResultSet_.getShort(columnIndex);
175   }
176
177   /**
178    * Get the value of a column in the current row as a Java int.
179    *
180    * @param columnIndex the first column is 1, the second is 2, ...
181    * @return the column value; if the value is SQL NULL, the result is 0
182    */

183   public int getInt(int columnIndex) throws RemoteException, SQLException {
184     return jdbcResultSet_.getInt(columnIndex);
185   }
186
187   /**
188    * Get the value of a column in the current row as a Java long.
189    *
190    * @param columnIndex the first column is 1, the second is 2, ...
191    * @return the column value; if the value is SQL NULL, the result is 0
192    */

193   public long getLong(int columnIndex) throws RemoteException, SQLException {
194     return jdbcResultSet_.getLong(columnIndex);
195   }
196
197   /**
198    * Get the value of a column in the current row as a Java float.
199    *
200    * @param columnIndex the first column is 1, the second is 2, ...
201    * @return the column value; if the value is SQL NULL, the result is 0
202    */

203   public float getFloat(int columnIndex) throws RemoteException, SQLException {
204     return jdbcResultSet_.getFloat(columnIndex);
205   }
206
207   /**
208    * Get the value of a column in the current row as a Java double.
209    *
210    * @param columnIndex the first column is 1, the second is 2, ...
211    * @return the column value; if the value is SQL NULL, the result is 0
212    */

213   public double getDouble(int columnIndex) throws RemoteException, SQLException {
214     return jdbcResultSet_.getDouble(columnIndex);
215   }
216
217   /**
218    * Get the value of a column in the current row as a java.lang.BigDecimal object.
219    *
220    * @param columnIndex the first column is 1, the second is 2, ...
221    * @param scale the number of digits to the right of the decimal
222    * @return the column value; if the value is SQL NULL, the result is null
223    */

224   public BigDecimal JavaDoc getBigDecimal(int columnIndex, int scale)
225   throws RemoteException, SQLException {
226     return jdbcResultSet_.getBigDecimal(columnIndex, scale);
227   }
228
229   /**
230    * Get the value of a column in the current row as a Java byte array.
231    * The bytes represent the raw values returned by the driver.
232    *
233    * @param columnIndex the first column is 1, the second is 2, ...
234    * @return the column value; if the value is SQL NULL, the result is null
235    */

236   public byte[] getBytes(int columnIndex) throws RemoteException, SQLException {
237     return jdbcResultSet_.getBytes(columnIndex);
238   }
239
240     /**
241      * Get the value of a column in the current row as a java.sql.Date object.
242      *
243      * @param columnIndex the first column is 1, the second is 2, ...
244      * @return the column value; if the value is SQL NULL, the result is null
245      */

246   public java.sql.Date JavaDoc getDate(int columnIndex) throws RemoteException, SQLException {
247     return jdbcResultSet_.getDate(columnIndex);
248   }
249
250     /**
251      * Get the value of a column in the current row as a java.sql.Time object.
252      *
253      * @param columnIndex the first column is 1, the second is 2, ...
254      * @return the column value; if the value is SQL NULL, the result is null
255      */

256   public java.sql.Time JavaDoc getTime(int columnIndex) throws RemoteException, SQLException {
257     return jdbcResultSet_.getTime(columnIndex);
258   }
259
260     /**
261      * Get the value of a column in the current row as a java.sql.Timestamp object.
262      *
263      * @param columnIndex the first column is 1, the second is 2, ...
264      * @return the column value; if the value is SQL NULL, the result is null
265      */

266   public java.sql.Timestamp JavaDoc getTimestamp(int columnIndex) throws RemoteException, SQLException {
267     return jdbcResultSet_.getTimestamp(columnIndex);
268   }
269
270     /**
271      * A column value can be retrieved as a stream of ASCII characters
272      * and then read in chunks from the stream. This method is particularly
273      * suitable for retrieving large LONGVARCHAR values. The JDBC driver will
274      * do any necessary conversion from the database format into ASCII.
275      *
276      * <P><B>Note:</B> All the data in the returned stream must be
277      * read prior to getting the value of any other column. The next
278      * call to a get method implicitly closes the stream. . Also, a
279      * stream may return 0 for available() whether there is data
280      * available or not.
281      *
282      * @param columnIndex the first column is 1, the second is 2, ...
283      * @return a Java input stream that delivers the database column value
284      * as a stream of one byte ASCII characters. If the value is SQL NULL
285      * then the result is null.
286      */

287 // public java.io.InputStream getAsciiStream(int columnIndex)
288
// TBD: This is a hack: InputStream is not serializable !
289
public byte[] getAsciiStream(int columnIndex)
290   throws RemoteException, SQLException {
291     try {
292       // I read the whole InputStream into a StringBuffer, then send the
293
// StringBuffer's bytes to the client !! Awful, isn't it :(
294
// The right way is to "RMIze" InputStream, or what ??
295
InputStream s = jdbcResultSet_.getAsciiStream(columnIndex);
296       return RJSerializer.toByteArray(s);
297     } catch(IOException e) {
298       throw new java.rmi.RemoteException JavaDoc(
299        "RJResultSetServer::getAsciiStream()", e);
300     }
301   }
302
303     /**
304      * A column value can be retrieved as a stream of Unicode characters
305      * and then read in chunks from the stream. This method is particularly
306      * suitable for retrieving large LONGVARCHAR values. The JDBC driver will
307      * do any necessary conversion from the database format into Unicode.
308      *
309      * <P><B>Note:</B> All the data in the returned stream must be
310      * read prior to getting the value of any other column. The next
311      * call to a get method implicitly closes the stream. . Also, a
312      * stream may return 0 for available() whether there is data
313      * available or not.
314      *
315      * @param columnIndex the first column is 1, the second is 2, ...
316      * @return a Java input stream that delivers the database column value
317      * as a stream of two byte Unicode characters. If the value is SQL NULL
318      * then the result is null.
319      */

320 // public java.io.InputStream getUnicodeStream(int columnIndex)
321
// TBD: This is a hack: InputStream is not serializable !
322
public byte[] getUnicodeStream(int columnIndex)
323   throws RemoteException, SQLException {
324     try {
325       // I read the whole InputStream into a StringBuffer, then send the
326
// StringBuffer's bytes to the client !! Awful, isn't it :(
327
// The right way is to "RMIze" InputStream, or what ??
328
InputStream s = jdbcResultSet_.getUnicodeStream(columnIndex);
329       return RJSerializer.toByteArray(s);
330     } catch(IOException e) {
331       throw new java.rmi.RemoteException JavaDoc(
332        "RJResultSetServer::getUnicodeStream()", e);
333     }
334   }
335
336  /**
337   ** TBD Proposed by P.Hearty - see below
338   * Reads all the bytes from an input stream into a bytes array.
339   static byte[] getBytesFromInputStream (InputStream is) throws IOException {
340       int numAvail = is.available();
341       byte[] bytes = new byte[numAvail];
342       int readSoFar = 0;
343       while (numAvail > 0) {
344           int actualRead = is.read (bytes, readSoFar, numAvail);
345           readSoFar += actualRead;
346           numAvail = is.available();
347           if (readSoFar+numAvail > bytes.length) {
348               // need to expand the bytes buffer
349               byte[] newBytes = new byte[(readSoFar+numAvail)*2];
350               System.arraycopy (bytes, 0, newBytes, 0, readSoFar);
351               bytes = newBytes;
352           } // if
353       } // while
354       return bytes;
355   } // getBytesFromInputStream
356  */

357
358     /**
359      * A column value can be retrieved as a stream of uninterpreted bytes
360      * and then read in chunks from the stream. This method is particularly
361      * suitable for retrieving large LONGVARBINARY values.
362      *
363      * <P><B>Note:</B> All the data in the returned stream must be
364      * read prior to getting the value of any other column. The next
365      * call to a get method implicitly closes the stream. Also, a
366      * stream may return 0 for available() whether there is data
367      * available or not.
368      *
369      * @param columnIndex the first column is 1, the second is 2, ...
370      * @return a Java input stream that delivers the database column value
371      * as a stream of uninterpreted bytes. If the value is SQL NULL
372      * then the result is null.
373      */

374 // public java.io.InputStream getBinaryStream(int columnIndex)
375
// TBD: This is a hack: InputStream is not serializable !
376
public byte[] getBinaryStream(int columnIndex)
377   throws RemoteException, SQLException {
378     try {
379       InputStream s = jdbcResultSet_.getBinaryStream(columnIndex);
380       return RJSerializer.toByteArray(s);
381 /** TBD Proposed by P. Hearty
382         return getBytesFromInputStream (s);
383 **/

384     } catch(IOException e) {
385       throw new java.rmi.RemoteException JavaDoc(
386        "RJResultSetServer::getBinaryStream()", e);
387     }
388   }
389
390
391     //======================================================================
392
// Methods for accessing results by column name
393
//======================================================================
394

395     /**
396      * Get the value of a column in the current row as a Java String.
397      *
398      * @param columnName is the SQL name of the column
399      * @return the column value; if the value is SQL NULL, the result is null
400      */

401   public String JavaDoc getString(String JavaDoc columnName) throws RemoteException, SQLException {
402     return jdbcResultSet_.getString(columnName);
403   }
404
405     /**
406      * Get the value of a column in the current row as a Java boolean.
407      *
408      * @param columnName is the SQL name of the column
409      * @return the column value; if the value is SQL NULL, the result is false
410      */

411   public boolean getBoolean(String JavaDoc columnName) throws RemoteException, SQLException {
412     return jdbcResultSet_.getBoolean(columnName);
413   }
414
415     /**
416      * Get the value of a column in the current row as a Java byte.
417      *
418      * @param columnName is the SQL name of the column
419      * @return the column value; if the value is SQL NULL, the result is 0
420      */

421   public byte getByte(String JavaDoc columnName) throws RemoteException, SQLException {
422     return jdbcResultSet_.getByte(columnName);
423   }
424
425     /**
426      * Get the value of a column in the current row as a Java short.
427      *
428      * @param columnName is the SQL name of the column
429      * @return the column value; if the value is SQL NULL, the result is 0
430      */

431   public short getShort(String JavaDoc columnName) throws RemoteException, SQLException {
432     return jdbcResultSet_.getShort(columnName);
433   }
434
435   /**
436    * Get the value of a column in the current row as a Java int.
437    *
438    * @param columnName is the SQL name of the column
439    * @return the column value; if the value is SQL NULL, the result is 0
440    */

441   public int getInt(String JavaDoc columnName) throws RemoteException, SQLException {
442     return jdbcResultSet_.getInt(columnName);
443   }
444
445     /**
446      * Get the value of a column in the current row as a Java long.
447      *
448      * @param columnName is the SQL name of the column
449      * @return the column value; if the value is SQL NULL, the result is 0
450      */

451   public long getLong(String JavaDoc columnName) throws RemoteException, SQLException {
452     return jdbcResultSet_.getLong(columnName);
453   }
454
455     /**
456      * Get the value of a column in the current row as a Java float.
457      *
458      * @param columnName is the SQL name of the column
459      * @return the column value; if the value is SQL NULL, the result is 0
460      */

461   public float getFloat(String JavaDoc columnName) throws RemoteException, SQLException {
462     return jdbcResultSet_.getFloat(columnName);
463   }
464
465     /**
466      * Get the value of a column in the current row as a Java double.
467      *
468      * @param columnName is the SQL name of the column
469      * @return the column value; if the value is SQL NULL, the result is 0
470      */

471   public double getDouble(String JavaDoc columnName) throws RemoteException, SQLException {
472     return jdbcResultSet_.getDouble(columnName);
473   }
474
475     /**
476      * Get the value of a column in the current row as a java.lang.BigDecimal object.
477      *
478      * @param columnName is the SQL name of the column
479      * @param scale the number of digits to the right of the decimal
480      * @return the column value; if the value is SQL NULL, the result is null
481      */

482   public BigDecimal JavaDoc getBigDecimal(String JavaDoc columnName, int scale)
483   throws RemoteException, SQLException {
484     return jdbcResultSet_.getBigDecimal(columnName, scale);
485   }
486
487     /**
488      * Get the value of a column in the current row as a Java byte array.
489      * The bytes represent the raw values returned by the driver.
490      *
491      * @param columnName is the SQL name of the column
492      * @return the column value; if the value is SQL NULL, the result is null
493      */

494   public byte[] getBytes(String JavaDoc columnName) throws RemoteException, SQLException {
495     return jdbcResultSet_.getBytes(columnName);
496   }
497
498     /**
499      * Get the value of a column in the current row as a java.sql.Date object.
500      *
501      * @param columnName is the SQL name of the column
502      * @return the column value; if the value is SQL NULL, the result is null
503      */

504   public java.sql.Date JavaDoc getDate(String JavaDoc columnName) throws RemoteException, SQLException {
505     return jdbcResultSet_.getDate(columnName);
506   }
507
508     /**
509      * Get the value of a column in the current row as a java.sql.Time object.
510      *
511      * @param columnName is the SQL name of the column
512      * @return the column value; if the value is SQL NULL, the result is null
513      */

514   public java.sql.Time JavaDoc getTime(String JavaDoc columnName) throws RemoteException, SQLException {
515     return jdbcResultSet_.getTime(columnName);
516   }
517
518     /**
519      * Get the value of a column in the current row as a java.sql.Timestamp object.
520      *
521      * @param columnName is the SQL name of the column
522      * @return the column value; if the value is SQL NULL, the result is null
523      */

524   public java.sql.Timestamp JavaDoc getTimestamp(String JavaDoc columnName)
525   throws RemoteException, SQLException {
526     return jdbcResultSet_.getTimestamp(columnName);
527   }
528
529     /**
530      * A column value can be retrieved as a stream of ASCII characters
531      * and then read in chunks from the stream. This method is particularly
532      * suitable for retrieving large LONGVARCHAR values. The JDBC driver will
533      * do any necessary conversion from the database format into ASCII.
534      *
535      * <P><B>Note:</B> All the data in the returned stream must
536      * be read prior to getting the value of any other column. The
537      * next call to a get method implicitly closes the stream.
538      *
539      * @param columnName is the SQL name of the column
540      * @return a Java input stream that delivers the database column value
541      * as a stream of one byte ASCII characters. If the value is SQL NULL
542      * then the result is null.
543      */

544 // public java.io.InputStream getAsciiStream(String columnName)
545
// TBD: This is a hack: InputStream is not serializable !
546
public byte[] getAsciiStream(String JavaDoc columnName)
547   throws RemoteException, SQLException {
548     try {
549       // I read the whole InputStream into a StringBuffer, then send the
550
// StringBuffer's bytes to the client !! Awful, isn't it :(
551
// The right way is to "RMIze" InputStream, or what ??
552
InputStream s = jdbcResultSet_.getAsciiStream(columnName);
553       return RJSerializer.toByteArray(s);
554 /** Proposed by P.Hearty
555         return getBytesFromInputStream (s);
556 **/

557     } catch(IOException e) {
558       throw new java.rmi.RemoteException JavaDoc(
559        "RJResultSetServer::getAsciiStream()", e);
560     }
561   }
562
563     /**
564      * A column value can be retrieved as a stream of Unicode characters
565      * and then read in chunks from the stream. This method is particularly
566      * suitable for retrieving large LONGVARCHAR values. The JDBC driver will
567      * do any necessary conversion from the database format into Unicode.
568      *
569      * <P><B>Note:</B> All the data in the returned stream must
570      * be read prior to getting the value of any other column. The
571      * next call to a get method implicitly closes the stream.
572      *
573      * @param columnName is the SQL name of the column
574      * @return a Java input stream that delivers the database column value
575      * as a stream of two byte Unicode characters. If the value is SQL NULL
576      * then the result is null.
577      */

578 // public java.io.InputStream getUnicodeStream(String columnName)
579
// TBD: This is a hack: InputStream is not serializable !
580
public byte[] getUnicodeStream(String JavaDoc columnName)
581   throws RemoteException, SQLException {
582     try {
583       // I read the whole InputStream into a StringBuffer, then send the
584
// StringBuffer's bytes to the client !! Awful, isn't it :(
585
// The right way is to "RMIze" InputStream, or what ??
586
InputStream s = jdbcResultSet_.getUnicodeStream(columnName);
587       return RJSerializer.toByteArray(s);
588 /** Proposed by P.Hearty
589         return getBytesFromInputStream (s);
590 **/

591   } catch(IOException e) {
592       throw new java.rmi.RemoteException JavaDoc(
593        "RJResultSetServer::getUnicodeStream()", e);
594     }
595   }
596
597     /**
598      * A column value can be retrieved as a stream of uninterpreted bytes
599      * and then read in chunks from the stream. This method is particularly
600      * suitable for retrieving large LONGVARBINARY values.
601      *
602      * <P><B>Note:</B> All the data in the returned stream must
603      * be read prior to getting the value of any other column. The
604      * next call to a get method implicitly closes the stream.
605      *
606      * @param columnName is the SQL name of the column
607      * @return a Java input stream that delivers the database column value
608      * as a stream of uninterpreted bytes. If the value is SQL NULL
609      * then the result is null.
610      */

611 // public java.io.InputStream getBinaryStream(String columnName)
612
// TBD: This is a hack: InputStream is not serializable !
613
public byte[] getBinaryStream(String JavaDoc columnName)
614   throws RemoteException, SQLException {
615     try {
616       // I read the whole InputStream into a StringBuffer, then send the
617
// StringBuffer's bytes to the client !! Awful, isn't it :(
618
// The right way is to "RMIze" InputStream, or what ??
619
InputStream s = jdbcResultSet_.getBinaryStream(columnName);
620       return RJSerializer.toByteArray(s);
621 /** Proposed by P.Hearty
622         return getBytesFromInputStream (s);
623 **/

624     } catch(IOException e) {
625       throw new java.rmi.RemoteException JavaDoc(
626        "RJResultSetServer::getBinaryStream()", e);
627     }
628   }
629
630
631     //=====================================================================
632
// Advanced features:
633
//=====================================================================
634

635     /**
636      * <p>The first warning reported by calls on this ResultSet is
637      * returned. Subsequent ResultSet warnings will be chained to this
638      * SQLWarning.
639      *
640      * <P>The warning chain is automatically cleared each time a new
641      * row is read.
642      *
643      * <P><B>Note:</B> This warning chain only covers warnings caused
644      * by ResultSet methods. Any warning caused by statement methods
645      * (such as reading OUT parameters) will be chained on the
646      * Statement object.
647      *
648      * @return the first SQLWarning or null
649      */

650   public SQLWarning getWarnings() throws RemoteException, SQLException {
651     return jdbcResultSet_.getWarnings();
652   }
653
654     /**
655      * After this call getWarnings returns null until a new warning is
656      * reported for this ResultSet.
657      */

658   public void clearWarnings() throws RemoteException, SQLException {
659     jdbcResultSet_.clearWarnings();
660   }
661
662     /**
663      * Get the name of the SQL cursor used by this ResultSet.
664      *
665      * <P>In SQL, a result table is retrieved through a cursor that is
666      * named. The current row of a result can be updated or deleted
667      * using a positioned update/delete statement that references the
668      * cursor name.
669      *
670      * <P>JDBC supports this SQL feature by providing the name of the
671      * SQL cursor used by a ResultSet. The current row of a ResultSet
672      * is also the current row of this SQL cursor.
673      *
674      * <P><B>Note:</B> If positioned update is not supported a
675      * java.rmi.RemoteException is thrown
676      *
677      * @return the ResultSet's SQL cursor name
678      */

679   public String JavaDoc getCursorName() throws RemoteException, SQLException {
680     return jdbcResultSet_.getCursorName();
681   }
682
683     /**
684      * The number, types and properties of a ResultSet's columns
685      * are provided by the getMetaData method.
686      *
687      * @return the description of a ResultSet's columns
688      */

689   public RJResultSetMetaDataInterface getMetaData()
690   throws RemoteException, SQLException {
691     return new RJResultSetMetaDataServer(jdbcResultSet_.getMetaData());
692   }
693
694     /**
695      * <p>Get the value of a column in the current row as a Java object.
696      *
697      * <p>This method will return the value of the given column as a
698      * Java object. The type of the Java object will be the default
699      * Java Object type corresponding to the column's SQL type,
700      * following the mapping specified in the JDBC spec.
701      *
702      * <p>This method may also be used to read datatabase specific abstract
703      * data types.
704      *
705      * @param columnIndex the first column is 1, the second is 2, ...
706      * @return A java.lang.Object holding the column value.
707      */

708   public Object JavaDoc getObject(int columnIndex)
709   throws RemoteException, SQLException {
710     return jdbcResultSet_.getObject(columnIndex);
711   }
712
713     /**
714      * <p>Get the value of a column in the current row as a Java object.
715      *
716      * <p>This method will return the value of the given column as a
717      * Java object. The type of the Java object will be the default
718      * Java Object type corresponding to the column's SQL type,
719      * following the mapping specified in the JDBC spec.
720      *
721      * <p>This method may also be used to read datatabase specific abstract
722      * data types.
723      *
724      * @param columnName is the SQL name of the column
725      * @return A java.lang.Object holding the column value.
726      */

727   public Object JavaDoc getObject(String JavaDoc columnName)
728   throws RemoteException, SQLException {
729     return jdbcResultSet_.getObject(columnName);
730   }
731
732     //----------------------------------------------------------------
733

734     /**
735      * Map a Resultset column name to a ResultSet column index.
736      *
737      * @param columnName the name of the column
738      * @return the column index
739      */

740
741   public int findColumn(String JavaDoc columnName)
742   throws RemoteException, SQLException {
743     return jdbcResultSet_.findColumn(columnName);
744   }
745
746
747
748 // JDBC 2.0 methods
749
// Implementation added Aug 2000 by Peter Hearty (peter.hearty@lutris.com).
750

751 public void updateTimestamp(String JavaDoc columnName,
752                             Timestamp x) throws RemoteException, SQLException
753   {
754       jdbcResultSet_.updateTimestamp(columnName,x);
755   }
756
757 public void updateTimestamp(int columnIndex,Timestamp x) throws RemoteException, SQLException
758   {
759       jdbcResultSet_.updateTimestamp(columnIndex,x);
760   }
761
762 public void updateTime(String JavaDoc columnName,Time x) throws RemoteException, SQLException
763   {
764       jdbcResultSet_.updateTime(columnName,x);
765   }
766
767
768 public void updateTime(int columnIndex,
769                        Time x) throws RemoteException, SQLException
770   {
771       jdbcResultSet_.updateTime(columnIndex,x);
772   }
773
774   public void updateString(String JavaDoc columnName,
775   String JavaDoc x) throws RemoteException, SQLException {
776     jdbcResultSet_.updateString(columnName,x);
777   }
778
779   public void updateString(int columnIndex,
780   String JavaDoc x) throws RemoteException, SQLException {
781     jdbcResultSet_.updateString(columnIndex,x);
782   }
783
784 public void updateShort(int columnIndex,
785                         short x) throws RemoteException, SQLException
786   {
787       jdbcResultSet_.updateShort(columnIndex,x);
788   }
789
790 public void updateShort(String JavaDoc columnName,
791                         short x) throws RemoteException, SQLException
792   {
793       jdbcResultSet_.updateShort(columnName,x);
794   }
795
796 public void updateRow() throws RemoteException, SQLException
797   {
798       jdbcResultSet_.updateRow();
799   }
800
801 public void updateObject(String JavaDoc columnName,
802                          Object JavaDoc x,
803                          int scale) throws RemoteException, SQLException
804   {
805       jdbcResultSet_.updateObject(columnName,x,scale);
806   }
807
808 public void updateObject(String JavaDoc columnName,
809                          Object JavaDoc x) throws RemoteException, SQLException
810   {
811       jdbcResultSet_.updateObject(columnName,x);
812   }
813
814 public void updateObject(int columnIndex,
815                          Object JavaDoc x,
816                          int scale) throws RemoteException, SQLException
817   {
818       jdbcResultSet_.updateObject(columnIndex,x,scale);
819   }
820
821 public void updateObject(int columnIndex,
822                          Object JavaDoc x) throws RemoteException, SQLException
823   {
824       jdbcResultSet_.updateObject(columnIndex,x);
825   }
826
827 public void updateNull(String JavaDoc columnName) throws RemoteException, SQLException
828   {
829       jdbcResultSet_.updateNull(columnName);
830   }
831
832 public void updateNull(int columnIndex) throws RemoteException, SQLException
833   {
834       jdbcResultSet_.updateNull(columnIndex);
835   }
836
837 public void updateLong(String JavaDoc columnName,
838                        long x) throws RemoteException, SQLException
839   {
840       jdbcResultSet_.updateLong(columnName,x);
841   }
842
843 public void updateLong(int columnIndex,
844                        long x) throws RemoteException, SQLException
845   {
846       jdbcResultSet_.updateLong(columnIndex,x);
847   }
848
849 public void updateInt(String JavaDoc columnName,
850                       int x) throws RemoteException, SQLException
851   {
852       jdbcResultSet_.updateInt(columnName,x);
853   }
854
855 public void updateInt(int columnIndex,
856                       int x) throws RemoteException, SQLException
857   {
858       jdbcResultSet_.updateInt(columnIndex,x);
859   }
860
861 public void updateFloat(String JavaDoc columnName,
862                         float x) throws RemoteException, SQLException
863   {
864       jdbcResultSet_.updateFloat(columnName,x);
865   }
866
867 public void updateFloat(int columnIndex,
868                         float x) throws RemoteException, SQLException
869   {
870       jdbcResultSet_.updateFloat(columnIndex,x);
871   }
872
873 public void updateDouble(String JavaDoc columnName,
874                          double x) throws RemoteException, SQLException
875   {
876       jdbcResultSet_.updateDouble(columnName,x);
877   }
878
879 public void updateDouble(int columnIndex,
880                          double x) throws RemoteException, SQLException
881   {
882       jdbcResultSet_.updateDouble(columnIndex,x);
883   }
884
885 public void updateDate(String JavaDoc columnName,
886                        Date x) throws RemoteException, SQLException
887   {
888       jdbcResultSet_.updateDate(columnName,x);
889   }
890
891 public void updateDate(int columnIndex,
892                        Date x) throws RemoteException, SQLException
893   {
894       jdbcResultSet_.updateDate(columnIndex,x);
895   }
896
897 public void updateCharacterStream(String JavaDoc columnName,
898                                   java.io.Reader JavaDoc reader,
899                                   int length) throws RemoteException, SQLException
900   {
901       jdbcResultSet_.updateCharacterStream(columnName,reader,length);
902   }
903
904 public void updateCharacterStream(int columnIndex,
905                                   java.io.Reader JavaDoc x,
906                                   int length) throws RemoteException, SQLException
907   {
908       jdbcResultSet_.updateCharacterStream(columnIndex,x,length);
909   }
910
911
912 public void updateBytes(String JavaDoc columnName,
913                         byte[] x) throws RemoteException, SQLException
914   {
915       jdbcResultSet_.updateBytes(columnName,x);
916   }
917
918
919 public void updateBytes(int columnIndex,
920                         byte[] x) throws RemoteException, SQLException
921   {
922       jdbcResultSet_.updateBytes(columnIndex,x);
923   }
924
925
926 public void updateByte(String JavaDoc columnName,
927                        byte x) throws RemoteException, SQLException
928   {
929       jdbcResultSet_.updateByte(columnName,x);
930   }
931
932 public void updateByte(int columnIndex,
933                        byte x) throws RemoteException, SQLException
934   {
935       jdbcResultSet_.updateByte(columnIndex,x);
936   }
937
938 public void updateBoolean(String JavaDoc columnName,
939                           boolean x) throws RemoteException, SQLException
940   {
941       jdbcResultSet_.updateBoolean(columnName,x);
942   }
943
944 public void updateBoolean(int columnIndex,
945                           boolean x) throws RemoteException, SQLException
946   {
947       jdbcResultSet_.updateBoolean(columnIndex,x);
948   }
949
950
951 public void updateBinaryStream(String JavaDoc columnName,
952                                java.io.InputStream JavaDoc x,
953                                int length) throws RemoteException, SQLException
954   {
955       jdbcResultSet_.updateBinaryStream(columnName,x,length);
956   }
957
958
959 public void updateBinaryStream(int columnIndex,
960                                java.io.InputStream JavaDoc x,
961                                int length) throws RemoteException, SQLException
962   {
963       jdbcResultSet_.updateBinaryStream(columnIndex,x,length);
964   }
965
966
967 public void updateBigDecimal(String JavaDoc columnName,
968                              BigDecimal JavaDoc x) throws RemoteException, SQLException
969   {
970       jdbcResultSet_.updateBigDecimal(columnName,x);
971   }
972
973
974 public void updateBigDecimal(int columnIndex,
975                              BigDecimal JavaDoc x) throws RemoteException, SQLException
976   {
977       jdbcResultSet_.updateBigDecimal(columnIndex,x);
978   }
979
980
981 public void updateAsciiStream(String JavaDoc columnName,
982                               java.io.InputStream JavaDoc x,
983                               int length) throws RemoteException, SQLException
984   {
985       jdbcResultSet_.updateAsciiStream(columnName,x,length);
986   }
987
988
989 public void updateAsciiStream(int columnIndex,
990                               java.io.InputStream JavaDoc x,
991                               int length) throws RemoteException, SQLException
992   {
993       jdbcResultSet_.updateAsciiStream(columnIndex,x,length);
994   }
995
996 public void setFetchSize(int rows) throws RemoteException, SQLException
997   {
998       jdbcResultSet_.setFetchSize(rows);
999   }
1000
1001public void setFetchDirection(int direction) throws RemoteException, SQLException
1002  {
1003      jdbcResultSet_.setFetchDirection(direction);
1004  }
1005
1006public boolean rowUpdated() throws RemoteException, SQLException
1007  {
1008      return jdbcResultSet_.rowUpdated();
1009  }
1010
1011public boolean rowInserted() throws RemoteException, SQLException
1012  {
1013      return jdbcResultSet_.rowInserted();
1014  }
1015
1016public boolean rowDeleted() throws RemoteException, SQLException
1017  {
1018      return jdbcResultSet_.rowDeleted();
1019  }
1020
1021public boolean relative(int rows) throws RemoteException, SQLException
1022  {
1023      return jdbcResultSet_.relative(rows);
1024  }
1025
1026public void refreshRow() throws RemoteException, SQLException
1027  {
1028      jdbcResultSet_.refreshRow();
1029  }
1030
1031public boolean previous() throws RemoteException, SQLException
1032  {
1033      return jdbcResultSet_.previous();
1034  }
1035
1036public void moveToInsertRow() throws RemoteException, SQLException
1037  {
1038      jdbcResultSet_.moveToInsertRow();
1039  }
1040
1041public void moveToCurrentRow() throws RemoteException, SQLException
1042  {
1043      jdbcResultSet_.moveToCurrentRow();
1044  }
1045
1046public boolean last() throws RemoteException, SQLException
1047  {
1048      return jdbcResultSet_.last();
1049  }
1050
1051public boolean isLast() throws RemoteException, SQLException
1052  {
1053      return jdbcResultSet_.isLast();
1054  }
1055
1056public boolean isFirst() throws RemoteException, SQLException
1057  {
1058      return jdbcResultSet_.isFirst();
1059  }
1060
1061public boolean isBeforeFirst() throws RemoteException, SQLException
1062  {
1063      return jdbcResultSet_.isBeforeFirst();
1064  }
1065
1066public boolean isAfterLast() throws RemoteException, SQLException
1067  {
1068      return jdbcResultSet_.isAfterLast();
1069  }
1070
1071  public void insertRow() throws RemoteException, SQLException {
1072      jdbcResultSet_.insertRow();
1073  }
1074
1075public int getType() throws RemoteException, SQLException
1076  {
1077      return jdbcResultSet_.getType();
1078  }
1079
1080public Timestamp getTimestamp(String JavaDoc columnName,
1081                              java.util.Calendar JavaDoc cal) throws RemoteException, SQLException
1082  {
1083      return jdbcResultSet_.getTimestamp(columnName,cal);
1084  }
1085
1086public Timestamp getTimestamp(int columnIndex,
1087                              java.util.Calendar JavaDoc cal) throws RemoteException, SQLException
1088  {
1089      return jdbcResultSet_.getTimestamp(columnIndex,cal);
1090  }
1091
1092  public Time getTime(String JavaDoc columnName, java.util.Calendar JavaDoc cal)
1093  throws RemoteException, SQLException {
1094      return jdbcResultSet_.getTime(columnName,cal);
1095  }
1096
1097  public Time getTime(int columnIndex, java.util.Calendar JavaDoc cal)
1098  throws RemoteException, SQLException {
1099      return jdbcResultSet_.getTime(columnIndex,cal);
1100  }
1101
1102  public RJStatementInterface getStatement()
1103  throws RemoteException, SQLException {
1104    return new RJStatementServer(jdbcResultSet_.getStatement());
1105  }
1106
1107
1108  public RJRefInterface getRef(String JavaDoc colName)
1109  throws RemoteException, SQLException {
1110    return new RJRefServer(jdbcResultSet_.getRef(colName));
1111  }
1112
1113  public RJRefInterface getRef(int i) throws RemoteException, SQLException {
1114    return new RJRefServer(jdbcResultSet_.getRef(i));
1115  }
1116
1117  public Object JavaDoc getObject(String JavaDoc colName, java.util.Map JavaDoc map)
1118  throws RemoteException, SQLException {
1119      return jdbcResultSet_.getObject(colName,map);
1120  }
1121
1122  public Object JavaDoc getObject(int i, java.util.Map JavaDoc map)
1123  throws RemoteException, SQLException {
1124      return jdbcResultSet_.getObject(i,map) ;
1125  }
1126
1127  public int getFetchSize() throws RemoteException, SQLException {
1128      return jdbcResultSet_.getFetchSize();
1129  }
1130
1131  public int getFetchDirection() throws RemoteException, SQLException {
1132      return jdbcResultSet_.getFetchDirection();
1133  }
1134
1135  public Date getDate(String JavaDoc columnName, java.util.Calendar JavaDoc cal)
1136  throws RemoteException, SQLException {
1137      return jdbcResultSet_.getDate(columnName,cal);
1138  }
1139
1140  public Date getDate(int columnIndex, java.util.Calendar JavaDoc cal)
1141  throws RemoteException, SQLException {
1142      return jdbcResultSet_.getDate(columnIndex,cal);
1143  }
1144
1145  public int getConcurrency() throws RemoteException, SQLException {
1146      return jdbcResultSet_.getConcurrency();
1147  }
1148
1149  public RJClobInterface getClob(String JavaDoc colName)
1150  throws RemoteException, SQLException {
1151    return new RJClobServer(jdbcResultSet_.getClob(colName));
1152  }
1153
1154  public RJClobInterface getClob(int i) throws RemoteException, SQLException {
1155    return new RJClobServer(jdbcResultSet_.getClob(i));
1156  }
1157
1158  // TBD serialization pb ??
1159
public java.io.Reader JavaDoc getCharacterStream(String JavaDoc columnName)
1160  throws RemoteException, SQLException {
1161      return jdbcResultSet_.getCharacterStream(columnName);
1162  }
1163
1164  // TBD serialization pb ??
1165
public java.io.Reader JavaDoc getCharacterStream(int columnIndex)
1166  throws RemoteException, SQLException {
1167      return jdbcResultSet_.getCharacterStream(columnIndex);
1168  }
1169
1170  public RJBlobInterface getBlob(String JavaDoc colName)
1171  throws RemoteException, SQLException {
1172    return new RJBlobServer(jdbcResultSet_.getBlob(colName));
1173  }
1174
1175  public RJBlobInterface getBlob(int i) throws RemoteException, SQLException {
1176    return new RJBlobServer(jdbcResultSet_.getBlob(i));
1177  }
1178
1179  public BigDecimal JavaDoc getBigDecimal(String JavaDoc columnName)
1180  throws RemoteException, SQLException {
1181      return jdbcResultSet_.getBigDecimal(columnName);
1182  }
1183
1184  public BigDecimal JavaDoc getBigDecimal(int columnIndex)
1185  throws RemoteException, SQLException {
1186      return jdbcResultSet_.getBigDecimal(columnIndex);
1187  }
1188
1189  public RJArrayInterface getArray(String JavaDoc colName)
1190  throws RemoteException, SQLException {
1191    return new RJArrayServer(jdbcResultSet_.getArray(colName));
1192  }
1193
1194  public RJArrayInterface getArray(int i) throws RemoteException, SQLException {
1195    return new RJArrayServer(jdbcResultSet_.getArray(i));
1196  }
1197
1198  public boolean first() throws RemoteException, SQLException {
1199      return jdbcResultSet_.first();
1200  }
1201
1202  public void cancelRowUpdates() throws RemoteException, SQLException {
1203      jdbcResultSet_.cancelRowUpdates();
1204  }
1205
1206  public void deleteRow() throws RemoteException, SQLException {
1207      jdbcResultSet_.deleteRow();
1208  }
1209
1210  public void beforeFirst() throws RemoteException, SQLException {
1211      jdbcResultSet_.beforeFirst();
1212  }
1213
1214  public void afterLast() throws RemoteException, SQLException {
1215      jdbcResultSet_.afterLast();
1216  }
1217
1218  public boolean absolute(int row) throws RemoteException, SQLException {
1219      return jdbcResultSet_.absolute(row);
1220  }
1221
1222  public int getRow() throws RemoteException, SQLException {
1223      return jdbcResultSet_.getRow();
1224  }
1225
1226    //-------------------------- JDBC 3.0 ----------------------------------------
1227

1228  public java.net.URL JavaDoc getURL(int columnIndex) throws RemoteException, SQLException {
1229    return jdbcResultSet_.getURL(columnIndex);
1230  }
1231
1232  public java.net.URL JavaDoc getURL(String JavaDoc columnName) throws RemoteException, SQLException {
1233    return jdbcResultSet_.getURL(columnName);
1234  }
1235
1236public void updateRef(int columnIndex, java.sql.Ref JavaDoc x) throws RemoteException, SQLException
1237{
1238    jdbcResultSet_.updateRef(columnIndex, x);
1239}
1240
1241public void updateRef(String JavaDoc columnName, java.sql.Ref JavaDoc x) throws RemoteException, SQLException
1242{
1243    jdbcResultSet_.updateRef(columnName, x);
1244}
1245
1246public void updateBlob(int columnIndex, java.sql.Blob JavaDoc x) throws RemoteException, SQLException
1247{
1248    jdbcResultSet_.updateBlob(columnIndex, x);
1249}
1250
1251public void updateBlob(String JavaDoc columnName, java.sql.Blob JavaDoc x) throws RemoteException, SQLException
1252{
1253    jdbcResultSet_.updateBlob(columnName, x);
1254}
1255
1256public void updateClob(int columnIndex, java.sql.Clob JavaDoc x) throws RemoteException, SQLException
1257{
1258    jdbcResultSet_.updateClob(columnIndex, x);
1259}
1260
1261public void updateClob(String JavaDoc columnName, java.sql.Clob JavaDoc x) throws RemoteException, SQLException
1262{
1263    jdbcResultSet_.updateClob(columnName, x);
1264}
1265
1266public void updateArray(int columnIndex, java.sql.Array JavaDoc x) throws RemoteException, SQLException
1267{
1268    jdbcResultSet_.updateArray(columnIndex, x);
1269}
1270
1271public void updateArray(String JavaDoc columnName, java.sql.Array JavaDoc x) throws RemoteException, SQLException
1272{
1273    jdbcResultSet_.updateArray(columnName, x);
1274}
1275  
1276};
1277
1278
Popular Tags