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
006package fc.jdbc;
007
008import java.sql.*;
009import java.util.*;
010import java.math.*;
011import java.io.*;
012
013import fc.io.*;
014import fc.util.*;
015
016/**  
017Wrapper class for a {@link java.sql.ResultSet ResultSet} that allows the
018value of specified columns to be transformed. Transforms <b>only</b> work
019the <b><tt>get<u>Object</u>(..)</tt></b> and
020<b><tt>get<u>String</u>(..)</tt></b> methods, all other get methods return
021an unmodified result obtained from the underlying result set.
022
023@author hursh jain
024**/
025
026public final class ResultSetTransform implements ResultSet
027{
028static final boolean dbg = false;
029
030ResultSet       rs;
031ResultSetMetaData   rsmd;
032Map         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)
037Map ColNameIndex; 
038
039public 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/** 
049Adds a transform rule for the specified column. When this column's
050data 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>
053methods).
054**/   
055public void addColumnTransform(int columnIndex, Rule rule) 
056throws 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/** 
065Adds a transform rule for the specified column. When this column's
066data 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>
069methods).
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**/   
075public void addColumnTransform(String columnName, Rule rule) 
076throws 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/** 
089A transform rule, added to a specific column index or name via
090the {@link addColumnTransform} methods. To instantiate this
091class, use the <tt>foo.new Rule()</tt> syntax, where foo is
092an instance of the outer ResultSetTransform class.
093**/
094public 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  
101Object 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
114public 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
142public Object getObject(int columnIndex) throws SQLException
143  {
144  Integer key =  new Integer(columnIndex);
145  return applyRule(key, rs.getObject(columnIndex));
146  }
147      
148public 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
154public 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  
162public 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
173public boolean getBoolean(int columnIndex) throws SQLException { return rs.getBoolean(columnIndex); }
174public byte getByte(int columnIndex) throws SQLException { return rs.getByte(columnIndex); }
175public short getShort(int columnIndex) throws SQLException { return rs.getShort(columnIndex); }
176public int getInt(int columnIndex) throws SQLException { return rs.getInt(columnIndex); }
177public long getLong(int columnIndex) throws SQLException { return rs.getLong(columnIndex); }
178public float getFloat(int columnIndex) throws SQLException { return rs.getFloat(columnIndex); }
179public double getDouble(int columnIndex) throws SQLException { return rs.getDouble(columnIndex); }
180public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { return rs.getBigDecimal(columnIndex, scale); }
181public byte[] getBytes(int columnIndex) throws SQLException { return rs.getBytes(columnIndex); }
182public java.sql.Date getDate(int columnIndex) throws SQLException { return rs.getDate(columnIndex); }
183public java.sql.Time getTime(int columnIndex) throws SQLException { return rs.getTime(columnIndex); }
184public java.sql.Timestamp getTimestamp(int columnIndex) throws SQLException { return rs.getTimestamp(columnIndex); }
185public java.io.InputStream getAsciiStream(int columnIndex) throws SQLException { return rs.getAsciiStream(columnIndex); }
186public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException { return rs.getUnicodeStream(columnIndex); }
187public java.io.InputStream getBinaryStream(int columnIndex) throws SQLException { return rs.getBinaryStream(columnIndex); }
188//======================================================================
189// Methods for accessing results by column name
190//======================================================================
191public boolean getBoolean(String columnName) throws SQLException { return rs.getBoolean(columnName); }
192public byte getByte(String columnName) throws SQLException { return rs.getByte(columnName); }
193public short getShort(String columnName) throws SQLException { return rs.getShort(columnName); }
194public int getInt(String columnName) throws SQLException { return rs.getInt(columnName); }
195public long getLong(String columnName) throws SQLException { return rs.getLong(columnName); }
196public float getFloat(String columnName) throws SQLException { return rs.getFloat(columnName); }
197public double getDouble(String columnName) throws SQLException { return rs.getDouble(columnName); }
198public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException { return rs.getBigDecimal(columnName, scale); }
199public byte[] getBytes(String columnName) throws SQLException { return rs.getBytes(columnName); }
200public java.sql.Date getDate(String columnName) throws SQLException { return rs.getDate(columnName); }
201public java.sql.Time getTime(String columnName) throws SQLException { return rs.getTime(columnName); }
202public java.sql.Timestamp getTimestamp(String columnName) throws SQLException { return rs.getTimestamp(columnName); }
203public java.io.InputStream getAsciiStream(String columnName) throws SQLException { return rs.getAsciiStream(columnName); }
204public java.io.InputStream getUnicodeStream(String columnName) throws SQLException { return rs.getUnicodeStream(columnName); }
205public java.io.InputStream getBinaryStream(String columnName) throws SQLException { return rs.getBinaryStream(columnName); }
206public boolean next() throws SQLException { return rs.next(); }
207public void close() throws SQLException { rs.close(); }
208public boolean wasNull() throws SQLException { return rs.wasNull(); }
209//=====================================================================
210// Advanced features:
211//=====================================================================
212public SQLWarning getWarnings() throws SQLException { return rs.getWarnings(); }
213public void clearWarnings() throws SQLException { rs.clearWarnings(); }
214public String getCursorName() throws SQLException { return rs.getCursorName(); }
215public ResultSetMetaData getMetaData() throws SQLException { return rs.getMetaData(); }
216//----------------------------------------------------------------
217public int findColumn(String columnName) throws SQLException { return rs.findColumn(columnName); }
218//--------------------------JDBC 2.0-----------------------------------
219//---------------------------------------------------------------------
220// Getters and Setters
221//---------------------------------------------------------------------
222public java.io.Reader getCharacterStream(int columnIndex) throws SQLException { return rs.getCharacterStream(columnIndex); }
223public java.io.Reader getCharacterStream(String columnName) throws SQLException { return rs.getCharacterStream(columnName); }
224public BigDecimal getBigDecimal(int columnIndex) throws SQLException { return rs.getBigDecimal(columnIndex); }
225public BigDecimal getBigDecimal(String columnName) throws SQLException { return rs.getBigDecimal(columnName); }
226//---------------------------------------------------------------------
227// Traversal/Positioning
228//---------------------------------------------------------------------
229public boolean isBeforeFirst() throws SQLException { return rs.isBeforeFirst(); }
230public boolean isAfterLast() throws SQLException { return rs.isAfterLast(); }
231public boolean isFirst() throws SQLException { return rs.isFirst(); }
232public boolean isLast() throws SQLException { return rs.isLast(); }
233public void beforeFirst() throws SQLException { rs.beforeFirst(); }
234public void afterLast() throws SQLException { rs.afterLast(); }
235public boolean first() throws SQLException { return rs.first(); }
236public boolean last() throws SQLException { return rs.last(); }
237public int getRow() throws SQLException { return rs.getRow(); }
238public boolean absolute( int row ) throws SQLException { return rs.absolute(row); }
239public boolean relative( int rows ) throws SQLException { return rs.relative(rows); }
240public boolean previous() throws SQLException { return rs.previous(); }
241//---------------------------------------------------------------------
242// Properties
243//---------------------------------------------------------------------
244public void setFetchDirection(int direction) throws SQLException { rs.setFetchDirection(direction); }
245public int getFetchDirection() throws SQLException { return rs.getFetchDirection(); }
246public void setFetchSize(int rows) throws SQLException { rs.setFetchSize(rows); }
247public int getFetchSize() throws SQLException { return rs.getFetchSize(); }
248public int getType() throws SQLException { return rs.getType(); }
249public int getConcurrency() throws SQLException { return rs.getConcurrency(); }
250//---------------------------------------------------------------------
251// Updates
252//---------------------------------------------------------------------
253public boolean rowUpdated() throws SQLException { return rs.rowUpdated(); }
254public boolean rowInserted() throws SQLException { return rs.rowInserted(); }
255public boolean rowDeleted() throws SQLException { return rs.rowDeleted(); }
256public void updateNull(int columnIndex) throws SQLException { rs.updateNull(columnIndex); }  
257public void updateBoolean(int columnIndex, boolean x) throws SQLException { rs.updateBoolean(columnIndex, x); }
258public void updateByte(int columnIndex, byte x) throws SQLException { rs.updateByte(columnIndex, x); }
259public void updateShort(int columnIndex, short x) throws SQLException { rs.updateShort(columnIndex, x); }
260public void updateInt(int columnIndex, int x) throws SQLException { rs.updateInt(columnIndex, x); }
261public void updateLong(int columnIndex, long x) throws SQLException { rs.updateLong(columnIndex, x); }
262public void updateFloat(int columnIndex, float x) throws SQLException { rs.updateFloat(columnIndex, x); }
263public void updateDouble(int columnIndex, double x) throws SQLException { rs.updateDouble(columnIndex, x); }
264public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException { rs.updateBigDecimal(columnIndex, x); }
265public void updateString(int columnIndex, String x) throws SQLException { rs.updateString(columnIndex, x); }
266public void updateBytes(int columnIndex, byte x[]) throws SQLException { rs.updateBytes(columnIndex, x); }
267public void updateDate(int columnIndex, java.sql.Date x) throws SQLException { rs.updateDate(columnIndex, x); }
268public void updateTime(int columnIndex, java.sql.Time x) throws SQLException { rs.updateTime(columnIndex, x); }
269public void updateTimestamp(int columnIndex, java.sql.Timestamp x) throws SQLException { rs.updateTimestamp(columnIndex, x); }
270public void updateAsciiStream(int columnIndex, java.io.InputStream x, int length) throws SQLException { rs.updateAsciiStream(columnIndex, x, length); }
271public void updateBinaryStream(int columnIndex, java.io.InputStream x,int length) throws SQLException { rs.updateBinaryStream(columnIndex, x, length); }
272public void updateCharacterStream(int columnIndex,java.io.Reader x,int length) throws SQLException { rs.updateCharacterStream(columnIndex, x, length); }
273public void updateObject(int columnIndex, Object x, int scale) throws SQLException { rs.updateObject(columnIndex, x, scale); }
274public void updateObject(int columnIndex, Object x) throws SQLException { rs.updateObject(columnIndex, x); }
275public void updateNull(String columnName) throws SQLException { rs.updateNull(columnName); }  
276public void updateBoolean(String columnName, boolean x) throws SQLException { rs.updateBoolean(columnName, x); }
277public void updateByte(String columnName, byte x) throws SQLException { rs.updateByte(columnName, x); }
278public void updateShort(String columnName, short x) throws SQLException { rs.updateShort(columnName, x); }
279public void updateInt(String columnName, int x) throws SQLException { rs.updateInt(columnName, x); }
280public void updateLong(String columnName, long x) throws SQLException { rs.updateLong(columnName, x); }
281public void updateFloat(String columnName, float x) throws SQLException { rs.updateFloat(columnName, x); }
282public void updateDouble(String columnName, double x) throws SQLException { rs.updateDouble(columnName, x); }
283public void updateBigDecimal(String columnName, BigDecimal x) throws SQLException { rs.updateBigDecimal(columnName, x); }
284public void updateString(String columnName, String x) throws SQLException { rs.updateString(columnName, x); }
285public void updateBytes(String columnName, byte x[]) throws SQLException { rs.updateBytes(columnName, x); }
286public void updateDate(String columnName, java.sql.Date x) throws SQLException { rs.updateDate(columnName, x); }
287public void updateTime(String columnName, java.sql.Time x) throws SQLException { rs.updateTime(columnName, x); }
288public void updateTimestamp(String columnName, java.sql.Timestamp x) throws SQLException { rs.updateTimestamp(columnName, x); }
289public void updateAsciiStream(String columnName, java.io.InputStream x, int length) throws SQLException { rs.updateAsciiStream(columnName, x, length); }
290public void updateBinaryStream(String columnName, java.io.InputStream x,int length) throws SQLException { rs.updateBinaryStream(columnName, x, length); }
291public void updateCharacterStream(String columnName, java.io.Reader reader,int length) throws SQLException { rs.updateCharacterStream(columnName, reader, length); }
292public void updateObject(String columnName, Object x, int scale) throws SQLException { rs.updateObject(columnName, x, scale); }
293public void updateObject(String columnName, Object x) throws SQLException { rs.updateObject(columnName, x); }
294public void insertRow() throws SQLException { rs.insertRow(); }
295public void updateRow() throws SQLException { rs.updateRow(); }
296public void deleteRow() throws SQLException { rs.deleteRow(); }
297public void refreshRow() throws SQLException { rs.refreshRow(); }
298public void cancelRowUpdates() throws SQLException { rs.cancelRowUpdates(); }
299public void moveToInsertRow() throws SQLException { rs.moveToInsertRow(); }
300public void moveToCurrentRow() throws SQLException { rs.moveToCurrentRow(); }
301public Statement getStatement() throws SQLException { return rs.getStatement(); }
302public Object getObject(int i, java.util.Map map) throws SQLException { return rs.getObject(i, map); }
303public Ref getRef(int i) throws SQLException { return rs.getRef(i); }
304public Blob getBlob(int i) throws SQLException { return rs.getBlob(i); }
305public Clob getClob(int i) throws SQLException { return rs.getClob(i); }
306public Array getArray(int i) throws SQLException { return rs.getArray(i); }
307public Object getObject(String colName, java.util.Map map) throws SQLException { return rs.getObject(colName, map); }
308public Ref getRef(String colName) throws SQLException { return rs.getRef(colName); }
309public Blob getBlob(String colName) throws SQLException { return rs.getBlob(colName); }
310public Clob getClob(String colName) throws SQLException { return rs.getClob(colName); }
311public Array getArray(String colName) throws SQLException { return rs.getArray(colName); }
312public java.sql.Date getDate(int columnIndex, Calendar cal) throws SQLException { return rs.getDate(columnIndex, cal); }
313public java.sql.Date getDate(String columnName, Calendar cal) throws SQLException { return rs.getDate(columnName, cal); }
314public java.sql.Time getTime(int columnIndex, Calendar cal) throws SQLException { return rs.getTime(columnIndex, cal); }
315public java.sql.Time getTime(String columnName, Calendar cal) throws SQLException { return rs.getTime(columnName, cal); }
316public java.sql.Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException { return rs.getTimestamp(columnIndex, cal); }
317public java.sql.Timestamp getTimestamp(String columnName, Calendar cal) throws SQLException { return rs.getTimestamp(columnName, cal); }
318//-------------------------- JDBC 3.0 ----------------------------------------
319public java.net.URL getURL(int columnIndex) throws SQLException { return rs.getURL(columnIndex); }
320public java.net.URL getURL(String columnName) throws SQLException { return rs.getURL(columnName); }
321public void updateRef(int columnIndex, java.sql.Ref x) throws SQLException { rs.updateRef(columnIndex, x); }
322public void updateRef(String columnName, java.sql.Ref x) throws SQLException { rs.updateRef(columnName, x); }
323public void updateBlob(int columnIndex, java.sql.Blob x) throws SQLException { rs.updateBlob(columnIndex, x); }
324public void updateBlob(String columnName, java.sql.Blob x) throws SQLException { rs.updateBlob(columnName, x); }
325public void updateClob(int columnIndex, java.sql.Clob x) throws SQLException { rs.updateClob(columnIndex, x); }
326public void updateClob(String columnName, java.sql.Clob x) throws SQLException { rs.updateClob(columnName, x); }
327public void updateArray(int columnIndex, java.sql.Array x) throws SQLException { rs.updateArray(columnIndex, x); }
328public void updateArray(String columnName, java.sql.Array x) throws SQLException { rs.updateArray(columnName, x); }
329//-------------------------- JDBC 4.0 ----------------------------------------
330public void updateNClob(String columnName, java.io.Reader r) throws SQLException { rs.updateNClob(columnName, r); }
331public void updateNClob(int columnIndex, java.io.Reader r) throws SQLException {  rs.updateNClob(columnIndex, r); }
332public void updateNClob(String columnName, java.io.Reader r, long l) throws SQLException { rs.updateNClob(columnName, r, l); }
333public void updateNClob(int columnIndex, java.io.Reader r, long l) throws SQLException {  rs.updateNClob(columnIndex, r, l); }
334public void updateNClob(String columnName, NClob x) throws SQLException { rs.updateNClob(columnName, x); }
335public void updateNClob(int columnIndex, NClob x) throws SQLException {   rs.updateNClob(columnIndex, x); }
336public void updateNString(int columnIndex, String s) throws SQLException { rs.updateNString(columnIndex, s); }
337public void updateNString(String columnLabel, String s) throws SQLException { rs.updateNString(columnLabel, s); }
338public void updateClob(String columnName, java.io.Reader r) throws SQLException { rs.updateClob(columnName, r); }
339public void updateClob(int columnIndex, java.io.Reader r, long l) throws SQLException { rs.updateClob(columnIndex, r); }
340public void updateClob(String columnName, java.io.Reader r, long l) throws SQLException { rs.updateClob(columnName, r, l); }
341public void updateClob(int columnIndex, java.io.Reader r) throws SQLException { rs.updateClob(columnIndex, r); }
342public void updateBlob(int columnIndex, java.io.InputStream x) throws SQLException { rs.updateBlob(columnIndex, x); }
343public void updateBlob(String columnName, java.io.InputStream x) throws SQLException { rs.updateBlob(columnName, x); }
344public void updateBlob(int columnIndex, java.io.InputStream x, long l) throws SQLException { rs.updateBlob(columnIndex, x, l); }
345public void updateBlob(String columnName, java.io.InputStream x, long l) throws SQLException { rs.updateBlob(columnName, x, l); }
346public void updateCharacterStream(String columnName, java.io.Reader x) throws SQLException { rs.updateCharacterStream(columnName, x); }
347public void updateCharacterStream(int columnIndex, java.io.Reader x) throws SQLException { rs.updateCharacterStream(columnIndex, x); }
348public void updateCharacterStream(String columnName, java.io.Reader x, long l) throws SQLException { rs.updateCharacterStream(columnName, x, l); }
349public void updateCharacterStream(int columnIndex, java.io.Reader x, long l) throws SQLException { rs.updateCharacterStream(columnIndex, x, l); }
350public void updateNCharacterStream(String columnName, java.io.Reader x) throws SQLException { rs.updateNCharacterStream(columnName, x); }
351public void updateNCharacterStream(int columnIndex, java.io.Reader x) throws SQLException { rs.updateNCharacterStream(columnIndex, x); }
352public void updateNCharacterStream(String columnName, java.io.Reader x, long l) throws SQLException { rs.updateNCharacterStream(columnName, x, l); }
353public void updateNCharacterStream(int columnIndex, java.io.Reader x, long l) throws SQLException { rs.updateNCharacterStream(columnIndex, x, l); }
354public void updateBinaryStream(String columnName, java.io.InputStream x) throws SQLException { rs.updateBinaryStream(columnName, x); }
355public void updateBinaryStream(int columnIndex, java.io.InputStream x) throws SQLException { rs.updateBinaryStream(columnIndex, x); }
356public void updateBinaryStream(String columnName, java.io.InputStream x, long l) throws SQLException { rs.updateBinaryStream(columnName, x, l); }
357public void updateBinaryStream(int columnIndex, java.io.InputStream x, long l) throws SQLException { rs.updateBinaryStream(columnIndex, x, l); }
358public void updateAsciiStream(String columnName, java.io.InputStream x) throws SQLException { rs.updateAsciiStream(columnName, x); }
359public void updateAsciiStream(int columnIndex, java.io.InputStream x) throws SQLException { rs.updateAsciiStream(columnIndex, x); }
360public void updateAsciiStream(String columnName, java.io.InputStream x, long l) throws SQLException { rs.updateAsciiStream(columnName, x, l); }
361public void updateAsciiStream(int columnIndex, java.io.InputStream x, long l) throws SQLException { rs.updateAsciiStream(columnIndex, x, l); }
362public void updateRowId(int columnIndex, RowId x) throws SQLException { rs.updateRowId(columnIndex, x); }
363public void updateRowId(String columnLabel, RowId x) throws SQLException { rs.updateRowId(columnLabel, x); }
364public void updateSQLXML(int columnIndex, SQLXML x) throws SQLException { rs.updateSQLXML(columnIndex, x); }
365public void updateSQLXML(String columnLabel, SQLXML x) throws SQLException { rs.updateSQLXML(columnLabel, x); }
366public int getHoldability() throws SQLException { return rs.getHoldability(); }
367public RowId getRowId(int columnIndex) throws SQLException { return  rs.getRowId(columnIndex); }
368public RowId getRowId(String columnLabel) throws SQLException { return  rs.getRowId(columnLabel); }
369public NClob getNClob(int columnIndex) throws SQLException { return rs.getNClob(columnIndex); }
370public NClob getNClob(String columnLabel) throws SQLException { return rs.getNClob(columnLabel); }
371public String getNString(int columnIndex) throws SQLException { return rs.getNString(columnIndex); }
372public String getNString(String columnLabel) throws SQLException { return rs.getNString(columnLabel); }
373public Reader getNCharacterStream(int columnIndex) throws SQLException { return rs.getNCharacterStream(columnIndex); }
374public Reader getNCharacterStream(String columnLabel) throws SQLException { return rs.getNCharacterStream(columnLabel); }
375public SQLXML getSQLXML(int columnIndex) throws SQLException { return rs.getSQLXML(columnIndex); }
376public SQLXML getSQLXML(String columnLabel) throws SQLException { return rs.getSQLXML(columnLabel); }             
377public boolean isClosed()throws SQLException { return rs.isClosed(); }
378public boolean isWrapperFor(Class iface) throws SQLException { return rs.isWrapperFor(iface); }
379public Object unwrap(Class iface) throws SQLException { return rs.unwrap(iface); }
380
381//== 1.7+ ===============================================
382public Object getObject(String str, Class c) throws SQLException {
383  return rs.getObject(str, c);
384  }
385public Object getObject(int i, Class c) throws SQLException {
386  return rs.getObject(i, c);
387  }
388
389//== END WRAPPED ===============================================
390}