1 22 package org.jboss.resource.adapter.jdbc; 23 24 import java.io.InputStream ; 25 import java.io.Reader ; 26 import java.math.BigDecimal ; 27 import java.net.URL ; 28 import java.sql.Array ; 29 import java.sql.Blob ; 30 import java.sql.CallableStatement ; 31 import java.sql.Clob ; 32 import java.sql.Date ; 33 import java.sql.Ref ; 34 import java.sql.SQLException ; 35 import java.sql.Time ; 36 import java.sql.Timestamp ; 37 import java.util.Calendar ; 38 import java.util.Map ; 39 40 47 public class WrappedCallableStatement extends WrappedPreparedStatement implements CallableStatement 48 { 49 private final CallableStatement cs; 50 51 public WrappedCallableStatement(final WrappedConnection lc, final CallableStatement cs) 52 { 53 super(lc, cs); 54 this.cs = cs; 55 } 56 57 public Object getObject(int parameterIndex) throws SQLException 58 { 59 checkState(); 60 try 61 { 62 return cs.getObject(parameterIndex); 63 } 64 catch (Throwable t) 65 { 66 throw checkException(t); 67 } 68 } 69 70 public Object getObject(int parameterIndex, Map typeMap) throws SQLException 71 { 72 checkState(); 73 try 74 { 75 return cs.getObject(parameterIndex, typeMap); 76 } 77 catch (Throwable t) 78 { 79 throw checkException(t); 80 } 81 } 82 83 public Object getObject(String parameterName) throws SQLException 84 { 85 checkState(); 86 try 87 { 88 return cs.getObject(parameterName); 89 } 90 catch (Throwable t) 91 { 92 throw checkException(t); 93 } 94 } 95 96 public Object getObject(String parameterName, Map typeMap) throws SQLException 97 { 98 checkState(); 99 try 100 { 101 return cs.getObject(parameterName, typeMap); 102 } 103 catch (Throwable t) 104 { 105 throw checkException(t); 106 } 107 } 108 109 public boolean getBoolean(int parameterIndex) throws SQLException 110 { 111 checkState(); 112 try 113 { 114 return cs.getBoolean(parameterIndex); 115 } 116 catch (Throwable t) 117 { 118 throw checkException(t); 119 } 120 } 121 122 public boolean getBoolean(String parameterName) throws SQLException 123 { 124 checkState(); 125 try 126 { 127 return cs.getBoolean(parameterName); 128 } 129 catch (Throwable t) 130 { 131 throw checkException(t); 132 } 133 } 134 135 public byte getByte(int parameterIndex) throws SQLException 136 { 137 checkState(); 138 try 139 { 140 return cs.getByte(parameterIndex); 141 } 142 catch (Throwable t) 143 { 144 throw checkException(t); 145 } 146 } 147 148 public byte getByte(String parameterName) throws SQLException 149 { 150 checkState(); 151 try 152 { 153 return cs.getByte(parameterName); 154 } 155 catch (Throwable t) 156 { 157 throw checkException(t); 158 } 159 } 160 161 public short getShort(int parameterIndex) throws SQLException 162 { 163 checkState(); 164 try 165 { 166 return cs.getShort(parameterIndex); 167 } 168 catch (Throwable t) 169 { 170 throw checkException(t); 171 } 172 } 173 174 public short getShort(String parameterName) throws SQLException 175 { 176 checkState(); 177 try 178 { 179 return cs.getShort(parameterName); 180 } 181 catch (Throwable t) 182 { 183 throw checkException(t); 184 } 185 } 186 187 public int getInt(int parameterIndex) throws SQLException 188 { 189 checkState(); 190 try 191 { 192 return cs.getInt(parameterIndex); 193 } 194 catch (Throwable t) 195 { 196 throw checkException(t); 197 } 198 } 199 200 public int getInt(String parameterName) throws SQLException 201 { 202 checkState(); 203 try 204 { 205 return cs.getInt(parameterName); 206 } 207 catch (Throwable t) 208 { 209 throw checkException(t); 210 } 211 } 212 213 public long getLong(int parameterIndex) throws SQLException 214 { 215 checkState(); 216 try 217 { 218 return cs.getLong(parameterIndex); 219 } 220 catch (Throwable t) 221 { 222 throw checkException(t); 223 } 224 } 225 226 public long getLong(String parameterName) throws SQLException 227 { 228 checkState(); 229 try 230 { 231 return cs.getLong(parameterName); 232 } 233 catch (Throwable t) 234 { 235 throw checkException(t); 236 } 237 } 238 239 public float getFloat(int parameterIndex) throws SQLException 240 { 241 checkState(); 242 try 243 { 244 return cs.getFloat(parameterIndex); 245 } 246 catch (Throwable t) 247 { 248 throw checkException(t); 249 } 250 } 251 252 public float getFloat(String parameterName) throws SQLException 253 { 254 checkState(); 255 try 256 { 257 return cs.getFloat(parameterName); 258 } 259 catch (Throwable t) 260 { 261 throw checkException(t); 262 } 263 } 264 265 public double getDouble(int parameterIndex) throws SQLException 266 { 267 checkState(); 268 try 269 { 270 return cs.getDouble(parameterIndex); 271 } 272 catch (Throwable t) 273 { 274 throw checkException(t); 275 } 276 } 277 278 public double getDouble(String parameterName) throws SQLException 279 { 280 checkState(); 281 try 282 { 283 return cs.getDouble(parameterName); 284 } 285 catch (Throwable t) 286 { 287 throw checkException(t); 288 } 289 } 290 291 public byte[] getBytes(int parameterIndex) throws SQLException 292 { 293 checkState(); 294 try 295 { 296 return cs.getBytes(parameterIndex); 297 } 298 catch (Throwable t) 299 { 300 throw checkException(t); 301 } 302 } 303 304 public byte[] getBytes(String parameterName) throws SQLException 305 { 306 checkState(); 307 try 308 { 309 return cs.getBytes(parameterName); 310 } 311 catch (Throwable t) 312 { 313 throw checkException(t); 314 } 315 } 316 317 public URL getURL(int parameterIndex) throws SQLException 318 { 319 checkState(); 320 try 321 { 322 return cs.getURL(parameterIndex); 323 } 324 catch (Throwable t) 325 { 326 throw checkException(t); 327 } 328 } 329 330 public URL getURL(String parameterName) throws SQLException 331 { 332 checkState(); 333 try 334 { 335 return cs.getURL(parameterName); 336 } 337 catch (Throwable t) 338 { 339 throw checkException(t); 340 } 341 } 342 343 public String getString(int parameterIndex) throws SQLException 344 { 345 checkState(); 346 try 347 { 348 return cs.getString(parameterIndex); 349 } 350 catch (Throwable t) 351 { 352 throw checkException(t); 353 } 354 } 355 356 public String getString(String parameterName) throws SQLException 357 { 358 checkState(); 359 try 360 { 361 return cs.getString(parameterName); 362 } 363 catch (Throwable t) 364 { 365 throw checkException(t); 366 } 367 } 368 369 public Ref getRef(int parameterIndex) throws SQLException 370 { 371 checkState(); 372 try 373 { 374 return cs.getRef(parameterIndex); 375 } 376 catch (Throwable t) 377 { 378 throw checkException(t); 379 } 380 } 381 382 public Ref getRef(String parameterName) throws SQLException 383 { 384 checkState(); 385 try 386 { 387 return cs.getRef(parameterName); 388 } 389 catch (Throwable t) 390 { 391 throw checkException(t); 392 } 393 } 394 395 public Time getTime(int parameterIndex) throws SQLException 396 { 397 checkState(); 398 try 399 { 400 return cs.getTime(parameterIndex); 401 } 402 catch (Throwable t) 403 { 404 throw checkException(t); 405 } 406 } 407 408 public Time getTime(int parameterIndex, Calendar calendar) throws SQLException 409 { 410 checkState(); 411 try 412 { 413 return cs.getTime(parameterIndex, calendar); 414 } 415 catch (Throwable t) 416 { 417 throw checkException(t); 418 } 419 } 420 421 public Time getTime(String parameterName) throws SQLException 422 { 423 checkState(); 424 try 425 { 426 return cs.getTime(parameterName); 427 } 428 catch (Throwable t) 429 { 430 throw checkException(t); 431 } 432 } 433 434 public Time getTime(String parameterName, Calendar calendar) throws SQLException 435 { 436 checkState(); 437 try 438 { 439 return cs.getTime(parameterName, calendar); 440 } 441 catch (Throwable t) 442 { 443 throw checkException(t); 444 } 445 } 446 447 public Date getDate(int parameterIndex) throws SQLException 448 { 449 checkState(); 450 try 451 { 452 return cs.getDate(parameterIndex); 453 } 454 catch (Throwable t) 455 { 456 throw checkException(t); 457 } 458 } 459 460 public Date getDate(int parameterIndex, Calendar calendar) throws SQLException 461 { 462 checkState(); 463 try 464 { 465 return cs.getDate(parameterIndex, calendar); 466 } 467 catch (Throwable t) 468 { 469 throw checkException(t); 470 } 471 } 472 473 public Date getDate(String parameterName) throws SQLException 474 { 475 checkState(); 476 try 477 { 478 return cs.getDate(parameterName); 479 } 480 catch (Throwable t) 481 { 482 throw checkException(t); 483 } 484 } 485 486 public Date getDate(String parameterName, Calendar calendar) throws SQLException 487 { 488 checkState(); 489 try 490 { 491 return cs.getDate(parameterName, calendar); 492 } 493 catch (Throwable t) 494 { 495 throw checkException(t); 496 } 497 } 498 499 public void registerOutParameter(int parameterIndex, int sqlType) throws SQLException 500 { 501 checkState(); 502 try 503 { 504 cs.registerOutParameter(parameterIndex, sqlType); 505 } 506 catch (Throwable t) 507 { 508 throw checkException(t); 509 } 510 } 511 512 public void registerOutParameter(int parameterIndex, int sqlType, int scale) throws SQLException 513 { 514 checkState(); 515 try 516 { 517 cs.registerOutParameter(parameterIndex, sqlType, scale); 518 } 519 catch (Throwable t) 520 { 521 throw checkException(t); 522 } 523 } 524 525 public void registerOutParameter(int parameterIndex, int sqlType, String typeName) throws SQLException 526 { 527 checkState(); 528 try 529 { 530 cs.registerOutParameter(parameterIndex, sqlType, typeName); 531 } 532 catch (Throwable t) 533 { 534 throw checkException(t); 535 } 536 } 537 538 public void registerOutParameter(String parameterName, int sqlType) throws SQLException 539 { 540 checkState(); 541 try 542 { 543 cs.registerOutParameter(parameterName, sqlType); 544 } 545 catch (Throwable t) 546 { 547 throw checkException(t); 548 } 549 } 550 551 public void registerOutParameter(String parameterName, int sqlType, int scale) throws SQLException 552 { 553 checkState(); 554 try 555 { 556 cs.registerOutParameter(parameterName, sqlType, scale); 557 } 558 catch (Throwable t) 559 { 560 throw checkException(t); 561 } 562 } 563 564 public void registerOutParameter(String parameterName, int sqlType, String typeName) throws SQLException 565 { 566 checkState(); 567 try 568 { 569 cs.registerOutParameter(parameterName, sqlType, typeName); 570 } 571 catch (Throwable t) 572 { 573 throw checkException(t); 574 } 575 } 576 577 public boolean wasNull() throws SQLException 578 { 579 checkState(); 580 try 581 { 582 return cs.wasNull(); 583 } 584 catch (Throwable t) 585 { 586 throw checkException(t); 587 } 588 } 589 590 593 public BigDecimal getBigDecimal(int parameterIndex, int scale) throws SQLException 594 { 595 checkState(); 596 try 597 { 598 return cs.getBigDecimal(parameterIndex, scale); 599 } 600 catch (Throwable t) 601 { 602 throw checkException(t); 603 } 604 } 605 606 public BigDecimal getBigDecimal(int parameterIndex) throws SQLException 607 { 608 checkState(); 609 try 610 { 611 return cs.getBigDecimal(parameterIndex); 612 } 613 catch (Throwable t) 614 { 615 throw checkException(t); 616 } 617 } 618 619 public BigDecimal getBigDecimal(String parameterName) throws SQLException 620 { 621 checkState(); 622 try 623 { 624 return cs.getBigDecimal(parameterName); 625 } 626 catch (Throwable t) 627 { 628 throw checkException(t); 629 } 630 } 631 632 public Timestamp getTimestamp(int parameterIndex) throws SQLException 633 { 634 checkState(); 635 try 636 { 637 return cs.getTimestamp(parameterIndex); 638 } 639 catch (Throwable t) 640 { 641 throw checkException(t); 642 } 643 } 644 645 public Timestamp getTimestamp(int parameterIndex, Calendar calendar) throws SQLException 646 { 647 checkState(); 648 try 649 { 650 return cs.getTimestamp(parameterIndex, calendar); 651 } 652 catch (Throwable t) 653 { 654 throw checkException(t); 655 } 656 } 657 658 public Timestamp getTimestamp(String parameterName) throws SQLException 659 { 660 checkState(); 661 try 662 { 663 return cs.getTimestamp(parameterName); 664 } 665 catch (Throwable t) 666 { 667 throw checkException(t); 668 } 669 } 670 671 public Timestamp getTimestamp(String parameterName, Calendar calendar) throws SQLException 672 { 673 checkState(); 674 try 675 { 676 return cs.getTimestamp(parameterName, calendar); 677 } 678 catch (Throwable t) 679 { 680 throw checkException(t); 681 } 682 } 683 684 public Blob getBlob(int parameterIndex) throws SQLException 685 { 686 checkState(); 687 try 688 { 689 return cs.getBlob(parameterIndex); 690 } 691 catch (Throwable t) 692 { 693 throw checkException(t); 694 } 695 } 696 697 public Blob getBlob(String parameterName) throws SQLException 698 { 699 checkState(); 700 try 701 { 702 return cs.getBlob(parameterName); 703 } 704 catch (Throwable t) 705 { 706 throw checkException(t); 707 } 708 } 709 710 public Clob getClob(int parameterIndex) throws SQLException 711 { 712 checkState(); 713 try 714 { 715 return cs.getClob(parameterIndex); 716 } 717 catch (Throwable t) 718 { 719 throw checkException(t); 720 } 721 } 722 723 public Clob getClob(String parameterName) throws SQLException 724 { 725 checkState(); 726 try 727 { 728 return cs.getClob(parameterName); 729 } 730 catch (Throwable t) 731 { 732 throw checkException(t); 733 } 734 } 735 736 public Array getArray(int parameterIndex) throws SQLException 737 { 738 checkState(); 739 try 740 { 741 return cs.getArray(parameterIndex); 742 } 743 catch (Throwable t) 744 { 745 throw checkException(t); 746 } 747 } 748 749 public Array getArray(String parameterName) throws SQLException 750 { 751 checkState(); 752 try 753 { 754 return cs.getArray(parameterName); 755 } 756 catch (Throwable t) 757 { 758 throw checkException(t); 759 } 760 } 761 762 public void setBoolean(String parameterName, boolean value) throws SQLException 763 { 764 checkState(); 765 try 766 { 767 cs.setBoolean(parameterName, value); 768 } 769 catch (Throwable t) 770 { 771 throw checkException(t); 772 } 773 } 774 775 public void setByte(String parameterName, byte value) throws SQLException 776 { 777 checkState(); 778 try 779 { 780 cs.setByte(parameterName, value); 781 } 782 catch (Throwable t) 783 { 784 throw checkException(t); 785 } 786 } 787 788 public void setShort(String parameterName, short value) throws SQLException 789 { 790 checkState(); 791 try 792 { 793 cs.setShort(parameterName, value); 794 } 795 catch (Throwable t) 796 { 797 throw checkException(t); 798 } 799 } 800 801 public void setInt(String parameterName, int value) throws SQLException 802 { 803 checkState(); 804 try 805 { 806 cs.setInt(parameterName, value); 807 } 808 catch (Throwable t) 809 { 810 throw checkException(t); 811 } 812 } 813 814 public void setLong(String parameterName, long value) throws SQLException 815 { 816 checkState(); 817 try 818 { 819 cs.setLong(parameterName, value); 820 } 821 catch (Throwable t) 822 { 823 throw checkException(t); 824 } 825 } 826 827 public void setFloat(String parameterName, float value) throws SQLException 828 { 829 checkState(); 830 try 831 { 832 cs.setFloat(parameterName, value); 833 } 834 catch (Throwable t) 835 { 836 throw checkException(t); 837 } 838 } 839 840 public void setDouble(String parameterName, double value) throws SQLException 841 { 842 checkState(); 843 try 844 { 845 cs.setDouble(parameterName, value); 846 } 847 catch (Throwable t) 848 { 849 throw checkException(t); 850 } 851 } 852 853 public void setURL(String parameterName, URL value) throws SQLException 854 { 855 checkState(); 856 try 857 { 858 cs.setURL(parameterName, value); 859 } 860 catch (Throwable t) 861 { 862 throw checkException(t); 863 } 864 } 865 866 public void setTime(String parameterName, Time value) throws SQLException 867 { 868 checkState(); 869 try 870 { 871 cs.setTime(parameterName, value); 872 } 873 catch (Throwable t) 874 { 875 throw checkException(t); 876 } 877 } 878 879 public void setTime(String parameterName, Time value, Calendar calendar) throws SQLException 880 { 881 checkState(); 882 try 883 { 884 cs.setTime(parameterName, value, calendar); 885 } 886 catch (Throwable t) 887 { 888 throw checkException(t); 889 } 890 } 891 892 public void setNull(String parameterName, int value) throws SQLException 893 { 894 checkState(); 895 try 896 { 897 cs.setNull(parameterName, value); 898 } 899 catch (Throwable t) 900 { 901 throw checkException(t); 902 } 903 } 904 905 public void setNull(String parameterName, int sqlType, String typeName) throws SQLException 906 { 907 checkState(); 908 try 909 { 910 cs.setNull(parameterName, sqlType, typeName); 911 } 912 catch (Throwable t) 913 { 914 throw checkException(t); 915 } 916 } 917 918 public void setBigDecimal(String parameterName, BigDecimal value) throws SQLException 919 { 920 checkState(); 921 try 922 { 923 cs.setBigDecimal(parameterName, value); 924 } 925 catch (Throwable t) 926 { 927 throw checkException(t); 928 } 929 } 930 931 public void setString(String parameterName, String value) throws SQLException 932 { 933 checkState(); 934 try 935 { 936 cs.setString(parameterName, value); 937 } 938 catch (Throwable t) 939 { 940 throw checkException(t); 941 } 942 } 943 944 public void setBytes(String parameterName, byte[] value) throws SQLException 945 { 946 checkState(); 947 try 948 { 949 cs.setBytes(parameterName, value); 950 } 951 catch (Throwable t) 952 { 953 throw checkException(t); 954 } 955 } 956 957 public void setDate(String parameterName, Date value) throws SQLException 958 { 959 checkState(); 960 try 961 { 962 cs.setDate(parameterName, value); 963 } 964 catch (Throwable t) 965 { 966 throw checkException(t); 967 } 968 } 969 970 public void setDate(String parameterName, Date value, Calendar calendar) throws SQLException 971 { 972 checkState(); 973 try 974 { 975 cs.setDate(parameterName, value, calendar); 976 } 977 catch (Throwable t) 978 { 979 throw checkException(t); 980 } 981 } 982 983 public void setTimestamp(String parameterName, Timestamp value) throws SQLException 984 { 985 checkState(); 986 try 987 { 988 cs.setTimestamp(parameterName, value); 989 } 990 catch (Throwable t) 991 { 992 throw checkException(t); 993 } 994 } 995 996 public void setTimestamp(String parameterName, Timestamp value, Calendar calendar) throws SQLException 997 { 998 checkState(); 999 try 1000 { 1001 cs.setTimestamp(parameterName, value, calendar); 1002 } 1003 catch (Throwable t) 1004 { 1005 throw checkException(t); 1006 } 1007 } 1008 1009 public void setAsciiStream(String parameterName, InputStream stream, int length) throws SQLException 1010 { 1011 checkState(); 1012 try 1013 { 1014 cs.setAsciiStream(parameterName, stream, length); 1015 } 1016 catch (Throwable t) 1017 { 1018 throw checkException(t); 1019 } 1020 } 1021 1022 public void setBinaryStream(String parameterName, InputStream stream, int length) throws SQLException 1023 { 1024 checkState(); 1025 try 1026 { 1027 cs.setBinaryStream(parameterName, stream, length); 1028 } 1029 catch (Throwable t) 1030 { 1031 throw checkException(t); 1032 } 1033 } 1034 1035 public void setObject(String parameterName, Object value, int sqlType, int scale) throws SQLException 1036 { 1037 checkState(); 1038 try 1039 { 1040 cs.setObject(parameterName, value, sqlType, scale); 1041 } 1042 catch (Throwable t) 1043 { 1044 throw checkException(t); 1045 } 1046 } 1047 1048 public void setObject(String parameterName, Object value, int sqlType) throws SQLException 1049 { 1050 checkState(); 1051 try 1052 { 1053 cs.setObject(parameterName, value, sqlType); 1054 } 1055 catch (Throwable t) 1056 { 1057 throw checkException(t); 1058 } 1059 } 1060 1061 public void setObject(String parameterName, Object value) throws SQLException 1062 { 1063 checkState(); 1064 try 1065 { 1066 cs.setObject(parameterName, value); 1067 } 1068 catch (Throwable t) 1069 { 1070 throw checkException(t); 1071 } 1072 } 1073 1074 public void setCharacterStream(String parameterName, Reader reader, int length) throws SQLException 1075 { 1076 checkState(); 1077 try 1078 { 1079 cs.setCharacterStream(parameterName, reader, length); 1080 } 1081 catch (Throwable t) 1082 { 1083 throw checkException(t); 1084 } 1085 } 1086} 1087 | Popular Tags |