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