001    // Copyright (c) 2001 Hursh Jain (http://www.mollypages.org) 
002    // The Molly framework is freely distributable under the terms of an
003    // MIT-style license. For details, see the molly pages web site at:
004    // http://www.mollypages.org/. Use, modify, have fun !
005    
006    package fc.jdbc;
007    
008    import java.sql.*;
009    import java.util.*;
010    import java.math.*;
011    import java.io.*;
012    
013    import fc.io.*;
014    import fc.util.*;
015    
016    /**  
017    Wrapper class for a {@link java.sql.ResultSet ResultSet} that allows the
018    value of specified columns to be transformed. Transforms <b>only</b> work
019    the <b><tt>get<u>Object</u>(..)</tt></b> and
020    <b><tt>get<u>String</u>(..)</tt></b> methods, all other get methods return
021    an unmodified result obtained from the underlying result set.
022    
023    @author hursh jain
024    **/
025    
026    public class ResultSetTransform implements ResultSet
027    {
028    static final boolean dbg = false;
029    
030    ResultSet       rs;
031    ResultSetMetaData   rsmd;
032    Map         transformsByIndex;
033    
034    // cache of column names mapped to their index since resultset.findColumn
035    // is probably an expensive operation (we need this later when retrieving
036    // values by column names)
037    Map ColNameIndex; 
038    
039    public ResultSetTransform(ResultSet rs) throws SQLException
040      {
041      Argcheck.notnull(rs, "specified resultset argument was null");
042      this.rs = rs;
043      this.rsmd = rs.getMetaData();
044      transformsByIndex = new HashMap();
045      ColNameIndex = new HashMap(); 
046      }
047    
048    /** 
049    Adds a transform rule for the specified column. When this column's
050    data is later retrieved via the {@link getObject(int)} or the
051    {@link getString(int)} methods, this transform rule will be invoked.
052    (note, the transform rule is not invoked for other <tt>getXXX(..)</tt>
053    methods).
054    **/   
055    public void addColumnTransform(int columnIndex, Rule rule) 
056    throws SQLException
057      {
058      Argcheck.istrue(columnIndex > 0, "column index must be greater than zero");
059      Argcheck.notnull(rule, "specified rule cannot be null");
060      if (dbg) System.out.println("ResultSetTransform: addColumnTransform("+columnIndex+","+rule+")");
061      transformsByIndex.put(new Integer(columnIndex), rule);
062      }
063    
064    /** 
065    Adds a transform rule for the specified column. When this column's
066    data is later retrieved via the {@link getObject(int)} or the
067    {@link getString(int)} methods, this transform rule will be invoked.
068    (note, the transform rule is not invoked for other <tt>getXXX(..)</tt>
069    methods).
070    
071    @throws SQLException  if the specified column name was not
072                found in the result set or if some other
073                underlying SQL error occurs
074    **/   
075    public void addColumnTransform(String columnName, Rule rule) 
076    throws SQLException
077      {
078      Argcheck.notnull(columnName, "column name must not be null");
079      Argcheck.notnull(rule, "specified rule cannot be null");
080      if (dbg) System.out.println("ResultSetTransform: addColumnTransform('"+columnName+"',"+rule+")");
081        
082        Integer index = new Integer(rs.findColumn(columnName));
083        if (dbg) System.out.println("'" + columnName + "' is located at column:" + index);
084        ColNameIndex.put(columnName, index);
085        transformsByIndex.put(index, rule);
086      }
087    
088    /** 
089    A transform rule, added to a specific column index or name via
090    the {@link addColumnTransform} methods. To instantiate this
091    class, use the <tt>foo.new Rule()</tt> syntax, where foo is
092    an instance of the outer ResultSetTransform class.
093    **/
094    public abstract class Rule {
095      /** Should modify the given column value as needed. **/
096        protected abstract Object transform(int columnIndex, Object value);
097      public ResultSet getResultSet() { return rs; }
098      public ResultSetMetaData getMetaData() { return rsmd; }
099      }
100      
101    Object applyRule(Integer key, Object value) 
102      {
103      if (dbg) System.out.println("Enter: applyRule("+key+","+value+"), Transforms: " + transformsByIndex);
104    
105      if (transformsByIndex.containsKey(key)) {
106        Rule r = (Rule) transformsByIndex.get(key);
107        return r.transform(key.intValue(), value);
108        }
109      else  {
110        return value;
111        }
112      }
113    
114    public static void main(String[] args) throws Exception
115      {
116      String propfile = "./ConnectionMgrTestProps.txt";
117    
118      Args myargs = new Args(args);
119      myargs.setUsage("java fc.jdbc.ResultSetTransform -query query-to-execute -colname columnName");
120    
121      String  query  = myargs.getRequired("query");
122      String  colname = myargs.getRequired("colname");
123      SimpleConnectionMgr cmgr = 
124          new SimpleConnectionMgr( 
125            new FilePropertyMgr(new File(propfile)));
126    
127      ResultSet rs = cmgr.getConnection().createStatement().executeQuery(query);  
128    
129      ResultSetTransform rst = new ResultSetTransform(rs);  
130      Rule r = rst.new Rule() {
131        public Object transform(int index, Object v) {
132          return "transformed[col("+index+")]: " + v;
133          }
134        };
135      
136      rst.addColumnTransform(colname, r);
137      QueryUtil.printResultSetTable(rst, System.out);
138      }
139      
140    //== WRAPPED AND OVERRIDDEN =======================================
141    
142    public Object getObject(int columnIndex) throws SQLException
143      {
144      Integer key =  new Integer(columnIndex);
145      return applyRule(key, rs.getObject(columnIndex));
146      }
147          
148    public Object getObject(String columnName) throws SQLException
149      {
150      Integer key = (Integer) ColNameIndex.get(columnName); //null ok, will passthru
151      return applyRule(key, rs.getObject(columnName));
152      } 
153    
154    public String getString(int columnIndex) throws SQLException 
155      { 
156      Integer key =  new Integer(columnIndex);
157      //cast works for null values too
158      String result = (String) applyRule(key, rs.getString(columnIndex));
159      return result; 
160      }
161      
162    public String getString(String columnName) throws SQLException 
163      {
164      //cast works for null values too
165      Integer key = (Integer) ColNameIndex.get(columnName); //null ok, will passthru
166      String result = (String) applyRule(key, rs.getString(columnName));
167      return result;
168      }
169    
170    
171    //== WRAPPED AND PASSTHRU ========================================
172    
173    public boolean getBoolean(int columnIndex) throws SQLException { return rs.getBoolean(columnIndex); }
174    public byte getByte(int columnIndex) throws SQLException { return rs.getByte(columnIndex); }
175    public short getShort(int columnIndex) throws SQLException { return rs.getShort(columnIndex); }
176    public int getInt(int columnIndex) throws SQLException { return rs.getInt(columnIndex); }
177    public long getLong(int columnIndex) throws SQLException { return rs.getLong(columnIndex); }
178    public float getFloat(int columnIndex) throws SQLException { return rs.getFloat(columnIndex); }
179    public double getDouble(int columnIndex) throws SQLException { return rs.getDouble(columnIndex); }
180    public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { return rs.getBigDecimal(columnIndex, scale); }
181    public byte[] getBytes(int columnIndex) throws SQLException { return rs.getBytes(columnIndex); }
182    public java.sql.Date getDate(int columnIndex) throws SQLException { return rs.getDate(columnIndex); }
183    public java.sql.Time getTime(int columnIndex) throws SQLException { return rs.getTime(columnIndex); }
184    public java.sql.Timestamp getTimestamp(int columnIndex) throws SQLException { return rs.getTimestamp(columnIndex); }
185    public java.io.InputStream getAsciiStream(int columnIndex) throws SQLException { return rs.getAsciiStream(columnIndex); }
186    public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException { return rs.getUnicodeStream(columnIndex); }
187    public java.io.InputStream getBinaryStream(int columnIndex) throws SQLException { return rs.getBinaryStream(columnIndex); }
188    //======================================================================
189    // Methods for accessing results by column name
190    //======================================================================
191    public boolean getBoolean(String columnName) throws SQLException { return rs.getBoolean(columnName); }
192    public byte getByte(String columnName) throws SQLException { return rs.getByte(columnName); }
193    public short getShort(String columnName) throws SQLException { return rs.getShort(columnName); }
194    public int getInt(String columnName) throws SQLException { return rs.getInt(columnName); }
195    public long getLong(String columnName) throws SQLException { return rs.getLong(columnName); }
196    public float getFloat(String columnName) throws SQLException { return rs.getFloat(columnName); }
197    public double getDouble(String columnName) throws SQLException { return rs.getDouble(columnName); }
198    public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException { return rs.getBigDecimal(columnName, scale); }
199    public byte[] getBytes(String columnName) throws SQLException { return rs.getBytes(columnName); }
200    public java.sql.Date getDate(String columnName) throws SQLException { return rs.getDate(columnName); }
201    public java.sql.Time getTime(String columnName) throws SQLException { return rs.getTime(columnName); }
202    public java.sql.Timestamp getTimestamp(String columnName) throws SQLException { return rs.getTimestamp(columnName); }
203    public java.io.InputStream getAsciiStream(String columnName) throws SQLException { return rs.getAsciiStream(columnName); }
204    public java.io.InputStream getUnicodeStream(String columnName) throws SQLException { return rs.getUnicodeStream(columnName); }
205    public java.io.InputStream getBinaryStream(String columnName) throws SQLException { return rs.getBinaryStream(columnName); }
206    public boolean next() throws SQLException { return rs.next(); }
207    public void close() throws SQLException { rs.close(); }
208    public boolean wasNull() throws SQLException { return rs.wasNull(); }
209    //=====================================================================
210    // Advanced features:
211    //=====================================================================
212    public SQLWarning getWarnings() throws SQLException { return rs.getWarnings(); }
213    public void clearWarnings() throws SQLException { rs.clearWarnings(); }
214    public String getCursorName() throws SQLException { return rs.getCursorName(); }
215    public ResultSetMetaData getMetaData() throws SQLException { return rs.getMetaData(); }
216    //----------------------------------------------------------------
217    public int findColumn(String columnName) throws SQLException { return rs.findColumn(columnName); }
218    //--------------------------JDBC 2.0-----------------------------------
219    //---------------------------------------------------------------------
220    // Getters and Setters
221    //---------------------------------------------------------------------
222    public java.io.Reader getCharacterStream(int columnIndex) throws SQLException { return rs.getCharacterStream(columnIndex); }
223    public java.io.Reader getCharacterStream(String columnName) throws SQLException { return rs.getCharacterStream(columnName); }
224    public BigDecimal getBigDecimal(int columnIndex) throws SQLException { return rs.getBigDecimal(columnIndex); }
225    public BigDecimal getBigDecimal(String columnName) throws SQLException { return rs.getBigDecimal(columnName); }
226    //---------------------------------------------------------------------
227    // Traversal/Positioning
228    //---------------------------------------------------------------------
229    public boolean isBeforeFirst() throws SQLException { return rs.isBeforeFirst(); }
230    public boolean isAfterLast() throws SQLException { return rs.isAfterLast(); }
231    public boolean isFirst() throws SQLException { return rs.isFirst(); }
232    public boolean isLast() throws SQLException { return rs.isLast(); }
233    public void beforeFirst() throws SQLException { rs.beforeFirst(); }
234    public void afterLast() throws SQLException { rs.afterLast(); }
235    public boolean first() throws SQLException { return rs.first(); }
236    public boolean last() throws SQLException { return rs.last(); }
237    public int getRow() throws SQLException { return rs.getRow(); }
238    public boolean absolute( int row ) throws SQLException { return rs.absolute(row); }
239    public boolean relative( int rows ) throws SQLException { return rs.relative(rows); }
240    public boolean previous() throws SQLException { return rs.previous(); }
241    //---------------------------------------------------------------------
242    // Properties
243    //---------------------------------------------------------------------
244    public void setFetchDirection(int direction) throws SQLException { rs.setFetchDirection(direction); }
245    public int getFetchDirection() throws SQLException { return rs.getFetchDirection(); }
246    public void setFetchSize(int rows) throws SQLException { rs.setFetchSize(rows); }
247    public int getFetchSize() throws SQLException { return rs.getFetchSize(); }
248    public int getType() throws SQLException { return rs.getType(); }
249    public int getConcurrency() throws SQLException { return rs.getConcurrency(); }
250    //---------------------------------------------------------------------
251    // Updates
252    //---------------------------------------------------------------------
253    public boolean rowUpdated() throws SQLException { return rs.rowUpdated(); }
254    public boolean rowInserted() throws SQLException { return rs.rowInserted(); }
255    public boolean rowDeleted() throws SQLException { return rs.rowDeleted(); }
256    public void updateNull(int columnIndex) throws SQLException { rs.updateNull(columnIndex); }  
257    public void updateBoolean(int columnIndex, boolean x) throws SQLException { rs.updateBoolean(columnIndex, x); }
258    public void updateByte(int columnIndex, byte x) throws SQLException { rs.updateByte(columnIndex, x); }
259    public void updateShort(int columnIndex, short x) throws SQLException { rs.updateShort(columnIndex, x); }
260    public void updateInt(int columnIndex, int x) throws SQLException { rs.updateInt(columnIndex, x); }
261    public void updateLong(int columnIndex, long x) throws SQLException { rs.updateLong(columnIndex, x); }
262    public void updateFloat(int columnIndex, float x) throws SQLException { rs.updateFloat(columnIndex, x); }
263    public void updateDouble(int columnIndex, double x) throws SQLException { rs.updateDouble(columnIndex, x); }
264    public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException { rs.updateBigDecimal(columnIndex, x); }
265    public void updateString(int columnIndex, String x) throws SQLException { rs.updateString(columnIndex, x); }
266    public void updateBytes(int columnIndex, byte x[]) throws SQLException { rs.updateBytes(columnIndex, x); }
267    public void updateDate(int columnIndex, java.sql.Date x) throws SQLException { rs.updateDate(columnIndex, x); }
268    public void updateTime(int columnIndex, java.sql.Time x) throws SQLException { rs.updateTime(columnIndex, x); }
269    public void updateTimestamp(int columnIndex, java.sql.Timestamp x) throws SQLException { rs.updateTimestamp(columnIndex, x); }
270    public void updateAsciiStream(int columnIndex, java.io.InputStream x, int length) throws SQLException { rs.updateAsciiStream(columnIndex, x, length); }
271    public void updateBinaryStream(int columnIndex, java.io.InputStream x,int length) throws SQLException { rs.updateBinaryStream(columnIndex, x, length); }
272    public void updateCharacterStream(int columnIndex,java.io.Reader x,int length) throws SQLException { rs.updateCharacterStream(columnIndex, x, length); }
273    public void updateObject(int columnIndex, Object x, int scale) throws SQLException { rs.updateObject(columnIndex, x, scale); }
274    public void updateObject(int columnIndex, Object x) throws SQLException { rs.updateObject(columnIndex, x); }
275    public void updateNull(String columnName) throws SQLException { rs.updateNull(columnName); }  
276    public void updateBoolean(String columnName, boolean x) throws SQLException { rs.updateBoolean(columnName, x); }
277    public void updateByte(String columnName, byte x) throws SQLException { rs.updateByte(columnName, x); }
278    public void updateShort(String columnName, short x) throws SQLException { rs.updateShort(columnName, x); }
279    public void updateInt(String columnName, int x) throws SQLException { rs.updateInt(columnName, x); }
280    public void updateLong(String columnName, long x) throws SQLException { rs.updateLong(columnName, x); }
281    public void updateFloat(String columnName, float x) throws SQLException { rs.updateFloat(columnName, x); }
282    public void updateDouble(String columnName, double x) throws SQLException { rs.updateDouble(columnName, x); }
283    public void updateBigDecimal(String columnName, BigDecimal x) throws SQLException { rs.updateBigDecimal(columnName, x); }
284    public void updateString(String columnName, String x) throws SQLException { rs.updateString(columnName, x); }
285    public void updateBytes(String columnName, byte x[]) throws SQLException { rs.updateBytes(columnName, x); }
286    public void updateDate(String columnName, java.sql.Date x) throws SQLException { rs.updateDate(columnName, x); }
287    public void updateTime(String columnName, java.sql.Time x) throws SQLException { rs.updateTime(columnName, x); }
288    public void updateTimestamp(String columnName, java.sql.Timestamp x) throws SQLException { rs.updateTimestamp(columnName, x); }
289    public void updateAsciiStream(String columnName, java.io.InputStream x, int length) throws SQLException { rs.updateAsciiStream(columnName, x, length); }
290    public void updateBinaryStream(String columnName, java.io.InputStream x,int length) throws SQLException { rs.updateBinaryStream(columnName, x, length); }
291    public void updateCharacterStream(String columnName, java.io.Reader reader,int length) throws SQLException { rs.updateCharacterStream(columnName, reader, length); }
292    public void updateObject(String columnName, Object x, int scale) throws SQLException { rs.updateObject(columnName, x, scale); }
293    public void updateObject(String columnName, Object x) throws SQLException { rs.updateObject(columnName, x); }
294    public void insertRow() throws SQLException { rs.insertRow(); }
295    public void updateRow() throws SQLException { rs.updateRow(); }
296    public void deleteRow() throws SQLException { rs.deleteRow(); }
297    public void refreshRow() throws SQLException { rs.refreshRow(); }
298    public void cancelRowUpdates() throws SQLException { rs.cancelRowUpdates(); }
299    public void moveToInsertRow() throws SQLException { rs.moveToInsertRow(); }
300    public void moveToCurrentRow() throws SQLException { rs.moveToCurrentRow(); }
301    public Statement getStatement() throws SQLException { return rs.getStatement(); }
302    public Object getObject(int i, java.util.Map map) throws SQLException { return rs.getObject(i, map); }
303    public Ref getRef(int i) throws SQLException { return rs.getRef(i); }
304    public Blob getBlob(int i) throws SQLException { return rs.getBlob(i); }
305    public Clob getClob(int i) throws SQLException { return rs.getClob(i); }
306    public Array getArray(int i) throws SQLException { return rs.getArray(i); }
307    public Object getObject(String colName, java.util.Map map) throws SQLException { return rs.getObject(colName, map); }
308    public Ref getRef(String colName) throws SQLException { return rs.getRef(colName); }
309    public Blob getBlob(String colName) throws SQLException { return rs.getBlob(colName); }
310    public Clob getClob(String colName) throws SQLException { return rs.getClob(colName); }
311    public Array getArray(String colName) throws SQLException { return rs.getArray(colName); }
312    public java.sql.Date getDate(int columnIndex, Calendar cal) throws SQLException { return rs.getDate(columnIndex, cal); }
313    public java.sql.Date getDate(String columnName, Calendar cal) throws SQLException { return rs.getDate(columnName, cal); }
314    public java.sql.Time getTime(int columnIndex, Calendar cal) throws SQLException { return rs.getTime(columnIndex, cal); }
315    public java.sql.Time getTime(String columnName, Calendar cal) throws SQLException { return rs.getTime(columnName, cal); }
316    public java.sql.Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException { return rs.getTimestamp(columnIndex, cal); }
317    public java.sql.Timestamp getTimestamp(String columnName, Calendar cal) throws SQLException { return rs.getTimestamp(columnName, cal); }
318    //-------------------------- JDBC 3.0 ----------------------------------------
319    public java.net.URL getURL(int columnIndex) throws SQLException { return rs.getURL(columnIndex); }
320    public java.net.URL getURL(String columnName) throws SQLException { return rs.getURL(columnName); }
321    public void updateRef(int columnIndex, java.sql.Ref x) throws SQLException { rs.updateRef(columnIndex, x); }
322    public void updateRef(String columnName, java.sql.Ref x) throws SQLException { rs.updateRef(columnName, x); }
323    public void updateBlob(int columnIndex, java.sql.Blob x) throws SQLException { rs.updateBlob(columnIndex, x); }
324    public void updateBlob(String columnName, java.sql.Blob x) throws SQLException { rs.updateBlob(columnName, x); }
325    public void updateClob(int columnIndex, java.sql.Clob x) throws SQLException { rs.updateClob(columnIndex, x); }
326    public void updateClob(String columnName, java.sql.Clob x) throws SQLException { rs.updateClob(columnName, x); }
327    public void updateArray(int columnIndex, java.sql.Array x) throws SQLException { rs.updateArray(columnIndex, x); }
328    public void updateArray(String columnName, java.sql.Array x) throws SQLException { rs.updateArray(columnName, x); }
329    //-------------------------- JDBC 4.0 ----------------------------------------
330    public void updateNClob(String columnName, java.io.Reader r) throws SQLException { rs.updateNClob(columnName, r); }
331    public void updateNClob(int columnIndex, java.io.Reader r) throws SQLException {  rs.updateNClob(columnIndex, r); }
332    public void updateNClob(String columnName, java.io.Reader r, long l) throws SQLException { rs.updateNClob(columnName, r, l); }
333    public void updateNClob(int columnIndex, java.io.Reader r, long l) throws SQLException {  rs.updateNClob(columnIndex, r, l); }
334    public void updateNClob(String columnName, NClob x) throws SQLException { rs.updateNClob(columnName, x); }
335    public void updateNClob(int columnIndex, NClob x) throws SQLException {   rs.updateNClob(columnIndex, x); }
336    public void updateNString(int columnIndex, String s) throws SQLException { rs.updateNString(columnIndex, s); }
337    public void updateNString(String columnLabel, String s) throws SQLException { rs.updateNString(columnLabel, s); }
338    public void updateClob(String columnName, java.io.Reader r) throws SQLException { rs.updateClob(columnName, r); }
339    public void updateClob(int columnIndex, java.io.Reader r, long l) throws SQLException { rs.updateClob(columnIndex, r); }
340    public void updateClob(String columnName, java.io.Reader r, long l) throws SQLException { rs.updateClob(columnName, r, l); }
341    public void updateClob(int columnIndex, java.io.Reader r) throws SQLException { rs.updateClob(columnIndex, r); }
342    public void updateBlob(int columnIndex, java.io.InputStream x) throws SQLException { rs.updateBlob(columnIndex, x); }
343    public void updateBlob(String columnName, java.io.InputStream x) throws SQLException { rs.updateBlob(columnName, x); }
344    public void updateBlob(int columnIndex, java.io.InputStream x, long l) throws SQLException { rs.updateBlob(columnIndex, x, l); }
345    public void updateBlob(String columnName, java.io.InputStream x, long l) throws SQLException { rs.updateBlob(columnName, x, l); }
346    public void updateCharacterStream(String columnName, java.io.Reader x) throws SQLException { rs.updateCharacterStream(columnName, x); }
347    public void updateCharacterStream(int columnIndex, java.io.Reader x) throws SQLException { rs.updateCharacterStream(columnIndex, x); }
348    public void updateCharacterStream(String columnName, java.io.Reader x, long l) throws SQLException { rs.updateCharacterStream(columnName, x, l); }
349    public void updateCharacterStream(int columnIndex, java.io.Reader x, long l) throws SQLException { rs.updateCharacterStream(columnIndex, x, l); }
350    public void updateNCharacterStream(String columnName, java.io.Reader x) throws SQLException { rs.updateNCharacterStream(columnName, x); }
351    public void updateNCharacterStream(int columnIndex, java.io.Reader x) throws SQLException { rs.updateNCharacterStream(columnIndex, x); }
352    public void updateNCharacterStream(String columnName, java.io.Reader x, long l) throws SQLException { rs.updateNCharacterStream(columnName, x, l); }
353    public void updateNCharacterStream(int columnIndex, java.io.Reader x, long l) throws SQLException { rs.updateNCharacterStream(columnIndex, x, l); }
354    public void updateBinaryStream(String columnName, java.io.InputStream x) throws SQLException { rs.updateBinaryStream(columnName, x); }
355    public void updateBinaryStream(int columnIndex, java.io.InputStream x) throws SQLException { rs.updateBinaryStream(columnIndex, x); }
356    public void updateBinaryStream(String columnName, java.io.InputStream x, long l) throws SQLException { rs.updateBinaryStream(columnName, x, l); }
357    public void updateBinaryStream(int columnIndex, java.io.InputStream x, long l) throws SQLException { rs.updateBinaryStream(columnIndex, x, l); }
358    public void updateAsciiStream(String columnName, java.io.InputStream x) throws SQLException { rs.updateAsciiStream(columnName, x); }
359    public void updateAsciiStream(int columnIndex, java.io.InputStream x) throws SQLException { rs.updateAsciiStream(columnIndex, x); }
360    public void updateAsciiStream(String columnName, java.io.InputStream x, long l) throws SQLException { rs.updateAsciiStream(columnName, x, l); }
361    public void updateAsciiStream(int columnIndex, java.io.InputStream x, long l) throws SQLException { rs.updateAsciiStream(columnIndex, x, l); }
362    public void updateRowId(int columnIndex, RowId x) throws SQLException { rs.updateRowId(columnIndex, x); }
363    public void updateRowId(String columnLabel, RowId x) throws SQLException { rs.updateRowId(columnLabel, x); }
364    public void updateSQLXML(int columnIndex, SQLXML x) throws SQLException { rs.updateSQLXML(columnIndex, x); }
365    public void updateSQLXML(String columnLabel, SQLXML x) throws SQLException { rs.updateSQLXML(columnLabel, x); }
366    public int getHoldability() throws SQLException { return rs.getHoldability(); }
367    public RowId getRowId(int columnIndex) throws SQLException { return  rs.getRowId(columnIndex); }
368    public RowId getRowId(String columnLabel) throws SQLException { return  rs.getRowId(columnLabel); }
369    public NClob getNClob(int columnIndex) throws SQLException { return rs.getNClob(columnIndex); }
370    public NClob getNClob(String columnLabel) throws SQLException { return rs.getNClob(columnLabel); }
371    public String getNString(int columnIndex) throws SQLException { return rs.getNString(columnIndex); }
372    public String getNString(String columnLabel) throws SQLException { return rs.getNString(columnLabel); }
373    public Reader getNCharacterStream(int columnIndex) throws SQLException { return rs.getNCharacterStream(columnIndex); }
374    public Reader getNCharacterStream(String columnLabel) throws SQLException { return rs.getNCharacterStream(columnLabel); }
375    public SQLXML getSQLXML(int columnIndex) throws SQLException { return rs.getSQLXML(columnIndex); }
376    public SQLXML getSQLXML(String columnLabel) throws SQLException { return rs.getSQLXML(columnLabel); }             
377    public boolean isClosed()throws SQLException { return rs.isClosed(); }
378    public boolean isWrapperFor(Class iface) throws SQLException { return rs.isWrapperFor(iface); }
379    public Object unwrap(Class iface) throws SQLException { return rs.unwrap(iface); }
380    
381    //== 1.7+ ===============================================
382    // enable this when building for jdk 7+
383    /*
384    public Object getObject(String str, Class c) throws SQLException {
385      return rs.getObject(str, c);
386      }
387    public Object getObject(int i, Class c) throws SQLException {
388      return rs.getObject(i, c);
389      }
390    */
391    //== END WRAPPED ===============================================
392    
393    }