    001/*
    002 * Licensed to the Apache Software Foundation (ASF) under one or more
    003 * contributor license agreements.  See the NOTICE file distributed with
    004 * this work for additional information regarding copyright ownership.
    005 * The ASF licenses this file to You under the Apache License, Version 2.0
    006 * (the "License"); you may not use this file except in compliance with
    007 * the License.  You may obtain a copy of the License at
    008 *
    009 *      https://www.apache.org/licenses/LICENSE-2.0
    010 *
    011 * Unless required by applicable law or agreed to in writing, software
    012 * distributed under the License is distributed on an "AS IS" BASIS,
    013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    014 * See the License for the specific language governing permissions and
    015 * limitations under the License.
    016 */
    017package org.apache.commons.dbcp2;
    018
    019import java.io.InputStream;
    020import java.io.Reader;
    021import java.math.BigDecimal;
    022import java.sql.Array;
    023import java.sql.Blob;
    024import java.sql.Clob;
    025import java.sql.Connection;
    026import java.sql.Date;
    027import java.sql.NClob;
    028import java.sql.Ref;
    029import java.sql.ResultSet;
    030import java.sql.ResultSetMetaData;
    031import java.sql.RowId;
    032import java.sql.SQLException;
    033import java.sql.SQLType;
    034import java.sql.SQLWarning;
    035import java.sql.SQLXML;
    036import java.sql.Statement;
    037import java.sql.Time;
    038import java.sql.Timestamp;
    039import java.util.Calendar;
    040import java.util.Map;
    041
    042/**
    043 * A base delegating implementation of {@link ResultSet}.
    044 * <p>
    045 * All of the methods from the {@link ResultSet} interface simply call the corresponding method on the "delegate"
    046 * provided in my constructor.
    047 * </p>
    048 * <p>
    049 * Extends AbandonedTrace to implement result set tracking and logging of code which created the ResultSet. Tracking the
    050 * ResultSet ensures that the Statement which created it can close any open ResultSet's on Statement close.
    051 * </p>
    052 *
    053 * @since 2.0
    054 */
    055public final class DelegatingResultSet extends AbandonedTrace implements ResultSet {
    056
    057    /**
    058     * Wraps the given result set in a delegate.
    059     *
    060     * @param connection
    061     *            The Connection which created the ResultSet.
    062     * @param resultSet
    063     *            The ResultSet to wrap.
    064     * @return a new delegate.
    065     */
    066    public static ResultSet wrapResultSet(final Connection connection, final ResultSet resultSet) {
    067        if (null == resultSet) {
    068            return null;
    069        }
    070        return new DelegatingResultSet(connection, resultSet);
    071    }
    072
    073    /**
    074     * Wraps the given result set in a delegate.
    075     *
    076     * @param statement
    077     *            The Statement which created the ResultSet.
    078     * @param resultSet
    079     *            The ResultSet to wrap.
    080     * @return a new delegate.
    081     */
    082    public static ResultSet wrapResultSet(final Statement statement, final ResultSet resultSet) {
    083        if (null == resultSet) {
    084            return null;
    085        }
    086        return new DelegatingResultSet(statement, resultSet);
    087    }
    088
    089    /** My delegate. **/
    090    private final ResultSet resultSet;
    091
    092    /** The Statement that created me, if any. **/
    093    private Statement statement;
    094
    095    /** The Connection that created me, if any. **/
    096    private Connection connection;
    097
    098    /**
    099     * Creates a wrapper for the ResultSet which traces this ResultSet to the Connection which created it (via, for
    100     * example DatabaseMetadata), and the code which created it.
    101     * <p>
    102     * Private to ensure all construction is {@link #wrapResultSet(Connection, ResultSet)}
    103     * </p>
    104     *
    105     * @param connection
    106     *            Connection which created this ResultSet
    107     * @param resultSet
    108     *            ResultSet to wrap
    109     */
    110    private DelegatingResultSet(final Connection connection, final ResultSet resultSet) {
    111        super((AbandonedTrace) connection);
    112        this.connection = connection;
    113        this.resultSet = resultSet;
    114    }
    115
    116    /**
    117     * Creates a wrapper for the ResultSet which traces this ResultSet to the Statement which created it and the code
    118     * which created it.
    119     * <p>
    120     * Private to ensure all construction is {@link #wrapResultSet(Statement, ResultSet)}
    121     * </p>
    122     *
    123     * @param statement
    124     *            The Statement which created the ResultSet.
    125     * @param resultSet
    126     *            The ResultSet to wrap.
    127     */
    128    private DelegatingResultSet(final Statement statement, final ResultSet resultSet) {
    129        super((AbandonedTrace) statement);
    130        this.statement = statement;
    131        this.resultSet = resultSet;
    132    }
    133
    134    @Override
    135    public boolean absolute(final int row) throws SQLException {
    136        try {
    137            return resultSet.absolute(row);
    138        } catch (final SQLException e) {
    139            handleException(e);
    140            return false;
    141        }
    142    }
    143
    144    @Override
    145    public void afterLast() throws SQLException {
    146        try {
    147            resultSet.afterLast();
    148        } catch (final SQLException e) {
    149            handleException(e);
    150        }
    151    }
    152
    153    @Override
    154    public void beforeFirst() throws SQLException {
    155        try {
    156            resultSet.beforeFirst();
    157        } catch (final SQLException e) {
    158            handleException(e);
    159        }
    160    }
    161
    162    @Override
    163    public void cancelRowUpdates() throws SQLException {
    164        try {
    165            resultSet.cancelRowUpdates();
    166        } catch (final SQLException e) {
    167            handleException(e);
    168        }
    169    }
    170
    171    @Override
    172    public void clearWarnings() throws SQLException {
    173        try {
    174            resultSet.clearWarnings();
    175        } catch (final SQLException e) {
    176            handleException(e);
    177        }
    178    }
    179
    180    /**
    181     * Wrapper for close of ResultSet which removes this result set from being traced then calls close on the original
    182     * ResultSet.
    183     */
    184    @Override
    185    public void close() throws SQLException {
    186        try {
    187            if (statement != null) {
    188                removeThisTrace(statement);
    189                statement = null;
    190            }
    191            if (connection != null) {
    192                removeThisTrace(connection);
    193                connection = null;
    194            }
    195            resultSet.close();
    196        } catch (final SQLException e) {
    197            handleException(e);
    198        }
    199    }
    200
    201    @Override
    202    public void deleteRow() throws SQLException {
    203        try {
    204            resultSet.deleteRow();
    205        } catch (final SQLException e) {
    206            handleException(e);
    207        }
    208    }
    209
    210    @Override
    211    public int findColumn(final String columnName) throws SQLException {
    212        try {
    213            return resultSet.findColumn(columnName);
    214        } catch (final SQLException e) {
    215            handleException(e);
    216            return 0;
    217        }
    218    }
    219
    220    @Override
    221    public boolean first() throws SQLException {
    222        try {
    223            return resultSet.first();
    224        } catch (final SQLException e) {
    225            handleException(e);
    226            return false;
    227        }
    228    }
    229
    230    @Override
    231    public Array getArray(final int i) throws SQLException {
    232        try {
    233            return resultSet.getArray(i);
    234        } catch (final SQLException e) {
    235            handleException(e);
    236            return null;
    237        }
    238    }
    239
    240    @Override
    241    public Array getArray(final String colName) throws SQLException {
    242        try {
    243            return resultSet.getArray(colName);
    244        } catch (final SQLException e) {
    245            handleException(e);
    246            return null;
    247        }
    248    }
    249
    250    @Override
    251    public InputStream getAsciiStream(final int columnIndex) throws SQLException {
    252        try {
    253            return resultSet.getAsciiStream(columnIndex);
    254        } catch (final SQLException e) {
    255            handleException(e);
    256            return null;
    257        }
    258    }
    259
    260    @Override
    261    public InputStream getAsciiStream(final String columnName) throws SQLException {
    262        try {
    263            return resultSet.getAsciiStream(columnName);
    264        } catch (final SQLException e) {
    265            handleException(e);
    266            return null;
    267        }
    268    }
    269
    270    @Override
    271    public BigDecimal getBigDecimal(final int columnIndex) throws SQLException {
    272        try {
    273            return resultSet.getBigDecimal(columnIndex);
    274        } catch (final SQLException e) {
    275            handleException(e);
    276            return null;
    277        }
    278    }
    279
    280    /** @deprecated Use {@link #getBigDecimal(int)} */
    281    @Deprecated
    282    @Override
    283    public BigDecimal getBigDecimal(final int columnIndex, final int scale) throws SQLException {
    284        try {
    285            return resultSet.getBigDecimal(columnIndex);
    286        } catch (final SQLException e) {
    287            handleException(e);
    288            return null;
    289        }
    290    }
    291
    292    @Override
    293    public BigDecimal getBigDecimal(final String columnName) throws SQLException {
    294        try {
    295            return resultSet.getBigDecimal(columnName);
    296        } catch (final SQLException e) {
    297            handleException(e);
    298            return null;
    299        }
    300    }
    301
    302    /** @deprecated Use {@link #getBigDecimal(String)} */
    303    @Deprecated
    304    @Override
    305    public BigDecimal getBigDecimal(final String columnName, final int scale) throws SQLException {
    306        try {
    307            return resultSet.getBigDecimal(columnName);
    308        } catch (final SQLException e) {
    309            handleException(e);
    310            return null;
    311        }
    312    }
    313
    314    @Override
    315    public InputStream getBinaryStream(final int columnIndex) throws SQLException {
    316        try {
    317            return resultSet.getBinaryStream(columnIndex);
    318        } catch (final SQLException e) {
    319            handleException(e);
    320            return null;
    321        }
    322    }
    323
    324    @Override
    325    public InputStream getBinaryStream(final String columnName) throws SQLException {
    326        try {
    327            return resultSet.getBinaryStream(columnName);
    328        } catch (final SQLException e) {
    329            handleException(e);
    330            return null;
    331        }
    332    }
    333
    334    @Override
    335    public Blob getBlob(final int i) throws SQLException {
    336        try {
    337            return resultSet.getBlob(i);
    338        } catch (final SQLException e) {
    339            handleException(e);
    340            return null;
    341        }
    342    }
    343
    344    @Override
    345    public Blob getBlob(final String colName) throws SQLException {
    346        try {
    347            return resultSet.getBlob(colName);
    348        } catch (final SQLException e) {
    349            handleException(e);
    350            return null;
    351        }
    352    }
    353
    354    @Override
    355    public boolean getBoolean(final int columnIndex) throws SQLException {
    356        try {
    357            return resultSet.getBoolean(columnIndex);
    358        } catch (final SQLException e) {
    359            handleException(e);
    360            return false;
    361        }
    362    }
    363
    364    @Override
    365    public boolean getBoolean(final String columnName) throws SQLException {
    366        try {
    367            return resultSet.getBoolean(columnName);
    368        } catch (final SQLException e) {
    369            handleException(e);
    370            return false;
    371        }
    372    }
    373
    374    @Override
    375    public byte getByte(final int columnIndex) throws SQLException {
    376        try {
    377            return resultSet.getByte(columnIndex);
    378        } catch (final SQLException e) {
    379            handleException(e);
    380            return 0;
    381        }
    382    }
    383
    384    @Override
    385    public byte getByte(final String columnName) throws SQLException {
    386        try {
    387            return resultSet.getByte(columnName);
    388        } catch (final SQLException e) {
    389            handleException(e);
    390            return 0;
    391        }
    392    }
    393
    394    @Override
    395    public byte[] getBytes(final int columnIndex) throws SQLException {
    396        try {
    397            return resultSet.getBytes(columnIndex);
    398        } catch (final SQLException e) {
    399            handleException(e);
    400            return null;
    401        }
    402    }
    403
    404    @Override
    405    public byte[] getBytes(final String columnName) throws SQLException {
    406        try {
    407            return resultSet.getBytes(columnName);
    408        } catch (final SQLException e) {
    409            handleException(e);
    410            return null;
    411        }
    412    }
    413
    414    @Override
    415    public Reader getCharacterStream(final int columnIndex) throws SQLException {
    416        try {
    417            return resultSet.getCharacterStream(columnIndex);
    418        } catch (final SQLException e) {
    419            handleException(e);
    420            return null;
    421        }
    422    }
    423
    424    @Override
    425    public Reader getCharacterStream(final String columnName) throws SQLException {
    426        try {
    427            return resultSet.getCharacterStream(columnName);
    428        } catch (final SQLException e) {
    429            handleException(e);
    430            return null;
    431        }
    432    }
    433
    434    @Override
    435    public Clob getClob(final int i) throws SQLException {
    436        try {
    437            return resultSet.getClob(i);
    438        } catch (final SQLException e) {
    439            handleException(e);
    440            return null;
    441        }
    442    }
    443
    444    @Override
    445    public Clob getClob(final String colName) throws SQLException {
    446        try {
    447            return resultSet.getClob(colName);
    448        } catch (final SQLException e) {
    449            handleException(e);
    450            return null;
    451        }
    452    }
    453
    454    @Override
    455    public int getConcurrency() throws SQLException {
    456        try {
    457            return resultSet.getConcurrency();
    458        } catch (final SQLException e) {
    459            handleException(e);
    460            return 0;
    461        }
    462    }
    463
    464    @Override
    465    public String getCursorName() throws SQLException {
    466        try {
    467            return resultSet.getCursorName();
    468        } catch (final SQLException e) {
    469            handleException(e);
    470            return null;
    471        }
    472    }
    473
    474    @Override
    475    public Date getDate(final int columnIndex) throws SQLException {
    476        try {
    477            return resultSet.getDate(columnIndex);
    478        } catch (final SQLException e) {
    479            handleException(e);
    480            return null;
    481        }
    482    }
    483
    484    @Override
    485    public Date getDate(final int columnIndex, final Calendar cal) throws SQLException {
    486        try {
    487            return resultSet.getDate(columnIndex, cal);
    488        } catch (final SQLException e) {
    489            handleException(e);
    490            return null;
    491        }
    492    }
    493
    494    @Override
    495    public Date getDate(final String columnName) throws SQLException {
    496        try {
    497            return resultSet.getDate(columnName);
    498        } catch (final SQLException e) {
    499            handleException(e);
    500            return null;
    501        }
    502    }
    503
    504    @Override
    505    public Date getDate(final String columnName, final Calendar cal) throws SQLException {
    506        try {
    507            return resultSet.getDate(columnName, cal);
    508        } catch (final SQLException e) {
    509            handleException(e);
    510            return null;
    511        }
    512    }
    513
    514    /**
    515     * Gets my delegate.
    516     *
    517     * @return my delegate.
    518     */
    519    public ResultSet getDelegate() {
    520        return resultSet;
    521    }
    522
    523    @Override
    524    public double getDouble(final int columnIndex) throws SQLException {
    525        try {
    526            return resultSet.getDouble(columnIndex);
    527        } catch (final SQLException e) {
    528            handleException(e);
    529            return 0;
    530        }
    531    }
    532
    533    @Override
    534    public double getDouble(final String columnName) throws SQLException {
    535        try {
    536            return resultSet.getDouble(columnName);
    537        } catch (final SQLException e) {
    538            handleException(e);
    539            return 0;
    540        }
    541    }
    542
    543    @Override
    544    public int getFetchDirection() throws SQLException {
    545        try {
    546            return resultSet.getFetchDirection();
    547        } catch (final SQLException e) {
    548            handleException(e);
    549            return 0;
    550        }
    551    }
    552
    553    @Override
    554    public int getFetchSize() throws SQLException {
    555        try {
    556            return resultSet.getFetchSize();
    557        } catch (final SQLException e) {
    558            handleException(e);
    559            return 0;
    560        }
    561    }
    562
    563    @Override
    564    public float getFloat(final int columnIndex) throws SQLException {
    565        try {
    566            return resultSet.getFloat(columnIndex);
    567        } catch (final SQLException e) {
    568            handleException(e);
    569            return 0;
    570        }
    571    }
    572
    573    @Override
    574    public float getFloat(final String columnName) throws SQLException {
    575        try {
    576            return resultSet.getFloat(columnName);
    577        } catch (final SQLException e) {
    578            handleException(e);
    579            return 0;
    580        }
    581    }
    582
    583    @Override
    584    public int getHoldability() throws SQLException {
    585        try {
    586            return resultSet.getHoldability();
    587        } catch (final SQLException e) {
    588            handleException(e);
    589            return 0;
    590        }
    591    }
    592
    593    /**
    594     * If my underlying {@link ResultSet} is not a {@link DelegatingResultSet}, returns it, otherwise recursively
    595     * invokes this method on my delegate.
    596     * <p>
    597     * Hence this method will return the first delegate that is not a {@link DelegatingResultSet}, or {@code null} when
    598     * no non-{@link DelegatingResultSet} delegate can be found by traversing this chain.
    599     * </p>
    600     * <p>
    601     * This method is useful when you may have nested {@link DelegatingResultSet}s, and you want to make sure to obtain
    602     * a "genuine" {@link ResultSet}.
    603     * </p>
    604     *
    605     * @return the innermost delegate.
    606     */
    607    @SuppressWarnings("resource")
    608    public ResultSet getInnermostDelegate() {
    609        ResultSet r = resultSet;
    610        while (r instanceof DelegatingResultSet) {
    611            r = ((DelegatingResultSet) r).getDelegate();
    612            if (this == r) {
    613                return null;
    614            }
    615        }
    616        return r;
    617    }
    618
    619    @Override
    620    public int getInt(final int columnIndex) throws SQLException {
    621        try {
    622            return resultSet.getInt(columnIndex);
    623        } catch (final SQLException e) {
    624            handleException(e);
    625            return 0;
    626        }
    627    }
    628
    629    @Override
    630    public int getInt(final String columnName) throws SQLException {
    631        try {
    632            return resultSet.getInt(columnName);
    633        } catch (final SQLException e) {
    634            handleException(e);
    635            return 0;
    636        }
    637    }
    638
    639    @Override
    640    public long getLong(final int columnIndex) throws SQLException {
    641        try {
    642            return resultSet.getLong(columnIndex);
    643        } catch (final SQLException e) {
    644            handleException(e);
    645            return 0;
    646        }
    647    }
    648
    649    @Override
    650    public long getLong(final String columnName) throws SQLException {
    651        try {
    652            return resultSet.getLong(columnName);
    653        } catch (final SQLException e) {
    654            handleException(e);
    655            return 0;
    656        }
    657    }
    658
    659    @Override
    660    public ResultSetMetaData getMetaData() throws SQLException {
    661        try {
    662            return resultSet.getMetaData();
    663        } catch (final SQLException e) {
    664            handleException(e);
    665            return null;
    666        }
    667    }
    668
    669    @Override
    670    public Reader getNCharacterStream(final int columnIndex) throws SQLException {
    671        try {
    672            return resultSet.getNCharacterStream(columnIndex);
    673        } catch (final SQLException e) {
    674            handleException(e);
    675            return null;
    676        }
    677    }
    678
    679    @Override
    680    public Reader getNCharacterStream(final String columnLabel) throws SQLException {
    681        try {
    682            return resultSet.getNCharacterStream(columnLabel);
    683        } catch (final SQLException e) {
    684            handleException(e);
    685            return null;
    686        }
    687    }
    688
    689    @Override
    690    public NClob getNClob(final int columnIndex) throws SQLException {
    691        try {
    692            return resultSet.getNClob(columnIndex);
    693        } catch (final SQLException e) {
    694            handleException(e);
    695            return null;
    696        }
    697    }
    698
    699    @Override
    700    public NClob getNClob(final String columnLabel) throws SQLException {
    701        try {
    702            return resultSet.getNClob(columnLabel);
    703        } catch (final SQLException e) {
    704            handleException(e);
    705            return null;
    706        }
    707    }
    708
    709    @Override
    710    public String getNString(final int columnIndex) throws SQLException {
    711        try {
    712            return resultSet.getNString(columnIndex);
    713        } catch (final SQLException e) {
    714            handleException(e);
    715            return null;
    716        }
    717    }
    718
    719    @Override
    720    public String getNString(final String columnLabel) throws SQLException {
    721        try {
    722            return resultSet.getNString(columnLabel);
    723        } catch (final SQLException e) {
    724            handleException(e);
    725            return null;
    726        }
    727    }
    728
    729    @Override
    730    public Object getObject(final int columnIndex) throws SQLException {
    731        try {
    732            return resultSet.getObject(columnIndex);
    733        } catch (final SQLException e) {
    734            handleException(e);
    735            return null;
    736        }
    737    }
    738
    739    @Override
    740    public <T> T getObject(final int columnIndex, final Class<T> type) throws SQLException {
    741        try {
    742            return Jdbc41Bridge.getObject(resultSet, columnIndex, type);
    743        } catch (final SQLException e) {
    744            handleException(e);
    745            return null;
    746        }
    747    }
    748
    749    @Override
    750    public Object getObject(final int i, final Map<String, Class<?>> map) throws SQLException {
    751        try {
    752            return resultSet.getObject(i, map);
    753        } catch (final SQLException e) {
    754            handleException(e);
    755            return null;
    756        }
    757    }
    758
    759    @Override
    760    public Object getObject(final String columnName) throws SQLException {
    761        try {
    762            return resultSet.getObject(columnName);
    763        } catch (final SQLException e) {
    764            handleException(e);
    765            return null;
    766        }
    767    }
    768
    769    @Override
    770    public <T> T getObject(final String columnLabel, final Class<T> type) throws SQLException {
    771        try {
    772            return Jdbc41Bridge.getObject(resultSet, columnLabel, type);
    773        } catch (final SQLException e) {
    774            handleException(e);
    775            return null;
    776        }
    777    }
    778
    779    @Override
    780    public Object getObject(final String colName, final Map<String, Class<?>> map) throws SQLException {
    781        try {
    782            return resultSet.getObject(colName, map);
    783        } catch (final SQLException e) {
    784            handleException(e);
    785            return null;
    786        }
    787    }
    788
    789    @Override
    790    public Ref getRef(final int i) throws SQLException {
    791        try {
    792            return resultSet.getRef(i);
    793        } catch (final SQLException e) {
    794            handleException(e);
    795            return null;
    796        }
    797    }
    798
    799    @Override
    800    public Ref getRef(final String colName) throws SQLException {
    801        try {
    802            return resultSet.getRef(colName);
    803        } catch (final SQLException e) {
    804            handleException(e);
    805            return null;
    806        }
    807    }
    808
    809    @Override
    810    public int getRow() throws SQLException {
    811        try {
    812            return resultSet.getRow();
    813        } catch (final SQLException e) {
    814            handleException(e);
    815            return 0;
    816        }
    817    }
    818
    819    @Override
    820    public RowId getRowId(final int columnIndex) throws SQLException {
    821        try {
    822            return resultSet.getRowId(columnIndex);
    823        } catch (final SQLException e) {
    824            handleException(e);
    825            return null;
    826        }
    827    }
    828
    829    @Override
    830    public RowId getRowId(final String columnLabel) throws SQLException {
    831        try {
    832            return resultSet.getRowId(columnLabel);
    833        } catch (final SQLException e) {
    834            handleException(e);
    835            return null;
    836        }
    837    }
    838
    839    @Override
    840    public short getShort(final int columnIndex) throws SQLException {
    841        try {
    842            return resultSet.getShort(columnIndex);
    843        } catch (final SQLException e) {
    844            handleException(e);
    845            return 0;
    846        }
    847    }
    848
    849    @Override
    850    public short getShort(final String columnName) throws SQLException {
    851        try {
    852            return resultSet.getShort(columnName);
    853        } catch (final SQLException e) {
    854            handleException(e);
    855            return 0;
    856        }
    857    }
    858
    859    @Override
    860    public SQLXML getSQLXML(final int columnIndex) throws SQLException {
    861        try {
    862            return resultSet.getSQLXML(columnIndex);
    863        } catch (final SQLException e) {
    864            handleException(e);
    865            return null;
    866        }
    867    }
    868
    869    @Override
    870    public SQLXML getSQLXML(final String columnLabel) throws SQLException {
    871        try {
    872            return resultSet.getSQLXML(columnLabel);
    873        } catch (final SQLException e) {
    874            handleException(e);
    875            return null;
    876        }
    877    }
    878
    879    @Override
    880    public Statement getStatement() throws SQLException {
    881        return statement;
    882    }
    883
    884    @Override
    885    public String getString(final int columnIndex) throws SQLException {
    886        try {
    887            return resultSet.getString(columnIndex);
    888        } catch (final SQLException e) {
    889            handleException(e);
    890            return null;
    891        }
    892    }
    893
    894    @Override
    895    public String getString(final String columnName) throws SQLException {
    896        try {
    897            return resultSet.getString(columnName);
    898        } catch (final SQLException e) {
    899            handleException(e);
    900            return null;
    901        }
    902    }
    903
    904    @Override
    905    public Time getTime(final int columnIndex) throws SQLException {
    906        try {
    907            return resultSet.getTime(columnIndex);
    908        } catch (final SQLException e) {
    909            handleException(e);
    910            return null;
    911        }
    912    }
    913
    914    @Override
    915    public Time getTime(final int columnIndex, final Calendar cal) throws SQLException {
    916        try {
    917            return resultSet.getTime(columnIndex, cal);
    918        } catch (final SQLException e) {
    919            handleException(e);
    920            return null;
    921        }
    922    }
    923
    924    @Override
    925    public Time getTime(final String columnName) throws SQLException {
    926        try {
    927            return resultSet.getTime(columnName);
    928        } catch (final SQLException e) {
    929            handleException(e);
    930            return null;
    931        }
    932    }
    933
    934    @Override
    935    public Time getTime(final String columnName, final Calendar cal) throws SQLException {
    936        try {
    937            return resultSet.getTime(columnName, cal);
    938        } catch (final SQLException e) {
    939            handleException(e);
    940            return null;
    941        }
    942    }
    943
    944    @Override
    945    public Timestamp getTimestamp(final int columnIndex) throws SQLException {
    946        try {
    947            return resultSet.getTimestamp(columnIndex);
    948        } catch (final SQLException e) {
    949            handleException(e);
    950            return null;
    951        }
    952    }
    953
    954    @Override
    955    public Timestamp getTimestamp(final int columnIndex, final Calendar cal) throws SQLException {
    956        try {
    957            return resultSet.getTimestamp(columnIndex, cal);
    958        } catch (final SQLException e) {
    959            handleException(e);
    960            return null;
    961        }
    962    }
    963
    964    @Override
    965    public Timestamp getTimestamp(final String columnName) throws SQLException {
    966        try {
    967            return resultSet.getTimestamp(columnName);
    968        } catch (final SQLException e) {
    969            handleException(e);
    970            return null;
    971        }
    972    }
    973
    974    @Override
    975    public Timestamp getTimestamp(final String columnName, final Calendar cal) throws SQLException {
    976        try {
    977            return resultSet.getTimestamp(columnName, cal);
    978        } catch (final SQLException e) {
    979            handleException(e);
    980            return null;
    981        }
    982    }
    983
    984    @Override
    985    public int getType() throws SQLException {
    986        try {
    987            return resultSet.getType();
    988        } catch (final SQLException e) {
    989            handleException(e);
    990            return 0;
    991        }
    992    }
    993
    994    /** @deprecated Use {@link #getCharacterStream(int)} */
    995    @Deprecated
    996    @Override
    997    public InputStream getUnicodeStream(final int columnIndex) throws SQLException {
    998        try {
    999            return resultSet.getUnicodeStream(columnIndex);
    1000        } catch (final SQLException e) {
    1001            handleException(e);
    1002            return null;
    1003        }
    1004    }
    1005
    1006    /** @deprecated Use {@link #getCharacterStream(String)} */
    1007    @Deprecated
    1008    @Override
    1009    public InputStream getUnicodeStream(final String columnName) throws SQLException {
    1010        try {
    1011            return resultSet.getUnicodeStream(columnName);
    1012        } catch (final SQLException e) {
    1013            handleException(e);
    1014            return null;
    1015        }
    1016    }
    1017
    1018    @Override
    1019    public java.net.URL getURL(final int columnIndex) throws SQLException {
    1020        try {
    1021            return resultSet.getURL(columnIndex);
    1022        } catch (final SQLException e) {
    1023            handleException(e);
    1024            return null;
    1025        }
    1026    }
    1027
    1028    @Override
    1029    public java.net.URL getURL(final String columnName) throws SQLException {
    1030        try {
    1031            return resultSet.getURL(columnName);
    1032        } catch (final SQLException e) {
    1033            handleException(e);
    1034            return null;
    1035        }
    1036    }
    1037
    1038    @Override
    1039    public SQLWarning getWarnings() throws SQLException {
    1040        try {
    1041            return resultSet.getWarnings();
    1042        } catch (final SQLException e) {
    1043            handleException(e);
    1044            return null;
    1045        }
    1046    }
    1047
    1048    /**
    1049     * Handles a SQL exception by delegating to a DelegatingStatement or DelegatingConnection.
    1050     *
    1051     * @param e The exception to handle.
    1052     * @throws SQLException Throws the given exception if not handled.
    1053     */
    1054    protected void handleException(final SQLException e) throws SQLException {
    1055        if (statement instanceof DelegatingStatement) {
    1056            ((DelegatingStatement) statement).handleException(e);
    1057        } else if (connection instanceof DelegatingConnection) {
    1058            ((DelegatingConnection<?>) connection).handleException(e);
    1059        } else {
    1060            throw e;
    1061        }
    1062    }
    1063
    1064    @Override
    1065    public void insertRow() throws SQLException {
    1066        try {
    1067            resultSet.insertRow();
    1068        } catch (final SQLException e) {
    1069            handleException(e);
    1070        }
    1071    }
    1072
    1073    @Override
    1074    public boolean isAfterLast() throws SQLException {
    1075        try {
    1076            return resultSet.isAfterLast();
    1077        } catch (final SQLException e) {
    1078            handleException(e);
    1079            return false;
    1080        }
    1081    }
    1082
    1083    @Override
    1084    public boolean isBeforeFirst() throws SQLException {
    1085        try {
    1086            return resultSet.isBeforeFirst();
    1087        } catch (final SQLException e) {
    1088            handleException(e);
    1089            return false;
    1090        }
    1091    }
    1092
    1093    @Override
    1094    public boolean isClosed() throws SQLException {
    1095        try {
    1096            return resultSet.isClosed();
    1097        } catch (final SQLException e) {
    1098            handleException(e);
    1099            return false;
    1100        }
    1101    }
    1102
    1103    @Override
    1104    public boolean isFirst() throws SQLException {
    1105        try {
    1106            return resultSet.isFirst();
    1107        } catch (final SQLException e) {
    1108            handleException(e);
    1109            return false;
    1110        }
    1111    }
    1112
    1113    @Override
    1114    public boolean isLast() throws SQLException {
    1115        try {
    1116            return resultSet.isLast();
    1117        } catch (final SQLException e) {
    1118            handleException(e);
    1119            return false;
    1120        }
    1121    }
    1122
    1123    @Override
    1124    public boolean isWrapperFor(final Class<?> iface) throws SQLException {
    1125        if (iface.isAssignableFrom(getClass()) || iface.isAssignableFrom(resultSet.getClass())) {
    1126            return true;
    1127        }
    1128        return resultSet.isWrapperFor(iface);
    1129    }
    1130
    1131    @Override
    1132    public boolean last() throws SQLException {
    1133        try {
    1134            return resultSet.last();
    1135        } catch (final SQLException e) {
    1136            handleException(e);
    1137            return false;
    1138        }
    1139    }
    1140
    1141    @Override
    1142    public void moveToCurrentRow() throws SQLException {
    1143        try {
    1144            resultSet.moveToCurrentRow();
    1145        } catch (final SQLException e) {
    1146            handleException(e);
    1147        }
    1148    }
    1149
    1150    @Override
    1151    public void moveToInsertRow() throws SQLException {
    1152        try {
    1153            resultSet.moveToInsertRow();
    1154        } catch (final SQLException e) {
    1155            handleException(e);
    1156        }
    1157    }
    1158
    1159    @Override
    1160    public boolean next() throws SQLException {
    1161        try {
    1162            return resultSet.next();
    1163        } catch (final SQLException e) {
    1164            handleException(e);
    1165            return false;
    1166        }
    1167    }
    1168
    1169    @Override
    1170    public boolean previous() throws SQLException {
    1171        try {
    1172            return resultSet.previous();
    1173        } catch (final SQLException e) {
    1174            handleException(e);
    1175            return false;
    1176        }
    1177    }
    1178
    1179    @Override
    1180    public void refreshRow() throws SQLException {
    1181        try {
    1182            resultSet.refreshRow();
    1183        } catch (final SQLException e) {
    1184            handleException(e);
    1185        }
    1186    }
    1187
    1188    @Override
    1189    public boolean relative(final int rows) throws SQLException {
    1190        try {
    1191            return resultSet.relative(rows);
    1192        } catch (final SQLException e) {
    1193            handleException(e);
    1194            return false;
    1195        }
    1196    }
    1197
    1198    @Override
    1199    public boolean rowDeleted() throws SQLException {
    1200        try {
    1201            return resultSet.rowDeleted();
    1202        } catch (final SQLException e) {
    1203            handleException(e);
    1204            return false;
    1205        }
    1206    }
    1207
    1208    @Override
    1209    public boolean rowInserted() throws SQLException {
    1210        try {
    1211            return resultSet.rowInserted();
    1212        } catch (final SQLException e) {
    1213            handleException(e);
    1214            return false;
    1215        }
    1216    }
    1217
    1218    @Override
    1219    public boolean rowUpdated() throws SQLException {
    1220        try {
    1221            return resultSet.rowUpdated();
    1222        } catch (final SQLException e) {
    1223            handleException(e);
    1224            return false;
    1225        }
    1226    }
    1227
    1228    @Override
    1229    public void setFetchDirection(final int direction) throws SQLException {
    1230        try {
    1231            resultSet.setFetchDirection(direction);
    1232        } catch (final SQLException e) {
    1233            handleException(e);
    1234        }
    1235    }
    1236
    1237    @Override
    1238    public void setFetchSize(final int rows) throws SQLException {
    1239        try {
    1240            resultSet.setFetchSize(rows);
    1241        } catch (final SQLException e) {
    1242            handleException(e);
    1243        }
    1244    }
    1245
    1246    @Override
    1247    public synchronized String toString() {
    1248        return super.toString() + "[resultSet=" + resultSet + ", statement=" + statement + ", connection=" + connection + "]";
    1249    }
    1250
    1251    @Override
    1252    public <T> T unwrap(final Class<T> iface) throws SQLException {
    1253        if (iface.isAssignableFrom(getClass())) {
    1254            return iface.cast(this);
    1255        }
    1256        if (iface.isAssignableFrom(resultSet.getClass())) {
    1257            return iface.cast(resultSet);
    1258        }
    1259        return resultSet.unwrap(iface);
    1260    }
    1261
    1262    @Override
    1263    public void updateArray(final int columnIndex, final Array x) throws SQLException {
    1264        try {
    1265            resultSet.updateArray(columnIndex, x);
    1266        } catch (final SQLException e) {
    1267            handleException(e);
    1268        }
    1269    }
    1270
    1271    @Override
    1272    public void updateArray(final String columnName, final Array x) throws SQLException {
    1273        try {
    1274            resultSet.updateArray(columnName, x);
    1275        } catch (final SQLException e) {
    1276            handleException(e);
    1277        }
    1278    }
    1279
    1280    @Override
    1281    public void updateAsciiStream(final int columnIndex, final InputStream inputStream) throws SQLException {
    1282        try {
    1283            resultSet.updateAsciiStream(columnIndex, inputStream);
    1284        } catch (final SQLException e) {
    1285            handleException(e);
    1286        }
    1287    }
    1288
    1289    @Override
    1290    public void updateAsciiStream(final int columnIndex, final InputStream x, final int length) throws SQLException {
    1291        try {
    1292            resultSet.updateAsciiStream(columnIndex, x, length);
    1293        } catch (final SQLException e) {
    1294            handleException(e);
    1295        }
    1296    }
    1297
    1298    @Override
    1299    public void updateAsciiStream(final int columnIndex, final InputStream inputStream, final long length)
    1300            throws SQLException {
    1301        try {
    1302            resultSet.updateAsciiStream(columnIndex, inputStream, length);
    1303        } catch (final SQLException e) {
    1304            handleException(e);
    1305        }
    1306    }
    1307
    1308    @Override
    1309    public void updateAsciiStream(final String columnLabel, final InputStream inputStream) throws SQLException {
    1310        try {
    1311            resultSet.updateAsciiStream(columnLabel, inputStream);
    1312        } catch (final SQLException e) {
    1313            handleException(e);
    1314        }
    1315    }
    1316
    1317    @Override
    1318    public void updateAsciiStream(final String columnName, final InputStream x, final int length) throws SQLException {
    1319        try {
    1320            resultSet.updateAsciiStream(columnName, x, length);
    1321        } catch (final SQLException e) {
    1322            handleException(e);
    1323        }
    1324    }
    1325
    1326    @Override
    1327    public void updateAsciiStream(final String columnLabel, final InputStream inputStream, final long length)
    1328            throws SQLException {
    1329        try {
    1330            resultSet.updateAsciiStream(columnLabel, inputStream, length);
    1331        } catch (final SQLException e) {
    1332            handleException(e);
    1333        }
    1334    }
    1335
    1336    @Override
    1337    public void updateBigDecimal(final int columnIndex, final BigDecimal x) throws SQLException {
    1338        try {
    1339            resultSet.updateBigDecimal(columnIndex, x);
    1340        } catch (final SQLException e) {
    1341            handleException(e);
    1342        }
    1343    }
    1344
    1345    @Override
    1346    public void updateBigDecimal(final String columnName, final BigDecimal x) throws SQLException {
    1347        try {
    1348            resultSet.updateBigDecimal(columnName, x);
    1349        } catch (final SQLException e) {
    1350            handleException(e);
    1351        }
    1352    }
    1353
    1354    @Override
    1355    public void updateBinaryStream(final int columnIndex, final InputStream inputStream) throws SQLException {
    1356        try {
    1357            resultSet.updateBinaryStream(columnIndex, inputStream);
    1358        } catch (final SQLException e) {
    1359            handleException(e);
    1360        }
    1361    }
    1362
    1363    @Override
    1364    public void updateBinaryStream(final int columnIndex, final InputStream x, final int length) throws SQLException {
    1365        try {
    1366            resultSet.updateBinaryStream(columnIndex, x, length);
    1367        } catch (final SQLException e) {
    1368            handleException(e);
    1369        }
    1370    }
    1371
    1372    @Override
    1373    public void updateBinaryStream(final int columnIndex, final InputStream inputStream, final long length)
    1374            throws SQLException {
    1375        try {
    1376            resultSet.updateBinaryStream(columnIndex, inputStream, length);
    1377        } catch (final SQLException e) {
    1378            handleException(e);
    1379        }
    1380    }
    1381
    1382    @Override
    1383    public void updateBinaryStream(final String columnLabel, final InputStream inputStream) throws SQLException {
    1384        try {
    1385            resultSet.updateBinaryStream(columnLabel, inputStream);
    1386        } catch (final SQLException e) {
    1387            handleException(e);
    1388        }
    1389    }
    1390
    1391    @Override
    1392    public void updateBinaryStream(final String columnName, final InputStream x, final int length) throws SQLException {
    1393        try {
    1394            resultSet.updateBinaryStream(columnName, x, length);
    1395        } catch (final SQLException e) {
    1396            handleException(e);
    1397        }
    1398    }
    1399
    1400    @Override
    1401    public void updateBinaryStream(final String columnLabel, final InputStream inputStream, final long length)
    1402            throws SQLException {
    1403        try {
    1404            resultSet.updateBinaryStream(columnLabel, inputStream, length);
    1405        } catch (final SQLException e) {
    1406            handleException(e);
    1407        }
    1408    }
    1409
    1410    @Override
    1411    public void updateBlob(final int columnIndex, final Blob x) throws SQLException {
    1412        try {
    1413            resultSet.updateBlob(columnIndex, x);
    1414        } catch (final SQLException e) {
    1415            handleException(e);
    1416        }
    1417    }
    1418
    1419    @Override
    1420    public void updateBlob(final int columnIndex, final InputStream inputStream) throws SQLException {
    1421        try {
    1422            resultSet.updateBlob(columnIndex, inputStream);
    1423        } catch (final SQLException e) {
    1424            handleException(e);
    1425        }
    1426    }
    1427
    1428    @Override
    1429    public void updateBlob(final int columnIndex, final InputStream inputStream, final long length)
    1430            throws SQLException {
    1431        try {
    1432            resultSet.updateBlob(columnIndex, inputStream, length);
    1433        } catch (final SQLException e) {
    1434            handleException(e);
    1435        }
    1436    }
    1437
    1438    @Override
    1439    public void updateBlob(final String columnName, final Blob x) throws SQLException {
    1440        try {
    1441            resultSet.updateBlob(columnName, x);
    1442        } catch (final SQLException e) {
    1443            handleException(e);
    1444        }
    1445    }
    1446
    1447    @Override
    1448    public void updateBlob(final String columnLabel, final InputStream inputStream) throws SQLException {
    1449        try {
    1450            resultSet.updateBlob(columnLabel, inputStream);
    1451        } catch (final SQLException e) {
    1452            handleException(e);
    1453        }
    1454    }
    1455
    1456    @Override
    1457    public void updateBlob(final String columnLabel, final InputStream inputStream, final long length)
    1458            throws SQLException {
    1459        try {
    1460            resultSet.updateBlob(columnLabel, inputStream, length);
    1461        } catch (final SQLException e) {
    1462            handleException(e);
    1463        }
    1464    }
    1465
    1466    @Override
    1467    public void updateBoolean(final int columnIndex, final boolean x) throws SQLException {
    1468        try {
    1469            resultSet.updateBoolean(columnIndex, x);
    1470        } catch (final SQLException e) {
    1471            handleException(e);
    1472        }
    1473    }
    1474
    1475    @Override
    1476    public void updateBoolean(final String columnName, final boolean x) throws SQLException {
    1477        try {
    1478            resultSet.updateBoolean(columnName, x);
    1479        } catch (final SQLException e) {
    1480            handleException(e);
    1481        }
    1482    }
    1483
    1484    @Override
    1485    public void updateByte(final int columnIndex, final byte x) throws SQLException {
    1486        try {
    1487            resultSet.updateByte(columnIndex, x);
    1488        } catch (final SQLException e) {
    1489            handleException(e);
    1490        }
    1491    }
    1492
    1493    @Override
    1494    public void updateByte(final String columnName, final byte x) throws SQLException {
    1495        try {
    1496            resultSet.updateByte(columnName, x);
    1497        } catch (final SQLException e) {
    1498            handleException(e);
    1499        }
    1500    }
    1501
    1502    @Override
    1503    public void updateBytes(final int columnIndex, final byte[] x) throws SQLException {
    1504        try {
    1505            resultSet.updateBytes(columnIndex, x);
    1506        } catch (final SQLException e) {
    1507            handleException(e);
    1508        }
    1509    }
    1510
    1511    @Override
    1512    public void updateBytes(final String columnName, final byte[] x) throws SQLException {
    1513        try {
    1514            resultSet.updateBytes(columnName, x);
    1515        } catch (final SQLException e) {
    1516            handleException(e);
    1517        }
    1518    }
    1519
    1520    @Override
    1521    public void updateCharacterStream(final int columnIndex, final Reader reader) throws SQLException {
    1522        try {
    1523            resultSet.updateCharacterStream(columnIndex, reader);
    1524        } catch (final SQLException e) {
    1525            handleException(e);
    1526        }
    1527    }
    1528
    1529    @Override
    1530    public void updateCharacterStream(final int columnIndex, final Reader x, final int length) throws SQLException {
    1531        try {
    1532            resultSet.updateCharacterStream(columnIndex, x, length);
    1533        } catch (final SQLException e) {
    1534            handleException(e);
    1535        }
    1536    }
    1537
    1538    @Override
    1539    public void updateCharacterStream(final int columnIndex, final Reader reader, final long length)
    1540            throws SQLException {
    1541        try {
    1542            resultSet.updateCharacterStream(columnIndex, reader, length);
    1543        } catch (final SQLException e) {
    1544            handleException(e);
    1545        }
    1546    }
    1547
    1548    @Override
    1549    public void updateCharacterStream(final String columnLabel, final Reader reader) throws SQLException {
    1550        try {
    1551            resultSet.updateCharacterStream(columnLabel, reader);
    1552        } catch (final SQLException e) {
    1553            handleException(e);
    1554        }
    1555    }
    1556
    1557    @Override
    1558    public void updateCharacterStream(final String columnName, final Reader reader, final int length)
    1559            throws SQLException {
    1560        try {
    1561            resultSet.updateCharacterStream(columnName, reader, length);
    1562        } catch (final SQLException e) {
    1563            handleException(e);
    1564        }
    1565    }
    1566
    1567    @Override
    1568    public void updateCharacterStream(final String columnLabel, final Reader reader, final long length)
    1569            throws SQLException {
    1570        try {
    1571            resultSet.updateCharacterStream(columnLabel, reader, length);
    1572        } catch (final SQLException e) {
    1573            handleException(e);
    1574        }
    1575    }
    1576
    1577    @Override
    1578    public void updateClob(final int columnIndex, final Clob x) throws SQLException {
    1579        try {
    1580            resultSet.updateClob(columnIndex, x);
    1581        } catch (final SQLException e) {
    1582            handleException(e);
    1583        }
    1584    }
    1585
    1586    @Override
    1587    public void updateClob(final int columnIndex, final Reader reader) throws SQLException {
    1588        try {
    1589            resultSet.updateClob(columnIndex, reader);
    1590        } catch (final SQLException e) {
    1591            handleException(e);
    1592        }
    1593    }
    1594
    1595    @Override
    1596    public void updateClob(final int columnIndex, final Reader reader, final long length) throws SQLException {
    1597        try {
    1598            resultSet.updateClob(columnIndex, reader, length);
    1599        } catch (final SQLException e) {
    1600            handleException(e);
    1601        }
    1602    }
    1603
    1604    @Override
    1605    public void updateClob(final String columnName, final Clob x) throws SQLException {
    1606        try {
    1607            resultSet.updateClob(columnName, x);
    1608        } catch (final SQLException e) {
    1609            handleException(e);
    1610        }
    1611    }
    1612
    1613    @Override
    1614    public void updateClob(final String columnLabel, final Reader reader) throws SQLException {
    1615        try {
    1616            resultSet.updateClob(columnLabel, reader);
    1617        } catch (final SQLException e) {
    1618            handleException(e);
    1619        }
    1620    }
    1621
    1622    @Override
    1623    public void updateClob(final String columnLabel, final Reader reader, final long length) throws SQLException {
    1624        try {
    1625            resultSet.updateClob(columnLabel, reader, length);
    1626        } catch (final SQLException e) {
    1627            handleException(e);
    1628        }
    1629    }
    1630
    1631    @Override
    1632    public void updateDate(final int columnIndex, final Date x) throws SQLException {
    1633        try {
    1634            resultSet.updateDate(columnIndex, x);
    1635        } catch (final SQLException e) {
    1636            handleException(e);
    1637        }
    1638    }
    1639
    1640    @Override
    1641    public void updateDate(final String columnName, final Date x) throws SQLException {
    1642        try {
    1643            resultSet.updateDate(columnName, x);
    1644        } catch (final SQLException e) {
    1645            handleException(e);
    1646        }
    1647    }
    1648
    1649    @Override
    1650    public void updateDouble(final int columnIndex, final double x) throws SQLException {
    1651        try {
    1652            resultSet.updateDouble(columnIndex, x);
    1653        } catch (final SQLException e) {
    1654            handleException(e);
    1655        }
    1656    }
    1657
    1658    @Override
    1659    public void updateDouble(final String columnName, final double x) throws SQLException {
    1660        try {
    1661            resultSet.updateDouble(columnName, x);
    1662        } catch (final SQLException e) {
    1663            handleException(e);
    1664        }
    1665    }
    1666
    1667    @Override
    1668    public void updateFloat(final int columnIndex, final float x) throws SQLException {
    1669        try {
    1670            resultSet.updateFloat(columnIndex, x);
    1671        } catch (final SQLException e) {
    1672            handleException(e);
    1673        }
    1674    }
    1675
    1676    @Override
    1677    public void updateFloat(final String columnName, final float x) throws SQLException {
    1678        try {
    1679            resultSet.updateFloat(columnName, x);
    1680        } catch (final SQLException e) {
    1681            handleException(e);
    1682        }
    1683    }
    1684
    1685    @Override
    1686    public void updateInt(final int columnIndex, final int x) throws SQLException {
    1687        try {
    1688            resultSet.updateInt(columnIndex, x);
    1689        } catch (final SQLException e) {
    1690            handleException(e);
    1691        }
    1692    }
    1693
    1694    @Override
    1695    public void updateInt(final String columnName, final int x) throws SQLException {
    1696        try {
    1697            resultSet.updateInt(columnName, x);
    1698        } catch (final SQLException e) {
    1699            handleException(e);
    1700        }
    1701    }
    1702
    1703    @Override
    1704    public void updateLong(final int columnIndex, final long x) throws SQLException {
    1705        try {
    1706            resultSet.updateLong(columnIndex, x);
    1707        } catch (final SQLException e) {
    1708            handleException(e);
    1709        }
    1710    }
    1711
    1712    @Override
    1713    public void updateLong(final String columnName, final long x) throws SQLException {
    1714        try {
    1715            resultSet.updateLong(columnName, x);
    1716        } catch (final SQLException e) {
    1717            handleException(e);
    1718        }
    1719    }
    1720
    1721    @Override
    1722    public void updateNCharacterStream(final int columnIndex, final Reader reader) throws SQLException {
    1723        try {
    1724            resultSet.updateNCharacterStream(columnIndex, reader);
    1725        } catch (final SQLException e) {
    1726            handleException(e);
    1727        }
    1728    }
    1729
    1730    @Override
    1731    public void updateNCharacterStream(final int columnIndex, final Reader reader, final long length)
    1732            throws SQLException {
    1733        try {
    1734            resultSet.updateNCharacterStream(columnIndex, reader, length);
    1735        } catch (final SQLException e) {
    1736            handleException(e);
    1737        }
    1738    }
    1739
    1740    @Override
    1741    public void updateNCharacterStream(final String columnLabel, final Reader reader) throws SQLException {
    1742        try {
    1743            resultSet.updateNCharacterStream(columnLabel, reader);
    1744        } catch (final SQLException e) {
    1745            handleException(e);
    1746        }
    1747    }
    1748
    1749    @Override
    1750    public void updateNCharacterStream(final String columnLabel, final Reader reader, final long length)
    1751            throws SQLException {
    1752        try {
    1753            resultSet.updateNCharacterStream(columnLabel, reader, length);
    1754        } catch (final SQLException e) {
    1755            handleException(e);
    1756        }
    1757    }
    1758
    1759    @Override
    1760    public void updateNClob(final int columnIndex, final NClob value) throws SQLException {
    1761        try {
    1762            resultSet.updateNClob(columnIndex, value);
    1763        } catch (final SQLException e) {
    1764            handleException(e);
    1765        }
    1766    }
    1767
    1768    @Override
    1769    public void updateNClob(final int columnIndex, final Reader reader) throws SQLException {
    1770        try {
    1771            resultSet.updateNClob(columnIndex, reader);
    1772        } catch (final SQLException e) {
    1773            handleException(e);
    1774        }
    1775    }
    1776
    1777    @Override
    1778    public void updateNClob(final int columnIndex, final Reader reader, final long length) throws SQLException {
    1779        try {
    1780            resultSet.updateNClob(columnIndex, reader, length);
    1781        } catch (final SQLException e) {
    1782            handleException(e);
    1783        }
    1784    }
    1785
    1786    @Override
    1787    public void updateNClob(final String columnLabel, final NClob value) throws SQLException {
    1788        try {
    1789            resultSet.updateNClob(columnLabel, value);
    1790        } catch (final SQLException e) {
    1791            handleException(e);
    1792        }
    1793    }
    1794
    1795    @Override
    1796    public void updateNClob(final String columnLabel, final Reader reader) throws SQLException {
    1797        try {
    1798            resultSet.updateNClob(columnLabel, reader);
    1799        } catch (final SQLException e) {
    1800            handleException(e);
    1801        }
    1802    }
    1803
    1804    @Override
    1805    public void updateNClob(final String columnLabel, final Reader reader, final long length) throws SQLException {
    1806        try {
    1807            resultSet.updateNClob(columnLabel, reader, length);
    1808        } catch (final SQLException e) {
    1809            handleException(e);
    1810        }
    1811    }
    1812
    1813    @Override
    1814    public void updateNString(final int columnIndex, final String value) throws SQLException {
    1815        try {
    1816            resultSet.updateNString(columnIndex, value);
    1817        } catch (final SQLException e) {
    1818            handleException(e);
    1819        }
    1820    }
    1821
    1822    @Override
    1823    public void updateNString(final String columnLabel, final String value) throws SQLException {
    1824        try {
    1825            resultSet.updateNString(columnLabel, value);
    1826        } catch (final SQLException e) {
    1827            handleException(e);
    1828        }
    1829    }
    1830
    1831    @Override
    1832    public void updateNull(final int columnIndex) throws SQLException {
    1833        try {
    1834            resultSet.updateNull(columnIndex);
    1835        } catch (final SQLException e) {
    1836            handleException(e);
    1837        }
    1838    }
    1839
    1840    @Override
    1841    public void updateNull(final String columnName) throws SQLException {
    1842        try {
    1843            resultSet.updateNull(columnName);
    1844        } catch (final SQLException e) {
    1845            handleException(e);
    1846        }
    1847    }
    1848
    1849    @Override
    1850    public void updateObject(final int columnIndex, final Object x) throws SQLException {
    1851        try {
    1852            resultSet.updateObject(columnIndex, x);
    1853        } catch (final SQLException e) {
    1854            handleException(e);
    1855        }
    1856    }
    1857
    1858    @Override
    1859    public void updateObject(final int columnIndex, final Object x, final int scale) throws SQLException {
    1860        try {
    1861            resultSet.updateObject(columnIndex, x);
    1862        } catch (final SQLException e) {
    1863            handleException(e);
    1864        }
    1865    }
    1866
    1867    /**
    1868     * @since 2.5.0
    1869     */
    1870    @Override
    1871    public void updateObject(final int columnIndex, final Object x, final SQLType targetSqlType) throws SQLException {
    1872        try {
    1873            resultSet.updateObject(columnIndex, x, targetSqlType);
    1874        } catch (final SQLException e) {
    1875            handleException(e);
    1876        }
    1877    }
    1878
    1879    /**
    1880     * @since 2.5.0
    1881     */
    1882    @Override
    1883    public void updateObject(final int columnIndex, final Object x, final SQLType targetSqlType, final int scaleOrLength) throws SQLException {
    1884        try {
    1885            resultSet.updateObject(columnIndex, x, targetSqlType, scaleOrLength);
    1886        } catch (final SQLException e) {
    1887            handleException(e);
    1888        }
    1889    }
    1890
    1891    @Override
    1892    public void updateObject(final String columnName, final Object x) throws SQLException {
    1893        try {
    1894            resultSet.updateObject(columnName, x);
    1895        } catch (final SQLException e) {
    1896            handleException(e);
    1897        }
    1898    }
    1899
    1900    @Override
    1901    public void updateObject(final String columnName, final Object x, final int scale) throws SQLException {
    1902        try {
    1903            resultSet.updateObject(columnName, x);
    1904        } catch (final SQLException e) {
    1905            handleException(e);
    1906        }
    1907    }
    1908
    1909    /**
    1910     * @since 2.5.0
    1911     */
    1912    @Override
    1913    public void updateObject(final String columnLabel, final Object x, final SQLType targetSqlType) throws SQLException {
    1914        try {
    1915            resultSet.updateObject(columnLabel, x, targetSqlType);
    1916        } catch (final SQLException e) {
    1917            handleException(e);
    1918        }
    1919    }
    1920
    1921    /**
    1922     * @since 2.5.0
    1923     */
    1924    @Override
    1925    public void updateObject(final String columnLabel, final Object x, final SQLType targetSqlType, final int scaleOrLength)
    1926            throws SQLException {
    1927        try {
    1928            resultSet.updateObject(columnLabel, x, targetSqlType, scaleOrLength);
    1929        } catch (final SQLException e) {
    1930            handleException(e);
    1931        }
    1932    }
    1933
    1934    @Override
    1935    public void updateRef(final int columnIndex, final Ref x) throws SQLException {
    1936        try {
    1937            resultSet.updateRef(columnIndex, x);
    1938        } catch (final SQLException e) {
    1939            handleException(e);
    1940        }
    1941    }
    1942
    1943    @Override
    1944    public void updateRef(final String columnName, final Ref x) throws SQLException {
    1945        try {
    1946            resultSet.updateRef(columnName, x);
    1947        } catch (final SQLException e) {
    1948            handleException(e);
    1949        }
    1950    }
    1951
    1952    @Override
    1953    public void updateRow() throws SQLException {
    1954        try {
    1955            resultSet.updateRow();
    1956        } catch (final SQLException e) {
    1957            handleException(e);
    1958        }
    1959    }
    1960
    1961    @Override
    1962    public void updateRowId(final int columnIndex, final RowId value) throws SQLException {
    1963        try {
    1964            resultSet.updateRowId(columnIndex, value);
    1965        } catch (final SQLException e) {
    1966            handleException(e);
    1967        }
    1968    }
    1969
    1970    @Override
    1971    public void updateRowId(final String columnLabel, final RowId value) throws SQLException {
    1972        try {
    1973            resultSet.updateRowId(columnLabel, value);
    1974        } catch (final SQLException e) {
    1975            handleException(e);
    1976        }
    1977    }
    1978
    1979    @Override
    1980    public void updateShort(final int columnIndex, final short x) throws SQLException {
    1981        try {
    1982            resultSet.updateShort(columnIndex, x);
    1983        } catch (final SQLException e) {
    1984            handleException(e);
    1985        }
    1986    }
    1987
    1988    @Override
    1989    public void updateShort(final String columnName, final short x) throws SQLException {
    1990        try {
    1991            resultSet.updateShort(columnName, x);
    1992        } catch (final SQLException e) {
    1993            handleException(e);
    1994        }
    1995    }
    1996
    1997    @Override
    1998    public void updateSQLXML(final int columnIndex, final SQLXML value) throws SQLException {
    1999        try {
    2000            resultSet.updateSQLXML(columnIndex, value);
    2001        } catch (final SQLException e) {
    2002            handleException(e);
    2003        }
    2004    }
    2005
    2006    @Override
    2007    public void updateSQLXML(final String columnLabel, final SQLXML value) throws SQLException {
    2008        try {
    2009            resultSet.updateSQLXML(columnLabel, value);
    2010        } catch (final SQLException e) {
    2011            handleException(e);
    2012        }
    2013    }
    2014
    2015    @Override
    2016    public void updateString(final int columnIndex, final String x) throws SQLException {
    2017        try {
    2018            resultSet.updateString(columnIndex, x);
    2019        } catch (final SQLException e) {
    2020            handleException(e);
    2021        }
    2022    }
    2023
    2024    @Override
    2025    public void updateString(final String columnName, final String x) throws SQLException {
    2026        try {
    2027            resultSet.updateString(columnName, x);
    2028        } catch (final SQLException e) {
    2029            handleException(e);
    2030        }
    2031    }
    2032
    2033    @Override
    2034    public void updateTime(final int columnIndex, final Time x) throws SQLException {
    2035        try {
    2036            resultSet.updateTime(columnIndex, x);
    2037        } catch (final SQLException e) {
    2038            handleException(e);
    2039        }
    2040    }
    2041
    2042    @Override
    2043    public void updateTime(final String columnName, final Time x) throws SQLException {
    2044        try {
    2045            resultSet.updateTime(columnName, x);
    2046        } catch (final SQLException e) {
    2047            handleException(e);
    2048        }
    2049    }
    2050
    2051    @Override
    2052    public void updateTimestamp(final int columnIndex, final Timestamp x) throws SQLException {
    2053        try {
    2054            resultSet.updateTimestamp(columnIndex, x);
    2055        } catch (final SQLException e) {
    2056            handleException(e);
    2057        }
    2058    }
    2059
    2060    @Override
    2061    public void updateTimestamp(final String columnName, final Timestamp x) throws SQLException {
    2062        try {
    2063            resultSet.updateTimestamp(columnName, x);
    2064        } catch (final SQLException e) {
    2065            handleException(e);
    2066        }
    2067    }
    2068
    2069    @Override
    2070    public boolean wasNull() throws SQLException {
    2071        try {
    2072            return resultSet.wasNull();
    2073        } catch (final SQLException e) {
    2074            handleException(e);
    2075            return false;
    2076        }
    2077    }
    2078}