Home » commons-dbcp-1.2.2-src » org.apache.commons » dbcp » [javadoc | source]
    1   /*
    2    * Licensed to the Apache Software Foundation (ASF) under one or more
    3    * contributor license agreements.  See the NOTICE file distributed with
    4    * this work for additional information regarding copyright ownership.
    5    * The ASF licenses this file to You under the Apache License, Version 2.0
    6    * (the "License"); you may not use this file except in compliance with
    7    * the License.  You may obtain a copy of the License at
    8    * 
    9    *      http://www.apache.org/licenses/LICENSE-2.0
   10    * 
   11    * Unless required by applicable law or agreed to in writing, software
   12    * distributed under the License is distributed on an "AS IS" BASIS,
   13    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14    * See the License for the specific language governing permissions and
   15    * limitations under the License.
   16    */
   17   
   18   package org.apache.commons.dbcp;
   19   
   20   import java.sql.ResultSet;
   21   import java.math.BigDecimal;
   22   import java.sql.Date;
   23   import java.sql.Time;
   24   import java.sql.Timestamp;
   25   import java.io.InputStream;
   26   import java.sql.SQLWarning;
   27   import java.sql.ResultSetMetaData;
   28   import java.sql.SQLException;
   29   import java.io.Reader;
   30   import java.sql.Statement;
   31   import java.util.Map;
   32   import java.sql.Ref;
   33   import java.sql.Blob;
   34   import java.sql.Clob;
   35   import java.sql.Array;
   36   import java.util.Calendar;
   37   
   38   /**
   39    * A base delegating implementation of {@link ResultSet}.
   40    * <p>
   41    * All of the methods from the {@link ResultSet} interface
   42    * simply call the corresponding method on the "delegate"
   43    * provided in my constructor.
   44    * <p>
   45    * Extends AbandonedTrace to implement result set tracking and
   46    * logging of code which created the ResultSet. Tracking the
   47    * ResultSet ensures that the Statment which created it can
   48    * close any open ResultSet's on Statement close.
   49    *
   50    * @author Glenn L. Nielsen
   51    * @author James House
   52    * @author Dirk Verbeeck
   53    * @version $Revision: 479137 $ $Date: 2006-11-25 08:51:48 -0700 (Sat, 25 Nov 2006) $
   54    */
   55   public class DelegatingResultSet extends AbandonedTrace implements ResultSet {
   56   
   57       /** My delegate. **/
   58       private ResultSet _res;
   59   
   60       /** The Statement that created me, if any. **/
   61       private Statement _stmt;
   62   
   63       /**
   64        * Create a wrapper for the ResultSet which traces this
   65        * ResultSet to the Statement which created it and the
   66        * code which created it.
   67        *
   68        * @param stmt Statement which created this ResultSet
   69        * @param res ResultSet to wrap
   70        */
   71       public DelegatingResultSet(Statement stmt, ResultSet res) {
   72           super((AbandonedTrace)stmt);
   73           this._stmt = stmt;
   74           this._res = res;
   75       }
   76       
   77       public static ResultSet wrapResultSet(Statement stmt, ResultSet rset) {
   78           if(null == rset) {
   79               return null;
   80           } else {
   81               return new DelegatingResultSet(stmt,rset);
   82           }
   83       }
   84   
   85       public ResultSet getDelegate() {
   86           return _res;
   87       }
   88   
   89       public boolean equals(Object obj) {
   90           ResultSet delegate = getInnermostDelegate();
   91           if (delegate == null) {
   92               return false;
   93           }
   94           if (obj instanceof DelegatingResultSet) {
   95               DelegatingResultSet s = (DelegatingResultSet) obj;
   96               return delegate.equals(s.getInnermostDelegate());
   97           }
   98           else {
   99               return delegate.equals(obj);
  100           }
  101       }
  102   
  103       public int hashCode() {
  104           Object obj = getInnermostDelegate();
  105           if (obj == null) {
  106               return 0;
  107           }
  108           return obj.hashCode();
  109       }
  110   
  111       /**
  112        * If my underlying {@link ResultSet} is not a
  113        * <tt>DelegatingResultSet</tt>, returns it,
  114        * otherwise recursively invokes this method on
  115        * my delegate.
  116        * <p>
  117        * Hence this method will return the first
  118        * delegate that is not a <tt>DelegatingResultSet</tt>,
  119        * or <tt>null</tt> when no non-<tt>DelegatingResultSet</tt>
  120        * delegate can be found by transversing this chain.
  121        * <p>
  122        * This method is useful when you may have nested
  123        * <tt>DelegatingResultSet</tt>s, and you want to make
  124        * sure to obtain a "genuine" {@link ResultSet}.
  125        */
  126       public ResultSet getInnermostDelegate() {
  127           ResultSet r = _res;
  128           while(r != null && r instanceof DelegatingResultSet) {
  129               r = ((DelegatingResultSet)r).getDelegate();
  130               if(this == r) {
  131                   return null;
  132               }
  133           }
  134           return r;
  135       }
  136       
  137       public Statement getStatement() throws SQLException {
  138           return _stmt;
  139       }
  140   
  141       /**
  142        * Wrapper for close of ResultSet which removes this
  143        * result set from being traced then calls close on
  144        * the original ResultSet.
  145        */
  146       public void close() throws SQLException {
  147           try {
  148               if(_stmt != null) {
  149                   ((AbandonedTrace)_stmt).removeTrace(this);
  150                   _stmt = null;
  151               }
  152               _res.close();
  153           }
  154           catch (SQLException e) {
  155               handleException(e);
  156           }
  157       }
  158   
  159       protected void handleException(SQLException e) throws SQLException {
  160           if ((_stmt != null) && (_stmt instanceof DelegatingStatement)) {
  161               ((DelegatingStatement)_stmt).handleException(e);
  162           }
  163           else {
  164               throw e;
  165           }
  166       }
  167   
  168       public boolean next() throws SQLException 
  169       { try { return _res.next(); } catch (SQLException e) { handleException(e); return false; } }
  170   
  171       public boolean wasNull() throws SQLException
  172       { try { return _res.wasNull(); } catch (SQLException e) { handleException(e); return false; } }
  173   
  174       public String getString(int columnIndex) throws SQLException
  175       { try { return _res.getString(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  176   
  177       public boolean getBoolean(int columnIndex) throws SQLException
  178       { try { return _res.getBoolean(columnIndex); } catch (SQLException e) { handleException(e); return false; } }
  179   
  180       public byte getByte(int columnIndex) throws SQLException
  181       { try { return _res.getByte(columnIndex); } catch (SQLException e) { handleException(e); return 0; } }
  182   
  183       public short getShort(int columnIndex) throws SQLException
  184       { try { return _res.getShort(columnIndex); } catch (SQLException e) { handleException(e); return 0; } }
  185   
  186       public int getInt(int columnIndex) throws SQLException
  187       { try { return _res.getInt(columnIndex); } catch (SQLException e) { handleException(e); return 0; } }
  188   
  189       public long getLong(int columnIndex) throws SQLException
  190       { try { return _res.getLong(columnIndex); } catch (SQLException e) { handleException(e); return 0; } }
  191   
  192       public float getFloat(int columnIndex) throws SQLException
  193       { try { return _res.getFloat(columnIndex); } catch (SQLException e) { handleException(e); return 0; } }
  194   
  195       public double getDouble(int columnIndex) throws SQLException
  196       { try { return _res.getDouble(columnIndex); } catch (SQLException e) { handleException(e); return 0; } }
  197   
  198       /** @deprecated */
  199       public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException
  200       { try { return _res.getBigDecimal(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  201   
  202       public byte[] getBytes(int columnIndex) throws SQLException
  203       { try { return _res.getBytes(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  204   
  205       public Date getDate(int columnIndex) throws SQLException
  206       { try { return _res.getDate(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  207   
  208       public Time getTime(int columnIndex) throws SQLException
  209       { try { return _res.getTime(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  210   
  211       public Timestamp getTimestamp(int columnIndex) throws SQLException
  212       { try { return _res.getTimestamp(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  213   
  214       public InputStream getAsciiStream(int columnIndex) throws SQLException
  215       { try { return _res.getAsciiStream(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  216   
  217       /** @deprecated */
  218       public InputStream getUnicodeStream(int columnIndex) throws SQLException
  219       { try { return _res.getUnicodeStream(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  220   
  221       public InputStream getBinaryStream(int columnIndex) throws SQLException
  222       { try { return _res.getBinaryStream(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  223   
  224       public String getString(String columnName) throws SQLException
  225       { try { return _res.getString(columnName); } catch (SQLException e) { handleException(e); return null; } }
  226   
  227       public boolean getBoolean(String columnName) throws SQLException
  228       { try { return _res.getBoolean(columnName); } catch (SQLException e) { handleException(e); return false; } }
  229   
  230       public byte getByte(String columnName) throws SQLException
  231       { try { return _res.getByte(columnName); } catch (SQLException e) { handleException(e); return 0; } }
  232   
  233       public short getShort(String columnName) throws SQLException
  234       { try { return _res.getShort(columnName); } catch (SQLException e) { handleException(e); return 0; } }
  235   
  236       public int getInt(String columnName) throws SQLException
  237       { try { return _res.getInt(columnName); } catch (SQLException e) { handleException(e); return 0; } }
  238   
  239       public long getLong(String columnName) throws SQLException
  240       { try { return _res.getLong(columnName); } catch (SQLException e) { handleException(e); return 0; } }
  241   
  242       public float getFloat(String columnName) throws SQLException
  243       { try { return _res.getFloat(columnName); } catch (SQLException e) { handleException(e); return 0; } }
  244   
  245       public double getDouble(String columnName) throws SQLException
  246       { try { return _res.getDouble(columnName); } catch (SQLException e) { handleException(e); return 0; } }
  247   
  248       /** @deprecated */
  249       public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException
  250       { try { return _res.getBigDecimal(columnName); } catch (SQLException e) { handleException(e); return null; } }
  251   
  252       public byte[] getBytes(String columnName) throws SQLException
  253       { try { return _res.getBytes(columnName); } catch (SQLException e) { handleException(e); return null; } }
  254   
  255       public Date getDate(String columnName) throws SQLException
  256       { try { return _res.getDate(columnName); } catch (SQLException e) { handleException(e); return null; } }
  257   
  258       public Time getTime(String columnName) throws SQLException
  259       { try { return _res.getTime(columnName); } catch (SQLException e) { handleException(e); return null; } }
  260   
  261       public Timestamp getTimestamp(String columnName) throws SQLException
  262       { try { return _res.getTimestamp(columnName); } catch (SQLException e) { handleException(e); return null; } }
  263   
  264       public InputStream getAsciiStream(String columnName) throws SQLException
  265       { try { return _res.getAsciiStream(columnName); } catch (SQLException e) { handleException(e); return null; } }
  266   
  267       /** @deprecated */
  268       public InputStream getUnicodeStream(String columnName) throws SQLException
  269       { try { return _res.getUnicodeStream(columnName); } catch (SQLException e) { handleException(e); return null; } }
  270   
  271       public InputStream getBinaryStream(String columnName) throws SQLException
  272       { try { return _res.getBinaryStream(columnName); } catch (SQLException e) { handleException(e); return null; } }
  273   
  274       public SQLWarning getWarnings() throws SQLException
  275       { try { return _res.getWarnings(); } catch (SQLException e) { handleException(e); return null; } }
  276   
  277       public void clearWarnings() throws SQLException
  278       { try { _res.clearWarnings(); } catch (SQLException e) { handleException(e); } }
  279   
  280       public String getCursorName() throws SQLException
  281       { try { return _res.getCursorName(); } catch (SQLException e) { handleException(e); return null; } }
  282   
  283       public ResultSetMetaData getMetaData() throws SQLException
  284       { try { return _res.getMetaData(); } catch (SQLException e) { handleException(e); return null; } }
  285   
  286       public Object getObject(int columnIndex) throws SQLException
  287       { try { return _res.getObject(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  288   
  289       public Object getObject(String columnName) throws SQLException
  290       { try { return _res.getObject(columnName); } catch (SQLException e) { handleException(e); return null; } }
  291   
  292       public int findColumn(String columnName) throws SQLException
  293       { try { return _res.findColumn(columnName); } catch (SQLException e) { handleException(e); return 0; } }
  294   
  295       public Reader getCharacterStream(int columnIndex) throws SQLException
  296       { try { return _res.getCharacterStream(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  297   
  298       public Reader getCharacterStream(String columnName) throws SQLException
  299       { try { return _res.getCharacterStream(columnName); } catch (SQLException e) { handleException(e); return null; } }
  300   
  301       public BigDecimal getBigDecimal(int columnIndex) throws SQLException
  302       { try { return _res.getBigDecimal(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  303   
  304       public BigDecimal getBigDecimal(String columnName) throws SQLException
  305       { try { return _res.getBigDecimal(columnName); } catch (SQLException e) { handleException(e); return null; } }
  306   
  307       public boolean isBeforeFirst() throws SQLException
  308       { try { return _res.isBeforeFirst(); } catch (SQLException e) { handleException(e); return false; } }
  309   
  310       public boolean isAfterLast() throws SQLException
  311       { try { return _res.isAfterLast(); } catch (SQLException e) { handleException(e); return false; } }
  312   
  313       public boolean isFirst() throws SQLException
  314       { try { return _res.isFirst(); } catch (SQLException e) { handleException(e); return false; } }
  315   
  316       public boolean isLast() throws SQLException
  317       { try { return _res.isLast(); } catch (SQLException e) { handleException(e); return false; } }
  318   
  319       public void beforeFirst() throws SQLException
  320       { try { _res.beforeFirst(); } catch (SQLException e) { handleException(e); } }
  321   
  322       public void afterLast() throws SQLException
  323       { try { _res.afterLast(); } catch (SQLException e) { handleException(e); } }
  324   
  325       public boolean first() throws SQLException
  326       { try { return _res.first(); } catch (SQLException e) { handleException(e); return false; } }
  327   
  328       public boolean last() throws SQLException
  329       { try { return _res.last(); } catch (SQLException e) { handleException(e); return false; } }
  330   
  331       public int getRow() throws SQLException
  332       { try { return _res.getRow(); } catch (SQLException e) { handleException(e); return 0; } }
  333   
  334       public boolean absolute(int row) throws SQLException
  335       { try { return _res.absolute(row); } catch (SQLException e) { handleException(e); return false; } }
  336   
  337       public boolean relative(int rows) throws SQLException
  338       { try { return _res.relative(rows); } catch (SQLException e) { handleException(e); return false; } }
  339   
  340       public boolean previous() throws SQLException
  341       { try { return _res.previous(); } catch (SQLException e) { handleException(e); return false; } }
  342   
  343       public void setFetchDirection(int direction) throws SQLException
  344       { try { _res.setFetchDirection(direction); } catch (SQLException e) { handleException(e); } }
  345   
  346       public int getFetchDirection() throws SQLException
  347       { try { return _res.getFetchDirection(); } catch (SQLException e) { handleException(e); return 0; } }
  348   
  349       public void setFetchSize(int rows) throws SQLException
  350       { try { _res.setFetchSize(rows); } catch (SQLException e) { handleException(e); } }
  351   
  352       public int getFetchSize() throws SQLException
  353       { try { return _res.getFetchSize(); } catch (SQLException e) { handleException(e); return 0; } }
  354   
  355       public int getType() throws SQLException
  356       { try { return _res.getType(); } catch (SQLException e) { handleException(e); return 0; } }
  357   
  358       public int getConcurrency() throws SQLException
  359       { try { return _res.getConcurrency(); } catch (SQLException e) { handleException(e); return 0; } }
  360   
  361       public boolean rowUpdated() throws SQLException
  362       { try { return _res.rowUpdated(); } catch (SQLException e) { handleException(e); return false; } }
  363   
  364       public boolean rowInserted() throws SQLException
  365       { try { return _res.rowInserted(); } catch (SQLException e) { handleException(e); return false; } }
  366   
  367       public boolean rowDeleted() throws SQLException
  368       { try { return _res.rowDeleted(); } catch (SQLException e) { handleException(e); return false; } }
  369   
  370       public void updateNull(int columnIndex) throws SQLException
  371       { try { _res.updateNull(columnIndex); } catch (SQLException e) { handleException(e); } }
  372   
  373       public void updateBoolean(int columnIndex, boolean x) throws SQLException
  374       { try { _res.updateBoolean(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  375   
  376       public void updateByte(int columnIndex, byte x) throws SQLException
  377       { try { _res.updateByte(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  378   
  379       public void updateShort(int columnIndex, short x) throws SQLException
  380       { try { _res.updateShort(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  381   
  382       public void updateInt(int columnIndex, int x) throws SQLException
  383       { try { _res.updateInt(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  384   
  385       public void updateLong(int columnIndex, long x) throws SQLException
  386       { try { _res.updateLong(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  387   
  388       public void updateFloat(int columnIndex, float x) throws SQLException
  389       { try { _res.updateFloat(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  390   
  391       public void updateDouble(int columnIndex, double x) throws SQLException
  392       { try { _res.updateDouble(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  393   
  394       public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException
  395       { try { _res.updateBigDecimal(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  396   
  397       public void updateString(int columnIndex, String x) throws SQLException
  398       { try { _res.updateString(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  399   
  400       public void updateBytes(int columnIndex, byte[] x) throws SQLException
  401       { try { _res.updateBytes(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  402   
  403       public void updateDate(int columnIndex, Date x) throws SQLException
  404       { try { _res.updateDate(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  405   
  406       public void updateTime(int columnIndex, Time x) throws SQLException
  407       { try { _res.updateTime(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  408   
  409       public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException
  410       { try { _res.updateTimestamp(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  411   
  412       public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException
  413       { try { _res.updateAsciiStream(columnIndex, x, length); } catch (SQLException e) { handleException(e); } }
  414   
  415       public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException
  416       { try { _res.updateBinaryStream(columnIndex, x, length); } catch (SQLException e) { handleException(e); } }
  417   
  418       public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException
  419       { try { _res.updateCharacterStream(columnIndex, x, length); } catch (SQLException e) { handleException(e); } }
  420   
  421       public void updateObject(int columnIndex, Object x, int scale) throws SQLException
  422       { try { _res.updateObject(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  423   
  424       public void updateObject(int columnIndex, Object x) throws SQLException
  425       { try { _res.updateObject(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  426   
  427       public void updateNull(String columnName) throws SQLException
  428       { try { _res.updateNull(columnName); } catch (SQLException e) { handleException(e); } }
  429   
  430       public void updateBoolean(String columnName, boolean x) throws SQLException
  431       { try { _res.updateBoolean(columnName, x); } catch (SQLException e) { handleException(e); } }
  432   
  433       public void updateByte(String columnName, byte x) throws SQLException
  434       { try { _res.updateByte(columnName, x); } catch (SQLException e) { handleException(e); } }
  435   
  436       public void updateShort(String columnName, short x) throws SQLException
  437       { try { _res.updateShort(columnName, x); } catch (SQLException e) { handleException(e); } }
  438   
  439       public void updateInt(String columnName, int x) throws SQLException
  440       { try { _res.updateInt(columnName, x); } catch (SQLException e) { handleException(e); } }
  441   
  442       public void updateLong(String columnName, long x) throws SQLException
  443       { try { _res.updateLong(columnName, x); } catch (SQLException e) { handleException(e); } }
  444   
  445       public void updateFloat(String columnName, float x) throws SQLException
  446       { try { _res.updateFloat(columnName, x); } catch (SQLException e) { handleException(e); } }
  447   
  448       public void updateDouble(String columnName, double x) throws SQLException
  449       { try { _res.updateDouble(columnName, x); } catch (SQLException e) { handleException(e); } }
  450   
  451       public void updateBigDecimal(String columnName, BigDecimal x) throws SQLException
  452       { try { _res.updateBigDecimal(columnName, x); } catch (SQLException e) { handleException(e); } }
  453   
  454       public void updateString(String columnName, String x) throws SQLException
  455       { try { _res.updateString(columnName, x); } catch (SQLException e) { handleException(e); } }
  456   
  457       public void updateBytes(String columnName, byte[] x) throws SQLException
  458       { try { _res.updateBytes(columnName, x); } catch (SQLException e) { handleException(e); } }
  459   
  460       public void updateDate(String columnName, Date x) throws SQLException
  461       { try { _res.updateDate(columnName, x); } catch (SQLException e) { handleException(e); } }
  462   
  463       public void updateTime(String columnName, Time x) throws SQLException
  464       { try { _res.updateTime(columnName, x); } catch (SQLException e) { handleException(e); } }
  465   
  466       public void updateTimestamp(String columnName, Timestamp x) throws SQLException
  467       { try { _res.updateTimestamp(columnName, x); } catch (SQLException e) { handleException(e); } }
  468   
  469       public void updateAsciiStream(String columnName, InputStream x, int length) throws SQLException
  470       { try { _res.updateAsciiStream(columnName, x, length); } catch (SQLException e) { handleException(e); } }
  471   
  472       public void updateBinaryStream(String columnName, InputStream x, int length) throws SQLException
  473       { try { _res.updateBinaryStream(columnName, x, length); } catch (SQLException e) { handleException(e); } }
  474   
  475       public void updateCharacterStream(String columnName, Reader reader, int length) throws SQLException
  476       { try { _res.updateCharacterStream(columnName, reader, length); } catch (SQLException e) { handleException(e); } }
  477   
  478       public void updateObject(String columnName, Object x, int scale) throws SQLException
  479       { try { _res.updateObject(columnName, x); } catch (SQLException e) { handleException(e); } }
  480   
  481       public void updateObject(String columnName, Object x) throws SQLException
  482       { try { _res.updateObject(columnName, x); } catch (SQLException e) { handleException(e); } }
  483   
  484       public void insertRow() throws SQLException
  485       { try { _res.insertRow(); } catch (SQLException e) { handleException(e); } }
  486   
  487       public void updateRow() throws SQLException
  488       { try { _res.updateRow(); } catch (SQLException e) { handleException(e); } }
  489   
  490       public void deleteRow() throws SQLException
  491       { try { _res.deleteRow(); } catch (SQLException e) { handleException(e); } }
  492   
  493       public void refreshRow() throws SQLException
  494       { try { _res.refreshRow(); } catch (SQLException e) { handleException(e); } }
  495   
  496       public void cancelRowUpdates() throws SQLException
  497       { try { _res.cancelRowUpdates(); } catch (SQLException e) { handleException(e); } }
  498   
  499       public void moveToInsertRow() throws SQLException
  500       { try { _res.moveToInsertRow(); } catch (SQLException e) { handleException(e); } }
  501   
  502       public void moveToCurrentRow() throws SQLException
  503       { try { _res.moveToCurrentRow(); } catch (SQLException e) { handleException(e); } }
  504   
  505       public Object getObject(int i, Map map) throws SQLException
  506       { try { return _res.getObject(i, map); } catch (SQLException e) { handleException(e); return null; } }
  507   
  508       public Ref getRef(int i) throws SQLException
  509       { try { return _res.getRef(i); } catch (SQLException e) { handleException(e); return null; } }
  510   
  511       public Blob getBlob(int i) throws SQLException
  512       { try { return _res.getBlob(i); } catch (SQLException e) { handleException(e); return null; } }
  513   
  514       public Clob getClob(int i) throws SQLException
  515       { try { return _res.getClob(i); } catch (SQLException e) { handleException(e); return null; } }
  516   
  517       public Array getArray(int i) throws SQLException
  518       { try { return _res.getArray(i); } catch (SQLException e) { handleException(e); return null; } }
  519   
  520       public Object getObject(String colName, Map map) throws SQLException
  521       { try { return _res.getObject(colName, map); } catch (SQLException e) { handleException(e); return null; } }
  522   
  523       public Ref getRef(String colName) throws SQLException
  524       { try { return _res.getRef(colName); } catch (SQLException e) { handleException(e); return null; } }
  525   
  526       public Blob getBlob(String colName) throws SQLException
  527       { try { return _res.getBlob(colName); } catch (SQLException e) { handleException(e); return null; } }
  528   
  529       public Clob getClob(String colName) throws SQLException
  530       { try { return _res.getClob(colName); } catch (SQLException e) { handleException(e); return null; } }
  531   
  532       public Array getArray(String colName) throws SQLException
  533       { try { return _res.getArray(colName); } catch (SQLException e) { handleException(e); return null; } }
  534   
  535       public Date getDate(int columnIndex, Calendar cal) throws SQLException
  536       { try { return _res.getDate(columnIndex, cal); } catch (SQLException e) { handleException(e); return null; } }
  537   
  538       public Date getDate(String columnName, Calendar cal) throws SQLException
  539       { try { return _res.getDate(columnName, cal); } catch (SQLException e) { handleException(e); return null; } }
  540   
  541       public Time getTime(int columnIndex, Calendar cal) throws SQLException
  542       { try { return _res.getTime(columnIndex, cal); } catch (SQLException e) { handleException(e); return null; } }
  543   
  544       public Time getTime(String columnName, Calendar cal) throws SQLException
  545       { try { return _res.getTime(columnName, cal); } catch (SQLException e) { handleException(e); return null; } }
  546   
  547       public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException
  548       { try { return _res.getTimestamp(columnIndex, cal); } catch (SQLException e) { handleException(e); return null; } }
  549   
  550       public Timestamp getTimestamp(String columnName, Calendar cal) throws SQLException
  551       { try { return _res.getTimestamp(columnName, cal); } catch (SQLException e) { handleException(e); return null; } }
  552   
  553   
  554       // ------------------- JDBC 3.0 -----------------------------------------
  555       // Will be commented by the build process on a JDBC 2.0 system
  556   
  557   /* JDBC_3_ANT_KEY_BEGIN */
  558   
  559       public java.net.URL getURL(int columnIndex) throws SQLException
  560       { try { return _res.getURL(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  561   
  562       public java.net.URL getURL(String columnName) throws SQLException
  563       { try { return _res.getURL(columnName); } catch (SQLException e) { handleException(e); return null; } }
  564   
  565       public void updateRef(int columnIndex, java.sql.Ref x) throws SQLException
  566       { try { _res.updateRef(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  567   
  568       public void updateRef(String columnName, java.sql.Ref x) throws SQLException
  569       { try { _res.updateRef(columnName, x); } catch (SQLException e) { handleException(e); } }
  570   
  571       public void updateBlob(int columnIndex, java.sql.Blob x) throws SQLException
  572       { try { _res.updateBlob(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  573   
  574       public void updateBlob(String columnName, java.sql.Blob x) throws SQLException
  575       { try { _res.updateBlob(columnName, x); } catch (SQLException e) { handleException(e); } }
  576   
  577       public void updateClob(int columnIndex, java.sql.Clob x) throws SQLException
  578       { try { _res.updateClob(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  579   
  580       public void updateClob(String columnName, java.sql.Clob x) throws SQLException
  581       { try { _res.updateClob(columnName, x); } catch (SQLException e) { handleException(e); } }
  582   
  583       public void updateArray(int columnIndex, java.sql.Array x) throws SQLException
  584       { try { _res.updateArray(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  585   
  586       public void updateArray(String columnName, java.sql.Array x) throws SQLException
  587       { try { _res.updateArray(columnName, x); } catch (SQLException e) { handleException(e); } }
  588   
  589   /* JDBC_3_ANT_KEY_END */
  590   }

Save This Page
Home » commons-dbcp-1.2.2-src » org.apache.commons » dbcp » [javadoc | source]