View Javadoc
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  package org.apache.commons.dbcp2;
18  
19  import java.io.InputStream;
20  import java.io.Reader;
21  import java.math.BigDecimal;
22  import java.sql.Array;
23  import java.sql.Blob;
24  import java.sql.Clob;
25  import java.sql.Connection;
26  import java.sql.Date;
27  import java.sql.NClob;
28  import java.sql.Ref;
29  import java.sql.ResultSet;
30  import java.sql.ResultSetMetaData;
31  import java.sql.RowId;
32  import java.sql.SQLException;
33  import java.sql.SQLType;
34  import java.sql.SQLWarning;
35  import java.sql.SQLXML;
36  import java.sql.Statement;
37  import java.sql.Time;
38  import java.sql.Timestamp;
39  import java.util.Calendar;
40  import java.util.Map;
41  
42  /**
43   * A base delegating implementation of {@link ResultSet}.
44   * <p>
45   * All of the methods from the {@link ResultSet} interface simply call the corresponding method on the "delegate"
46   * provided in my constructor.
47   * </p>
48   * <p>
49   * Extends AbandonedTrace to implement result set tracking and logging of code which created the ResultSet. Tracking the
50   * ResultSet ensures that the Statement which created it can close any open ResultSet's on Statement close.
51   * </p>
52   *
53   * @since 2.0
54   */
55  public final class DelegatingResultSet extends AbandonedTrace implements ResultSet {
56  
57      /**
58       * Wraps the given result set in a delegate.
59       *
60       * @param connection
61       *            The Connection which created the ResultSet.
62       * @param resultSet
63       *            The ResultSet to wrap.
64       * @return a new delegate.
65       */
66      public static ResultSet wrapResultSet(final Connection connection, final ResultSet resultSet) {
67          if (null == resultSet) {
68              return null;
69          }
70          return new DelegatingResultSet(connection, resultSet);
71      }
72  
73      /**
74       * Wraps the given result set in a delegate.
75       *
76       * @param statement
77       *            The Statement which created the ResultSet.
78       * @param resultSet
79       *            The ResultSet to wrap.
80       * @return a new delegate.
81       */
82      public static ResultSet wrapResultSet(final Statement statement, final ResultSet resultSet) {
83          if (null == resultSet) {
84              return null;
85          }
86          return new DelegatingResultSet(statement, resultSet);
87      }
88  
89      /** My delegate. **/
90      private final ResultSet resultSet;
91  
92      /** The Statement that created me, if any. **/
93      private Statement statement;
94  
95      /** The Connection that created me, if any. **/
96      private Connection connection;
97  
98      /**
99       * 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 {@code 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 {@code DelegatingResultSet}, or {@code null} when
598      * no non-{@code DelegatingResultSet} delegate can be found by traversing this chain.
599      * </p>
600      * <p>
601      * This method is useful when you may have nested {@code 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     protected void handleException(final SQLException e) throws SQLException {
1049         if (statement instanceof DelegatingStatement) {
1050             ((DelegatingStatement) statement).handleException(e);
1051         } else if (connection instanceof DelegatingConnection) {
1052             ((DelegatingConnection<?>) connection).handleException(e);
1053         } else {
1054             throw e;
1055         }
1056     }
1057 
1058     @Override
1059     public void insertRow() throws SQLException {
1060         try {
1061             resultSet.insertRow();
1062         } catch (final SQLException e) {
1063             handleException(e);
1064         }
1065     }
1066 
1067     @Override
1068     public boolean isAfterLast() throws SQLException {
1069         try {
1070             return resultSet.isAfterLast();
1071         } catch (final SQLException e) {
1072             handleException(e);
1073             return false;
1074         }
1075     }
1076 
1077     @Override
1078     public boolean isBeforeFirst() throws SQLException {
1079         try {
1080             return resultSet.isBeforeFirst();
1081         } catch (final SQLException e) {
1082             handleException(e);
1083             return false;
1084         }
1085     }
1086 
1087     @Override
1088     public boolean isClosed() throws SQLException {
1089         try {
1090             return resultSet.isClosed();
1091         } catch (final SQLException e) {
1092             handleException(e);
1093             return false;
1094         }
1095     }
1096 
1097     @Override
1098     public boolean isFirst() throws SQLException {
1099         try {
1100             return resultSet.isFirst();
1101         } catch (final SQLException e) {
1102             handleException(e);
1103             return false;
1104         }
1105     }
1106 
1107     @Override
1108     public boolean isLast() throws SQLException {
1109         try {
1110             return resultSet.isLast();
1111         } catch (final SQLException e) {
1112             handleException(e);
1113             return false;
1114         }
1115     }
1116 
1117     @Override
1118     public boolean isWrapperFor(final Class<?> iface) throws SQLException {
1119         if (iface.isAssignableFrom(getClass())) {
1120             return true;
1121         }
1122         if (iface.isAssignableFrom(resultSet.getClass())) {
1123             return true;
1124         }
1125         return resultSet.isWrapperFor(iface);
1126     }
1127 
1128     @Override
1129     public boolean last() throws SQLException {
1130         try {
1131             return resultSet.last();
1132         } catch (final SQLException e) {
1133             handleException(e);
1134             return false;
1135         }
1136     }
1137 
1138     @Override
1139     public void moveToCurrentRow() throws SQLException {
1140         try {
1141             resultSet.moveToCurrentRow();
1142         } catch (final SQLException e) {
1143             handleException(e);
1144         }
1145     }
1146 
1147     @Override
1148     public void moveToInsertRow() throws SQLException {
1149         try {
1150             resultSet.moveToInsertRow();
1151         } catch (final SQLException e) {
1152             handleException(e);
1153         }
1154     }
1155 
1156     @Override
1157     public boolean next() throws SQLException {
1158         try {
1159             return resultSet.next();
1160         } catch (final SQLException e) {
1161             handleException(e);
1162             return false;
1163         }
1164     }
1165 
1166     @Override
1167     public boolean previous() throws SQLException {
1168         try {
1169             return resultSet.previous();
1170         } catch (final SQLException e) {
1171             handleException(e);
1172             return false;
1173         }
1174     }
1175 
1176     @Override
1177     public void refreshRow() throws SQLException {
1178         try {
1179             resultSet.refreshRow();
1180         } catch (final SQLException e) {
1181             handleException(e);
1182         }
1183     }
1184 
1185     @Override
1186     public boolean relative(final int rows) throws SQLException {
1187         try {
1188             return resultSet.relative(rows);
1189         } catch (final SQLException e) {
1190             handleException(e);
1191             return false;
1192         }
1193     }
1194 
1195     @Override
1196     public boolean rowDeleted() throws SQLException {
1197         try {
1198             return resultSet.rowDeleted();
1199         } catch (final SQLException e) {
1200             handleException(e);
1201             return false;
1202         }
1203     }
1204 
1205     @Override
1206     public boolean rowInserted() throws SQLException {
1207         try {
1208             return resultSet.rowInserted();
1209         } catch (final SQLException e) {
1210             handleException(e);
1211             return false;
1212         }
1213     }
1214 
1215     @Override
1216     public boolean rowUpdated() throws SQLException {
1217         try {
1218             return resultSet.rowUpdated();
1219         } catch (final SQLException e) {
1220             handleException(e);
1221             return false;
1222         }
1223     }
1224 
1225     @Override
1226     public void setFetchDirection(final int direction) throws SQLException {
1227         try {
1228             resultSet.setFetchDirection(direction);
1229         } catch (final SQLException e) {
1230             handleException(e);
1231         }
1232     }
1233 
1234     @Override
1235     public void setFetchSize(final int rows) throws SQLException {
1236         try {
1237             resultSet.setFetchSize(rows);
1238         } catch (final SQLException e) {
1239             handleException(e);
1240         }
1241     }
1242 
1243     @Override
1244     public synchronized String toString() {
1245         return super.toString() + "[resultSet=" + resultSet + ", statement=" + statement + ", connection=" + connection + "]";
1246     }
1247 
1248     @Override
1249     public <T> T unwrap(final Class<T> iface) throws SQLException {
1250         if (iface.isAssignableFrom(getClass())) {
1251             return iface.cast(this);
1252         }
1253         if (iface.isAssignableFrom(resultSet.getClass())) {
1254             return iface.cast(resultSet);
1255         }
1256         return resultSet.unwrap(iface);
1257     }
1258 
1259     @Override
1260     public void updateArray(final int columnIndex, final Array x) throws SQLException {
1261         try {
1262             resultSet.updateArray(columnIndex, x);
1263         } catch (final SQLException e) {
1264             handleException(e);
1265         }
1266     }
1267 
1268     @Override
1269     public void updateArray(final String columnName, final Array x) throws SQLException {
1270         try {
1271             resultSet.updateArray(columnName, x);
1272         } catch (final SQLException e) {
1273             handleException(e);
1274         }
1275     }
1276 
1277     @Override
1278     public void updateAsciiStream(final int columnIndex, final InputStream inputStream) throws SQLException {
1279         try {
1280             resultSet.updateAsciiStream(columnIndex, inputStream);
1281         } catch (final SQLException e) {
1282             handleException(e);
1283         }
1284     }
1285 
1286     @Override
1287     public void updateAsciiStream(final int columnIndex, final InputStream x, final int length) throws SQLException {
1288         try {
1289             resultSet.updateAsciiStream(columnIndex, x, length);
1290         } catch (final SQLException e) {
1291             handleException(e);
1292         }
1293     }
1294 
1295     @Override
1296     public void updateAsciiStream(final int columnIndex, final InputStream inputStream, final long length)
1297             throws SQLException {
1298         try {
1299             resultSet.updateAsciiStream(columnIndex, inputStream, length);
1300         } catch (final SQLException e) {
1301             handleException(e);
1302         }
1303     }
1304 
1305     @Override
1306     public void updateAsciiStream(final String columnLabel, final InputStream inputStream) throws SQLException {
1307         try {
1308             resultSet.updateAsciiStream(columnLabel, inputStream);
1309         } catch (final SQLException e) {
1310             handleException(e);
1311         }
1312     }
1313 
1314     @Override
1315     public void updateAsciiStream(final String columnName, final InputStream x, final int length) throws SQLException {
1316         try {
1317             resultSet.updateAsciiStream(columnName, x, length);
1318         } catch (final SQLException e) {
1319             handleException(e);
1320         }
1321     }
1322 
1323     @Override
1324     public void updateAsciiStream(final String columnLabel, final InputStream inputStream, final long length)
1325             throws SQLException {
1326         try {
1327             resultSet.updateAsciiStream(columnLabel, inputStream, length);
1328         } catch (final SQLException e) {
1329             handleException(e);
1330         }
1331     }
1332 
1333     @Override
1334     public void updateBigDecimal(final int columnIndex, final BigDecimal x) throws SQLException {
1335         try {
1336             resultSet.updateBigDecimal(columnIndex, x);
1337         } catch (final SQLException e) {
1338             handleException(e);
1339         }
1340     }
1341 
1342     @Override
1343     public void updateBigDecimal(final String columnName, final BigDecimal x) throws SQLException {
1344         try {
1345             resultSet.updateBigDecimal(columnName, x);
1346         } catch (final SQLException e) {
1347             handleException(e);
1348         }
1349     }
1350 
1351     @Override
1352     public void updateBinaryStream(final int columnIndex, final InputStream inputStream) throws SQLException {
1353         try {
1354             resultSet.updateBinaryStream(columnIndex, inputStream);
1355         } catch (final SQLException e) {
1356             handleException(e);
1357         }
1358     }
1359 
1360     @Override
1361     public void updateBinaryStream(final int columnIndex, final InputStream x, final int length) throws SQLException {
1362         try {
1363             resultSet.updateBinaryStream(columnIndex, x, length);
1364         } catch (final SQLException e) {
1365             handleException(e);
1366         }
1367     }
1368 
1369     @Override
1370     public void updateBinaryStream(final int columnIndex, final InputStream inputStream, final long length)
1371             throws SQLException {
1372         try {
1373             resultSet.updateBinaryStream(columnIndex, inputStream, length);
1374         } catch (final SQLException e) {
1375             handleException(e);
1376         }
1377     }
1378 
1379     @Override
1380     public void updateBinaryStream(final String columnLabel, final InputStream inputStream) throws SQLException {
1381         try {
1382             resultSet.updateBinaryStream(columnLabel, inputStream);
1383         } catch (final SQLException e) {
1384             handleException(e);
1385         }
1386     }
1387 
1388     @Override
1389     public void updateBinaryStream(final String columnName, final InputStream x, final int length) throws SQLException {
1390         try {
1391             resultSet.updateBinaryStream(columnName, x, length);
1392         } catch (final SQLException e) {
1393             handleException(e);
1394         }
1395     }
1396 
1397     @Override
1398     public void updateBinaryStream(final String columnLabel, final InputStream inputStream, final long length)
1399             throws SQLException {
1400         try {
1401             resultSet.updateBinaryStream(columnLabel, inputStream, length);
1402         } catch (final SQLException e) {
1403             handleException(e);
1404         }
1405     }
1406 
1407     @Override
1408     public void updateBlob(final int columnIndex, final Blob x) throws SQLException {
1409         try {
1410             resultSet.updateBlob(columnIndex, x);
1411         } catch (final SQLException e) {
1412             handleException(e);
1413         }
1414     }
1415 
1416     @Override
1417     public void updateBlob(final int columnIndex, final InputStream inputStream) throws SQLException {
1418         try {
1419             resultSet.updateBlob(columnIndex, inputStream);
1420         } catch (final SQLException e) {
1421             handleException(e);
1422         }
1423     }
1424 
1425     @Override
1426     public void updateBlob(final int columnIndex, final InputStream inputStream, final long length)
1427             throws SQLException {
1428         try {
1429             resultSet.updateBlob(columnIndex, inputStream, length);
1430         } catch (final SQLException e) {
1431             handleException(e);
1432         }
1433     }
1434 
1435     @Override
1436     public void updateBlob(final String columnName, final Blob x) throws SQLException {
1437         try {
1438             resultSet.updateBlob(columnName, x);
1439         } catch (final SQLException e) {
1440             handleException(e);
1441         }
1442     }
1443 
1444     @Override
1445     public void updateBlob(final String columnLabel, final InputStream inputStream) throws SQLException {
1446         try {
1447             resultSet.updateBlob(columnLabel, inputStream);
1448         } catch (final SQLException e) {
1449             handleException(e);
1450         }
1451     }
1452 
1453     @Override
1454     public void updateBlob(final String columnLabel, final InputStream inputStream, final long length)
1455             throws SQLException {
1456         try {
1457             resultSet.updateBlob(columnLabel, inputStream, length);
1458         } catch (final SQLException e) {
1459             handleException(e);
1460         }
1461     }
1462 
1463     @Override
1464     public void updateBoolean(final int columnIndex, final boolean x) throws SQLException {
1465         try {
1466             resultSet.updateBoolean(columnIndex, x);
1467         } catch (final SQLException e) {
1468             handleException(e);
1469         }
1470     }
1471 
1472     @Override
1473     public void updateBoolean(final String columnName, final boolean x) throws SQLException {
1474         try {
1475             resultSet.updateBoolean(columnName, x);
1476         } catch (final SQLException e) {
1477             handleException(e);
1478         }
1479     }
1480 
1481     @Override
1482     public void updateByte(final int columnIndex, final byte x) throws SQLException {
1483         try {
1484             resultSet.updateByte(columnIndex, x);
1485         } catch (final SQLException e) {
1486             handleException(e);
1487         }
1488     }
1489 
1490     @Override
1491     public void updateByte(final String columnName, final byte x) throws SQLException {
1492         try {
1493             resultSet.updateByte(columnName, x);
1494         } catch (final SQLException e) {
1495             handleException(e);
1496         }
1497     }
1498 
1499     @Override
1500     public void updateBytes(final int columnIndex, final byte[] x) throws SQLException {
1501         try {
1502             resultSet.updateBytes(columnIndex, x);
1503         } catch (final SQLException e) {
1504             handleException(e);
1505         }
1506     }
1507 
1508     @Override
1509     public void updateBytes(final String columnName, final byte[] x) throws SQLException {
1510         try {
1511             resultSet.updateBytes(columnName, x);
1512         } catch (final SQLException e) {
1513             handleException(e);
1514         }
1515     }
1516 
1517     @Override
1518     public void updateCharacterStream(final int columnIndex, final Reader reader) throws SQLException {
1519         try {
1520             resultSet.updateCharacterStream(columnIndex, reader);
1521         } catch (final SQLException e) {
1522             handleException(e);
1523         }
1524     }
1525 
1526     @Override
1527     public void updateCharacterStream(final int columnIndex, final Reader x, final int length) throws SQLException {
1528         try {
1529             resultSet.updateCharacterStream(columnIndex, x, length);
1530         } catch (final SQLException e) {
1531             handleException(e);
1532         }
1533     }
1534 
1535     @Override
1536     public void updateCharacterStream(final int columnIndex, final Reader reader, final long length)
1537             throws SQLException {
1538         try {
1539             resultSet.updateCharacterStream(columnIndex, reader, length);
1540         } catch (final SQLException e) {
1541             handleException(e);
1542         }
1543     }
1544 
1545     @Override
1546     public void updateCharacterStream(final String columnLabel, final Reader reader) throws SQLException {
1547         try {
1548             resultSet.updateCharacterStream(columnLabel, reader);
1549         } catch (final SQLException e) {
1550             handleException(e);
1551         }
1552     }
1553 
1554     @Override
1555     public void updateCharacterStream(final String columnName, final Reader reader, final int length)
1556             throws SQLException {
1557         try {
1558             resultSet.updateCharacterStream(columnName, reader, length);
1559         } catch (final SQLException e) {
1560             handleException(e);
1561         }
1562     }
1563 
1564     @Override
1565     public void updateCharacterStream(final String columnLabel, final Reader reader, final long length)
1566             throws SQLException {
1567         try {
1568             resultSet.updateCharacterStream(columnLabel, reader, length);
1569         } catch (final SQLException e) {
1570             handleException(e);
1571         }
1572     }
1573 
1574     @Override
1575     public void updateClob(final int columnIndex, final Clob x) throws SQLException {
1576         try {
1577             resultSet.updateClob(columnIndex, x);
1578         } catch (final SQLException e) {
1579             handleException(e);
1580         }
1581     }
1582 
1583     @Override
1584     public void updateClob(final int columnIndex, final Reader reader) throws SQLException {
1585         try {
1586             resultSet.updateClob(columnIndex, reader);
1587         } catch (final SQLException e) {
1588             handleException(e);
1589         }
1590     }
1591 
1592     @Override
1593     public void updateClob(final int columnIndex, final Reader reader, final long length) throws SQLException {
1594         try {
1595             resultSet.updateClob(columnIndex, reader, length);
1596         } catch (final SQLException e) {
1597             handleException(e);
1598         }
1599     }
1600 
1601     @Override
1602     public void updateClob(final String columnName, final Clob x) throws SQLException {
1603         try {
1604             resultSet.updateClob(columnName, x);
1605         } catch (final SQLException e) {
1606             handleException(e);
1607         }
1608     }
1609 
1610     @Override
1611     public void updateClob(final String columnLabel, final Reader reader) throws SQLException {
1612         try {
1613             resultSet.updateClob(columnLabel, reader);
1614         } catch (final SQLException e) {
1615             handleException(e);
1616         }
1617     }
1618 
1619     @Override
1620     public void updateClob(final String columnLabel, final Reader reader, final long length) throws SQLException {
1621         try {
1622             resultSet.updateClob(columnLabel, reader, length);
1623         } catch (final SQLException e) {
1624             handleException(e);
1625         }
1626     }
1627 
1628     @Override
1629     public void updateDate(final int columnIndex, final Date x) throws SQLException {
1630         try {
1631             resultSet.updateDate(columnIndex, x);
1632         } catch (final SQLException e) {
1633             handleException(e);
1634         }
1635     }
1636 
1637     @Override
1638     public void updateDate(final String columnName, final Date x) throws SQLException {
1639         try {
1640             resultSet.updateDate(columnName, x);
1641         } catch (final SQLException e) {
1642             handleException(e);
1643         }
1644     }
1645 
1646     @Override
1647     public void updateDouble(final int columnIndex, final double x) throws SQLException {
1648         try {
1649             resultSet.updateDouble(columnIndex, x);
1650         } catch (final SQLException e) {
1651             handleException(e);
1652         }
1653     }
1654 
1655     @Override
1656     public void updateDouble(final String columnName, final double x) throws SQLException {
1657         try {
1658             resultSet.updateDouble(columnName, x);
1659         } catch (final SQLException e) {
1660             handleException(e);
1661         }
1662     }
1663 
1664     @Override
1665     public void updateFloat(final int columnIndex, final float x) throws SQLException {
1666         try {
1667             resultSet.updateFloat(columnIndex, x);
1668         } catch (final SQLException e) {
1669             handleException(e);
1670         }
1671     }
1672 
1673     @Override
1674     public void updateFloat(final String columnName, final float x) throws SQLException {
1675         try {
1676             resultSet.updateFloat(columnName, x);
1677         } catch (final SQLException e) {
1678             handleException(e);
1679         }
1680     }
1681 
1682     @Override
1683     public void updateInt(final int columnIndex, final int x) throws SQLException {
1684         try {
1685             resultSet.updateInt(columnIndex, x);
1686         } catch (final SQLException e) {
1687             handleException(e);
1688         }
1689     }
1690 
1691     @Override
1692     public void updateInt(final String columnName, final int x) throws SQLException {
1693         try {
1694             resultSet.updateInt(columnName, x);
1695         } catch (final SQLException e) {
1696             handleException(e);
1697         }
1698     }
1699 
1700     @Override
1701     public void updateLong(final int columnIndex, final long x) throws SQLException {
1702         try {
1703             resultSet.updateLong(columnIndex, x);
1704         } catch (final SQLException e) {
1705             handleException(e);
1706         }
1707     }
1708 
1709     @Override
1710     public void updateLong(final String columnName, final long x) throws SQLException {
1711         try {
1712             resultSet.updateLong(columnName, x);
1713         } catch (final SQLException e) {
1714             handleException(e);
1715         }
1716     }
1717 
1718     @Override
1719     public void updateNCharacterStream(final int columnIndex, final Reader reader) throws SQLException {
1720         try {
1721             resultSet.updateNCharacterStream(columnIndex, reader);
1722         } catch (final SQLException e) {
1723             handleException(e);
1724         }
1725     }
1726 
1727     @Override
1728     public void updateNCharacterStream(final int columnIndex, final Reader reader, final long length)
1729             throws SQLException {
1730         try {
1731             resultSet.updateNCharacterStream(columnIndex, reader, length);
1732         } catch (final SQLException e) {
1733             handleException(e);
1734         }
1735     }
1736 
1737     @Override
1738     public void updateNCharacterStream(final String columnLabel, final Reader reader) throws SQLException {
1739         try {
1740             resultSet.updateNCharacterStream(columnLabel, reader);
1741         } catch (final SQLException e) {
1742             handleException(e);
1743         }
1744     }
1745 
1746     @Override
1747     public void updateNCharacterStream(final String columnLabel, final Reader reader, final long length)
1748             throws SQLException {
1749         try {
1750             resultSet.updateNCharacterStream(columnLabel, reader, length);
1751         } catch (final SQLException e) {
1752             handleException(e);
1753         }
1754     }
1755 
1756     @Override
1757     public void updateNClob(final int columnIndex, final NClob value) throws SQLException {
1758         try {
1759             resultSet.updateNClob(columnIndex, value);
1760         } catch (final SQLException e) {
1761             handleException(e);
1762         }
1763     }
1764 
1765     @Override
1766     public void updateNClob(final int columnIndex, final Reader reader) throws SQLException {
1767         try {
1768             resultSet.updateNClob(columnIndex, reader);
1769         } catch (final SQLException e) {
1770             handleException(e);
1771         }
1772     }
1773 
1774     @Override
1775     public void updateNClob(final int columnIndex, final Reader reader, final long length) throws SQLException {
1776         try {
1777             resultSet.updateNClob(columnIndex, reader, length);
1778         } catch (final SQLException e) {
1779             handleException(e);
1780         }
1781     }
1782 
1783     @Override
1784     public void updateNClob(final String columnLabel, final NClob value) throws SQLException {
1785         try {
1786             resultSet.updateNClob(columnLabel, value);
1787         } catch (final SQLException e) {
1788             handleException(e);
1789         }
1790     }
1791 
1792     @Override
1793     public void updateNClob(final String columnLabel, final Reader reader) throws SQLException {
1794         try {
1795             resultSet.updateNClob(columnLabel, reader);
1796         } catch (final SQLException e) {
1797             handleException(e);
1798         }
1799     }
1800 
1801     @Override
1802     public void updateNClob(final String columnLabel, final Reader reader, final long length) throws SQLException {
1803         try {
1804             resultSet.updateNClob(columnLabel, reader, length);
1805         } catch (final SQLException e) {
1806             handleException(e);
1807         }
1808     }
1809 
1810     @Override
1811     public void updateNString(final int columnIndex, final String value) throws SQLException {
1812         try {
1813             resultSet.updateNString(columnIndex, value);
1814         } catch (final SQLException e) {
1815             handleException(e);
1816         }
1817     }
1818 
1819     @Override
1820     public void updateNString(final String columnLabel, final String value) throws SQLException {
1821         try {
1822             resultSet.updateNString(columnLabel, value);
1823         } catch (final SQLException e) {
1824             handleException(e);
1825         }
1826     }
1827 
1828     @Override
1829     public void updateNull(final int columnIndex) throws SQLException {
1830         try {
1831             resultSet.updateNull(columnIndex);
1832         } catch (final SQLException e) {
1833             handleException(e);
1834         }
1835     }
1836 
1837     @Override
1838     public void updateNull(final String columnName) throws SQLException {
1839         try {
1840             resultSet.updateNull(columnName);
1841         } catch (final SQLException e) {
1842             handleException(e);
1843         }
1844     }
1845 
1846     @Override
1847     public void updateObject(final int columnIndex, final Object x) throws SQLException {
1848         try {
1849             resultSet.updateObject(columnIndex, x);
1850         } catch (final SQLException e) {
1851             handleException(e);
1852         }
1853     }
1854 
1855     @Override
1856     public void updateObject(final int columnIndex, final Object x, final int scale) throws SQLException {
1857         try {
1858             resultSet.updateObject(columnIndex, x);
1859         } catch (final SQLException e) {
1860             handleException(e);
1861         }
1862     }
1863 
1864     /**
1865      * @since 2.5.0
1866      */
1867     @Override
1868     public void updateObject(final int columnIndex, final Object x, final SQLType targetSqlType) throws SQLException {
1869         try {
1870             resultSet.updateObject(columnIndex, x, targetSqlType);
1871         } catch (final SQLException e) {
1872             handleException(e);
1873         }
1874     }
1875 
1876     /**
1877      * @since 2.5.0
1878      */
1879     @Override
1880     public void updateObject(final int columnIndex, final Object x, final SQLType targetSqlType, final int scaleOrLength) throws SQLException {
1881         try {
1882             resultSet.updateObject(columnIndex, x, targetSqlType, scaleOrLength);
1883         } catch (final SQLException e) {
1884             handleException(e);
1885         }
1886     }
1887 
1888     @Override
1889     public void updateObject(final String columnName, final Object x) throws SQLException {
1890         try {
1891             resultSet.updateObject(columnName, x);
1892         } catch (final SQLException e) {
1893             handleException(e);
1894         }
1895     }
1896 
1897     @Override
1898     public void updateObject(final String columnName, final Object x, final int scale) throws SQLException {
1899         try {
1900             resultSet.updateObject(columnName, x);
1901         } catch (final SQLException e) {
1902             handleException(e);
1903         }
1904     }
1905 
1906     /**
1907      * @since 2.5.0
1908      */
1909     @Override
1910     public void updateObject(final String columnLabel, final Object x, final SQLType targetSqlType) throws SQLException {
1911         try {
1912             resultSet.updateObject(columnLabel, x, targetSqlType);
1913         } catch (final SQLException e) {
1914             handleException(e);
1915         }
1916     }
1917 
1918     /**
1919      * @since 2.5.0
1920      */
1921     @Override
1922     public void updateObject(final String columnLabel, final Object x, final SQLType targetSqlType, final int scaleOrLength)
1923             throws SQLException {
1924         try {
1925             resultSet.updateObject(columnLabel, x, targetSqlType, scaleOrLength);
1926         } catch (final SQLException e) {
1927             handleException(e);
1928         }
1929     }
1930 
1931     @Override
1932     public void updateRef(final int columnIndex, final Ref x) throws SQLException {
1933         try {
1934             resultSet.updateRef(columnIndex, x);
1935         } catch (final SQLException e) {
1936             handleException(e);
1937         }
1938     }
1939 
1940     @Override
1941     public void updateRef(final String columnName, final Ref x) throws SQLException {
1942         try {
1943             resultSet.updateRef(columnName, x);
1944         } catch (final SQLException e) {
1945             handleException(e);
1946         }
1947     }
1948 
1949     @Override
1950     public void updateRow() throws SQLException {
1951         try {
1952             resultSet.updateRow();
1953         } catch (final SQLException e) {
1954             handleException(e);
1955         }
1956     }
1957 
1958     @Override
1959     public void updateRowId(final int columnIndex, final RowId value) throws SQLException {
1960         try {
1961             resultSet.updateRowId(columnIndex, value);
1962         } catch (final SQLException e) {
1963             handleException(e);
1964         }
1965     }
1966 
1967     @Override
1968     public void updateRowId(final String columnLabel, final RowId value) throws SQLException {
1969         try {
1970             resultSet.updateRowId(columnLabel, value);
1971         } catch (final SQLException e) {
1972             handleException(e);
1973         }
1974     }
1975 
1976     @Override
1977     public void updateShort(final int columnIndex, final short x) throws SQLException {
1978         try {
1979             resultSet.updateShort(columnIndex, x);
1980         } catch (final SQLException e) {
1981             handleException(e);
1982         }
1983     }
1984 
1985     @Override
1986     public void updateShort(final String columnName, final short x) throws SQLException {
1987         try {
1988             resultSet.updateShort(columnName, x);
1989         } catch (final SQLException e) {
1990             handleException(e);
1991         }
1992     }
1993 
1994     @Override
1995     public void updateSQLXML(final int columnIndex, final SQLXML value) throws SQLException {
1996         try {
1997             resultSet.updateSQLXML(columnIndex, value);
1998         } catch (final SQLException e) {
1999             handleException(e);
2000         }
2001     }
2002 
2003     @Override
2004     public void updateSQLXML(final String columnLabel, final SQLXML value) throws SQLException {
2005         try {
2006             resultSet.updateSQLXML(columnLabel, value);
2007         } catch (final SQLException e) {
2008             handleException(e);
2009         }
2010     }
2011 
2012     @Override
2013     public void updateString(final int columnIndex, final String x) throws SQLException {
2014         try {
2015             resultSet.updateString(columnIndex, x);
2016         } catch (final SQLException e) {
2017             handleException(e);
2018         }
2019     }
2020 
2021     @Override
2022     public void updateString(final String columnName, final String x) throws SQLException {
2023         try {
2024             resultSet.updateString(columnName, x);
2025         } catch (final SQLException e) {
2026             handleException(e);
2027         }
2028     }
2029 
2030     @Override
2031     public void updateTime(final int columnIndex, final Time x) throws SQLException {
2032         try {
2033             resultSet.updateTime(columnIndex, x);
2034         } catch (final SQLException e) {
2035             handleException(e);
2036         }
2037     }
2038 
2039     @Override
2040     public void updateTime(final String columnName, final Time x) throws SQLException {
2041         try {
2042             resultSet.updateTime(columnName, x);
2043         } catch (final SQLException e) {
2044             handleException(e);
2045         }
2046     }
2047 
2048     @Override
2049     public void updateTimestamp(final int columnIndex, final Timestamp x) throws SQLException {
2050         try {
2051             resultSet.updateTimestamp(columnIndex, x);
2052         } catch (final SQLException e) {
2053             handleException(e);
2054         }
2055     }
2056 
2057     @Override
2058     public void updateTimestamp(final String columnName, final Timestamp x) throws SQLException {
2059         try {
2060             resultSet.updateTimestamp(columnName, x);
2061         } catch (final SQLException e) {
2062             handleException(e);
2063         }
2064     }
2065 
2066     @Override
2067     public boolean wasNull() throws SQLException {
2068         try {
2069             return resultSet.wasNull();
2070         } catch (final SQLException e) {
2071             handleException(e);
2072             return false;
2073         }
2074     }
2075 }