1 24 25 package com.mysql.jdbc.jdbc2.optional; 26 27 import java.io.InputStream ; 28 import java.io.Reader ; 29 import java.math.BigDecimal ; 30 import java.net.URL ; 31 import java.sql.Array ; 32 import java.sql.Blob ; 33 import java.sql.CallableStatement ; 34 import java.sql.Clob ; 35 import java.sql.Date ; 36 import java.sql.PreparedStatement ; 37 import java.sql.Ref ; 38 import java.sql.SQLException ; 39 import java.sql.Time ; 40 import java.sql.Timestamp ; 41 import java.util.Calendar ; 42 import java.util.Map ; 43 44 import com.mysql.jdbc.SQLError; 45 46 52 public class CallableStatementWrapper extends PreparedStatementWrapper 53 implements CallableStatement { 54 55 60 public CallableStatementWrapper(ConnectionWrapper c, 61 MysqlPooledConnection conn, CallableStatement toWrap) { 62 super(c, conn, toWrap); 63 } 64 65 70 public void registerOutParameter(int parameterIndex, int sqlType) 71 throws SQLException { 72 try { 73 if (this.wrappedStmt != null) { 74 ((CallableStatement ) this.wrappedStmt).registerOutParameter( 75 parameterIndex, sqlType); 76 } else { 77 throw new SQLException ( 78 "No operations allowed after statement closed", 79 SQLError.SQL_STATE_GENERAL_ERROR); 80 } 81 } catch (SQLException sqlEx) { 82 checkAndFireConnectionError(sqlEx); 83 } 84 } 85 86 91 public void registerOutParameter(int parameterIndex, int sqlType, int scale) 92 throws SQLException { 93 try { 94 if (this.wrappedStmt != null) { 95 ((CallableStatement ) this.wrappedStmt).registerOutParameter( 96 parameterIndex, sqlType, scale); 97 } else { 98 throw new SQLException ( 99 "No operations allowed after statement closed", 100 SQLError.SQL_STATE_GENERAL_ERROR); 101 } 102 } catch (SQLException sqlEx) { 103 checkAndFireConnectionError(sqlEx); 104 } 105 } 106 107 112 public boolean wasNull() throws SQLException { 113 try { 114 if (this.wrappedStmt != null) { 115 return ((CallableStatement ) this.wrappedStmt).wasNull(); 116 } else { 117 throw new SQLException ( 118 "No operations allowed after statement closed", 119 SQLError.SQL_STATE_GENERAL_ERROR); 120 } 121 } catch (SQLException sqlEx) { 122 checkAndFireConnectionError(sqlEx); 123 } 124 125 return false; 126 } 127 128 133 public String getString(int parameterIndex) throws SQLException { 134 try { 135 if (this.wrappedStmt != null) { 136 return ((CallableStatement ) this.wrappedStmt) 137 .getString(parameterIndex); 138 } else { 139 throw new SQLException ( 140 "No operations allowed after statement closed", 141 SQLError.SQL_STATE_GENERAL_ERROR); 142 } 143 } catch (SQLException sqlEx) { 144 checkAndFireConnectionError(sqlEx); 145 } 146 return null; 147 } 148 149 154 public boolean getBoolean(int parameterIndex) throws SQLException { 155 try { 156 if (this.wrappedStmt != null) { 157 return ((CallableStatement ) this.wrappedStmt) 158 .getBoolean(parameterIndex); 159 } else { 160 throw new SQLException ( 161 "No operations allowed after statement closed", 162 SQLError.SQL_STATE_GENERAL_ERROR); 163 } 164 } catch (SQLException sqlEx) { 165 checkAndFireConnectionError(sqlEx); 166 } 167 168 return false; 169 } 170 171 176 public byte getByte(int parameterIndex) throws SQLException { 177 try { 178 if (this.wrappedStmt != null) { 179 return ((CallableStatement ) this.wrappedStmt) 180 .getByte(parameterIndex); 181 } else { 182 throw new SQLException ( 183 "No operations allowed after statement closed", 184 SQLError.SQL_STATE_GENERAL_ERROR); 185 } 186 } catch (SQLException sqlEx) { 187 checkAndFireConnectionError(sqlEx); 188 } 189 190 return 0; 191 } 192 193 198 public short getShort(int parameterIndex) throws SQLException { 199 try { 200 if (this.wrappedStmt != null) { 201 return ((CallableStatement ) this.wrappedStmt) 202 .getShort(parameterIndex); 203 } else { 204 throw new SQLException ( 205 "No operations allowed after statement closed", 206 SQLError.SQL_STATE_GENERAL_ERROR); 207 } 208 } catch (SQLException sqlEx) { 209 checkAndFireConnectionError(sqlEx); 210 } 211 212 return 0; 213 } 214 215 220 public int getInt(int parameterIndex) throws SQLException { 221 try { 222 if (this.wrappedStmt != null) { 223 return ((CallableStatement ) this.wrappedStmt) 224 .getInt(parameterIndex); 225 } else { 226 throw new SQLException ( 227 "No operations allowed after statement closed", 228 SQLError.SQL_STATE_GENERAL_ERROR); 229 } 230 } catch (SQLException sqlEx) { 231 checkAndFireConnectionError(sqlEx); 232 } 233 234 return 0; 235 } 236 237 242 public long getLong(int parameterIndex) throws SQLException { 243 try { 244 if (this.wrappedStmt != null) { 245 return ((CallableStatement ) this.wrappedStmt) 246 .getLong(parameterIndex); 247 } else { 248 throw new SQLException ( 249 "No operations allowed after statement closed", 250 SQLError.SQL_STATE_GENERAL_ERROR); 251 } 252 } catch (SQLException sqlEx) { 253 checkAndFireConnectionError(sqlEx); 254 } 255 256 return 0; 257 } 258 259 264 public float getFloat(int parameterIndex) throws SQLException { 265 try { 266 if (this.wrappedStmt != null) { 267 return ((CallableStatement ) this.wrappedStmt) 268 .getFloat(parameterIndex); 269 } else { 270 throw new SQLException ( 271 "No operations allowed after statement closed", 272 SQLError.SQL_STATE_GENERAL_ERROR); 273 } 274 } catch (SQLException sqlEx) { 275 checkAndFireConnectionError(sqlEx); 276 } 277 278 return 0; 279 } 280 281 286 public double getDouble(int parameterIndex) throws SQLException { 287 try { 288 if (this.wrappedStmt != null) { 289 return ((CallableStatement ) this.wrappedStmt) 290 .getDouble(parameterIndex); 291 } else { 292 throw new SQLException ( 293 "No operations allowed after statement closed", 294 SQLError.SQL_STATE_GENERAL_ERROR); 295 } 296 } catch (SQLException sqlEx) { 297 checkAndFireConnectionError(sqlEx); 298 } 299 300 return 0; 301 } 302 303 308 public BigDecimal getBigDecimal(int parameterIndex, int scale) 309 throws SQLException { 310 try { 311 if (this.wrappedStmt != null) { 312 return ((CallableStatement ) this.wrappedStmt).getBigDecimal( 313 parameterIndex, scale); 314 } else { 315 throw new SQLException ( 316 "No operations allowed after statement closed", 317 SQLError.SQL_STATE_GENERAL_ERROR); 318 } 319 } catch (SQLException sqlEx) { 320 checkAndFireConnectionError(sqlEx); 321 } 322 323 return null; 324 } 325 326 331 public byte[] getBytes(int parameterIndex) throws SQLException { 332 try { 333 if (this.wrappedStmt != null) { 334 return ((CallableStatement ) this.wrappedStmt) 335 .getBytes(parameterIndex); 336 } else { 337 throw new SQLException ( 338 "No operations allowed after statement closed", 339 SQLError.SQL_STATE_GENERAL_ERROR); 340 } 341 } catch (SQLException sqlEx) { 342 checkAndFireConnectionError(sqlEx); 343 } 344 345 return null; 346 } 347 348 353 public Date getDate(int parameterIndex) throws SQLException { 354 try { 355 if (this.wrappedStmt != null) { 356 return ((CallableStatement ) this.wrappedStmt) 357 .getDate(parameterIndex); 358 } else { 359 throw new SQLException ( 360 "No operations allowed after statement closed", 361 SQLError.SQL_STATE_GENERAL_ERROR); 362 } 363 } catch (SQLException sqlEx) { 364 checkAndFireConnectionError(sqlEx); 365 } 366 367 return null; 368 } 369 370 375 public Time getTime(int parameterIndex) throws SQLException { 376 try { 377 if (this.wrappedStmt != null) { 378 return ((CallableStatement ) this.wrappedStmt) 379 .getTime(parameterIndex); 380 } else { 381 throw new SQLException ( 382 "No operations allowed after statement closed", 383 SQLError.SQL_STATE_GENERAL_ERROR); 384 } 385 } catch (SQLException sqlEx) { 386 checkAndFireConnectionError(sqlEx); 387 } 388 389 return null; 390 } 391 392 397 public Timestamp getTimestamp(int parameterIndex) throws SQLException { 398 try { 399 if (this.wrappedStmt != null) { 400 return ((CallableStatement ) this.wrappedStmt) 401 .getTimestamp(parameterIndex); 402 } else { 403 throw new SQLException ( 404 "No operations allowed after statement closed", 405 SQLError.SQL_STATE_GENERAL_ERROR); 406 } 407 } catch (SQLException sqlEx) { 408 checkAndFireConnectionError(sqlEx); 409 } 410 411 return null; 412 } 413 414 419 public Object getObject(int parameterIndex) throws SQLException { 420 try { 421 if (this.wrappedStmt != null) { 422 return ((CallableStatement ) this.wrappedStmt) 423 .getObject(parameterIndex); 424 } else { 425 throw new SQLException ( 426 "No operations allowed after statement closed", 427 SQLError.SQL_STATE_GENERAL_ERROR); 428 } 429 } catch (SQLException sqlEx) { 430 checkAndFireConnectionError(sqlEx); 431 } 432 433 return null; 434 } 435 436 441 public BigDecimal getBigDecimal(int parameterIndex) throws SQLException { 442 try { 443 if (this.wrappedStmt != null) { 444 return ((CallableStatement ) this.wrappedStmt) 445 .getBigDecimal(parameterIndex); 446 } else { 447 throw new SQLException ( 448 "No operations allowed after statement closed", 449 SQLError.SQL_STATE_GENERAL_ERROR); 450 } 451 } catch (SQLException sqlEx) { 452 checkAndFireConnectionError(sqlEx); 453 } 454 455 return null; 456 } 457 458 463 public Object getObject(int parameterIndex, Map typeMap) 464 throws SQLException { 465 try { 466 if (this.wrappedStmt != null) { 467 return ((CallableStatement ) this.wrappedStmt).getObject( 468 parameterIndex, typeMap); 469 } else { 470 throw new SQLException ( 471 "No operations allowed after statement closed", 472 SQLError.SQL_STATE_GENERAL_ERROR); 473 } 474 } catch (SQLException sqlEx) { 475 checkAndFireConnectionError(sqlEx); 476 } 477 return null; 478 } 479 480 485 public Ref getRef(int parameterIndex) throws SQLException { 486 try { 487 if (this.wrappedStmt != null) { 488 return ((CallableStatement ) this.wrappedStmt) 489 .getRef(parameterIndex); 490 } else { 491 throw new SQLException ( 492 "No operations allowed after statement closed", 493 SQLError.SQL_STATE_GENERAL_ERROR); 494 } 495 } catch (SQLException sqlEx) { 496 checkAndFireConnectionError(sqlEx); 497 } 498 499 return null; 500 } 501 502 507 public Blob getBlob(int parameterIndex) throws SQLException { 508 try { 509 if (this.wrappedStmt != null) { 510 return ((CallableStatement ) this.wrappedStmt) 511 .getBlob(parameterIndex); 512 } else { 513 throw new SQLException ( 514 "No operations allowed after statement closed", 515 SQLError.SQL_STATE_GENERAL_ERROR); 516 } 517 } catch (SQLException sqlEx) { 518 checkAndFireConnectionError(sqlEx); 519 } 520 521 return null; 522 } 523 524 529 public Clob getClob(int parameterIndex) throws SQLException { 530 try { 531 if (this.wrappedStmt != null) { 532 return ((CallableStatement ) this.wrappedStmt) 533 .getClob(parameterIndex); 534 } else { 535 throw new SQLException ( 536 "No operations allowed after statement closed", 537 SQLError.SQL_STATE_GENERAL_ERROR); 538 } 539 } catch (SQLException sqlEx) { 540 checkAndFireConnectionError(sqlEx); 541 } 542 return null; 543 } 544 545 550 public Array getArray(int parameterIndex) throws SQLException { 551 try { 552 if (this.wrappedStmt != null) { 553 return ((CallableStatement ) this.wrappedStmt) 554 .getArray(parameterIndex); 555 } else { 556 throw new SQLException ( 557 "No operations allowed after statement closed", 558 SQLError.SQL_STATE_GENERAL_ERROR); 559 } 560 } catch (SQLException sqlEx) { 561 checkAndFireConnectionError(sqlEx); 562 } 563 return null; 564 } 565 566 571 public Date getDate(int parameterIndex, Calendar cal) throws SQLException { 572 try { 573 if (this.wrappedStmt != null) { 574 return ((CallableStatement ) this.wrappedStmt).getDate( 575 parameterIndex, cal); 576 } else { 577 throw new SQLException ( 578 "No operations allowed after statement closed", 579 SQLError.SQL_STATE_GENERAL_ERROR); 580 } 581 } catch (SQLException sqlEx) { 582 checkAndFireConnectionError(sqlEx); 583 } 584 return null; 585 } 586 587 592 public Time getTime(int parameterIndex, Calendar cal) throws SQLException { 593 try { 594 if (this.wrappedStmt != null) { 595 return ((CallableStatement ) this.wrappedStmt).getTime( 596 parameterIndex, cal); 597 } else { 598 throw new SQLException ( 599 "No operations allowed after statement closed", 600 SQLError.SQL_STATE_GENERAL_ERROR); 601 } 602 } catch (SQLException sqlEx) { 603 checkAndFireConnectionError(sqlEx); 604 } 605 return null; 606 } 607 608 613 public Timestamp getTimestamp(int parameterIndex, Calendar cal) 614 throws SQLException { 615 try { 616 if (this.wrappedStmt != null) { 617 return ((CallableStatement ) this.wrappedStmt).getTimestamp( 618 parameterIndex, cal); 619 } else { 620 throw new SQLException ( 621 "No operations allowed after statement closed", 622 SQLError.SQL_STATE_GENERAL_ERROR); 623 } 624 } catch (SQLException sqlEx) { 625 checkAndFireConnectionError(sqlEx); 626 } 627 return null; 628 } 629 630 636 public void registerOutParameter(int paramIndex, int sqlType, 637 String typeName) throws SQLException { 638 try { 639 if (this.wrappedStmt != null) { 640 ((CallableStatement ) this.wrappedStmt).registerOutParameter( 641 paramIndex, sqlType, typeName); 642 } else { 643 throw new SQLException ( 644 "No operations allowed after statement closed", 645 SQLError.SQL_STATE_GENERAL_ERROR); 646 } 647 } catch (SQLException sqlEx) { 648 checkAndFireConnectionError(sqlEx); 649 } 650 } 651 652 658 public void registerOutParameter(String parameterName, int sqlType) 659 throws SQLException { 660 try { 661 if (this.wrappedStmt != null) { 662 ((CallableStatement ) this.wrappedStmt).registerOutParameter( 663 parameterName, sqlType); 664 } else { 665 throw new SQLException ( 666 "No operations allowed after statement closed", 667 SQLError.SQL_STATE_GENERAL_ERROR); 668 } 669 } catch (SQLException sqlEx) { 670 checkAndFireConnectionError(sqlEx); 671 } 672 } 673 674 680 public void registerOutParameter(String parameterName, int sqlType, 681 int scale) throws SQLException { 682 try { 683 if (this.wrappedStmt != null) { 684 ((CallableStatement ) this.wrappedStmt).registerOutParameter( 685 parameterName, sqlType, scale); 686 } else { 687 throw new SQLException ( 688 "No operations allowed after statement closed", 689 SQLError.SQL_STATE_GENERAL_ERROR); 690 } 691 } catch (SQLException sqlEx) { 692 checkAndFireConnectionError(sqlEx); 693 } 694 } 695 696 702 public void registerOutParameter(String parameterName, int sqlType, 703 String typeName) throws SQLException { 704 try { 705 if (this.wrappedStmt != null) { 706 ((CallableStatement ) this.wrappedStmt).registerOutParameter( 707 parameterName, sqlType, typeName); 708 } else { 709 throw new SQLException ( 710 "No operations allowed after statement closed", 711 SQLError.SQL_STATE_GENERAL_ERROR); 712 } 713 } catch (SQLException sqlEx) { 714 checkAndFireConnectionError(sqlEx); 715 } 716 } 717 718 723 public URL getURL(int parameterIndex) throws SQLException { 724 try { 725 if (this.wrappedStmt != null) { 726 return ((CallableStatement ) this.wrappedStmt) 727 .getURL(parameterIndex); 728 } else { 729 throw new SQLException ( 730 "No operations allowed after statement closed", 731 SQLError.SQL_STATE_GENERAL_ERROR); 732 } 733 } catch (SQLException sqlEx) { 734 checkAndFireConnectionError(sqlEx); 735 } 736 737 return null; 738 } 739 740 745 public void setURL(String parameterName, URL val) throws SQLException { 746 try { 747 if (this.wrappedStmt != null) { 748 ((CallableStatement ) this.wrappedStmt).setURL(parameterName, 749 val); 750 } else { 751 throw new SQLException ( 752 "No operations allowed after statement closed", 753 SQLError.SQL_STATE_GENERAL_ERROR); 754 } 755 } catch (SQLException sqlEx) { 756 checkAndFireConnectionError(sqlEx); 757 } 758 } 759 760 765 public void setNull(String parameterName, int sqlType) throws SQLException { 766 try { 767 if (this.wrappedStmt != null) { 768 ((CallableStatement ) this.wrappedStmt).setNull(parameterName, 769 sqlType); 770 } else { 771 throw new SQLException ( 772 "No operations allowed after statement closed", 773 SQLError.SQL_STATE_GENERAL_ERROR); 774 } 775 } catch (SQLException sqlEx) { 776 checkAndFireConnectionError(sqlEx); 777 } 778 } 779 780 785 public void setBoolean(String parameterName, boolean x) throws SQLException { 786 try { 787 if (this.wrappedStmt != null) { 788 ((CallableStatement ) this.wrappedStmt).setBoolean( 789 parameterName, x); 790 } else { 791 throw new SQLException ( 792 "No operations allowed after statement closed", 793 SQLError.SQL_STATE_GENERAL_ERROR); 794 } 795 } catch (SQLException sqlEx) { 796 checkAndFireConnectionError(sqlEx); 797 } 798 } 799 800 805 public void setByte(String parameterName, byte x) throws SQLException { 806 try { 807 if (this.wrappedStmt != null) { 808 ((CallableStatement ) this.wrappedStmt) 809 .setByte(parameterName, x); 810 } else { 811 throw new SQLException ( 812 "No operations allowed after statement closed", 813 SQLError.SQL_STATE_GENERAL_ERROR); 814 } 815 } catch (SQLException sqlEx) { 816 checkAndFireConnectionError(sqlEx); 817 } 818 } 819 820 825 public void setShort(String parameterName, short x) throws SQLException { 826 try { 827 if (this.wrappedStmt != null) { 828 ((CallableStatement ) this.wrappedStmt).setShort(parameterName, 829 x); 830 } else { 831 throw new SQLException ( 832 "No operations allowed after statement closed", 833 SQLError.SQL_STATE_GENERAL_ERROR); 834 } 835 } catch (SQLException sqlEx) { 836 checkAndFireConnectionError(sqlEx); 837 } 838 } 839 840 845 public void setInt(String parameterName, int x) throws SQLException { 846 try { 847 if (this.wrappedStmt != null) { 848 ((CallableStatement ) this.wrappedStmt).setInt(parameterName, x); 849 } else { 850 throw new SQLException ( 851 "No operations allowed after statement closed", 852 SQLError.SQL_STATE_GENERAL_ERROR); 853 } 854 } catch (SQLException sqlEx) { 855 checkAndFireConnectionError(sqlEx); 856 } 857 } 858 859 864 public void setLong(String parameterName, long x) throws SQLException { 865 try { 866 if (this.wrappedStmt != null) { 867 ((CallableStatement ) this.wrappedStmt) 868 .setLong(parameterName, x); 869 } else { 870 throw new SQLException ( 871 "No operations allowed after statement closed", 872 SQLError.SQL_STATE_GENERAL_ERROR); 873 } 874 } catch (SQLException sqlEx) { 875 checkAndFireConnectionError(sqlEx); 876 } 877 } 878 879 884 public void setFloat(String parameterName, float x) throws SQLException { 885 try { 886 if (this.wrappedStmt != null) { 887 ((CallableStatement ) this.wrappedStmt).setFloat(parameterName, 888 x); 889 } else { 890 throw new SQLException ( 891 "No operations allowed after statement closed", 892 SQLError.SQL_STATE_GENERAL_ERROR); 893 } 894 } catch (SQLException sqlEx) { 895 checkAndFireConnectionError(sqlEx); 896 } 897 } 898 899 904 public void setDouble(String parameterName, double x) throws SQLException { 905 try { 906 if (this.wrappedStmt != null) { 907 ((CallableStatement ) this.wrappedStmt).setDouble(parameterName, 908 x); 909 } else { 910 throw new SQLException ( 911 "No operations allowed after statement closed", 912 SQLError.SQL_STATE_GENERAL_ERROR); 913 } 914 } catch (SQLException sqlEx) { 915 checkAndFireConnectionError(sqlEx); 916 } 917 } 918 919 925 public void setBigDecimal(String parameterName, BigDecimal x) 926 throws SQLException { 927 try { 928 if (this.wrappedStmt != null) { 929 ((CallableStatement ) this.wrappedStmt).setBigDecimal( 930 parameterName, x); 931 } else { 932 throw new SQLException ( 933 "No operations allowed after statement closed", 934 SQLError.SQL_STATE_GENERAL_ERROR); 935 } 936 } catch (SQLException sqlEx) { 937 checkAndFireConnectionError(sqlEx); 938 } 939 } 940 941 947 public void setString(String parameterName, String x) throws SQLException { 948 try { 949 if (this.wrappedStmt != null) { 950 ((CallableStatement ) this.wrappedStmt).setString(parameterName, 951 x); 952 } else { 953 throw new SQLException ( 954 "No operations allowed after statement closed", 955 SQLError.SQL_STATE_GENERAL_ERROR); 956 } 957 } catch (SQLException sqlEx) { 958 checkAndFireConnectionError(sqlEx); 959 } 960 } 961 962 967 public void setBytes(String parameterName, byte[] x) throws SQLException { 968 try { 969 if (this.wrappedStmt != null) { 970 ((CallableStatement ) this.wrappedStmt).setBytes(parameterName, 971 x); 972 } else { 973 throw new SQLException ( 974 "No operations allowed after statement closed", 975 SQLError.SQL_STATE_GENERAL_ERROR); 976 } 977 } catch (SQLException sqlEx) { 978 checkAndFireConnectionError(sqlEx); 979 } 980 } 981 982 987 public void setDate(String parameterName, Date x) throws SQLException { 988 try { 989 if (this.wrappedStmt != null) { 990 ((CallableStatement ) this.wrappedStmt) 991 .setDate(parameterName, x); 992 } else { 993 throw new SQLException ( 994 "No operations allowed after statement closed", 995 SQLError.SQL_STATE_GENERAL_ERROR); 996 } 997 } catch (SQLException sqlEx) { 998 checkAndFireConnectionError(sqlEx); 999 } 1000 } 1001 1002 1007 public void setTime(String parameterName, Time x) throws SQLException { 1008 try { 1009 if (this.wrappedStmt != null) { 1010 ((CallableStatement ) this.wrappedStmt) 1011 .setTime(parameterName, x); 1012 } else { 1013 throw new SQLException ( 1014 "No operations allowed after statement closed", 1015 SQLError.SQL_STATE_GENERAL_ERROR); 1016 } 1017 } catch (SQLException sqlEx) { 1018 checkAndFireConnectionError(sqlEx); 1019 } 1020 } 1021 1022 1028 public void setTimestamp(String parameterName, Timestamp x) 1029 throws SQLException { 1030 try { 1031 if (this.wrappedStmt != null) { 1032 ((CallableStatement ) this.wrappedStmt).setTimestamp( 1033 parameterName, x); 1034 } else { 1035 throw new SQLException ( 1036 "No operations allowed after statement closed", 1037 SQLError.SQL_STATE_GENERAL_ERROR); 1038 } 1039 } catch (SQLException sqlEx) { 1040 checkAndFireConnectionError(sqlEx); 1041 } 1042 } 1043 1044 1050 public void setAsciiStream(String parameterName, InputStream x, int length) 1051 throws SQLException { 1052 try { 1053 if (this.wrappedStmt != null) { 1054 ((CallableStatement ) this.wrappedStmt).setAsciiStream( 1055 parameterName, x, length); 1056 } else { 1057 throw new SQLException ( 1058 "No operations allowed after statement closed", 1059 SQLError.SQL_STATE_GENERAL_ERROR); 1060 } 1061 } catch (SQLException sqlEx) { 1062 checkAndFireConnectionError(sqlEx); 1063 } 1064 1065 } 1066 1067 1073 public void setBinaryStream(String parameterName, InputStream x, int length) 1074 throws SQLException { 1075 try { 1076 if (this.wrappedStmt != null) { 1077 ((CallableStatement ) this.wrappedStmt).setBinaryStream( 1078 parameterName, x, length); 1079 } else { 1080 throw new SQLException ( 1081 "No operations allowed after statement closed", 1082 SQLError.SQL_STATE_GENERAL_ERROR); 1083 } 1084 } catch (SQLException sqlEx) { 1085 checkAndFireConnectionError(sqlEx); 1086 } 1087 } 1088 1089 1095 public void setObject(String parameterName, Object x, int targetSqlType, 1096 int scale) throws SQLException { 1097 try { 1098 if (this.wrappedStmt != null) { 1099 ((CallableStatement ) this.wrappedStmt).setObject(parameterName, 1100 x, targetSqlType, scale); 1101 } else { 1102 throw new SQLException ( 1103 "No operations allowed after statement closed", 1104 SQLError.SQL_STATE_GENERAL_ERROR); 1105 } 1106 } catch (SQLException sqlEx) { 1107 checkAndFireConnectionError(sqlEx); 1108 } 1109 } 1110 1111 1117 public void setObject(String parameterName, Object x, int targetSqlType) 1118 throws SQLException { 1119 try { 1120 if (this.wrappedStmt != null) { 1121 ((CallableStatement ) this.wrappedStmt).setObject(parameterName, 1122 x, targetSqlType); 1123 } else { 1124 throw new SQLException ( 1125 "No operations allowed after statement closed", 1126 SQLError.SQL_STATE_GENERAL_ERROR); 1127 } 1128 } catch (SQLException sqlEx) { 1129 checkAndFireConnectionError(sqlEx); 1130 } 1131 } 1132 1133 1139 public void setObject(String parameterName, Object x) throws SQLException { 1140 try { 1141 if (this.wrappedStmt != null) { 1142 ((CallableStatement ) this.wrappedStmt).setObject(parameterName, 1143 x); 1144 } else { 1145 throw new SQLException ( 1146 "No operations allowed after statement closed", 1147 SQLError.SQL_STATE_GENERAL_ERROR); 1148 } 1149 } catch (SQLException sqlEx) { 1150 checkAndFireConnectionError(sqlEx); 1151 } 1152 } 1153 1154 1160 public void setCharacterStream(String parameterName, Reader reader, 1161 int length) throws SQLException { 1162 try { 1163 if (this.wrappedStmt != null) { 1164 ((CallableStatement ) this.wrappedStmt).setCharacterStream( 1165 parameterName, reader, length); 1166 } else { 1167 throw new SQLException ( 1168 "No operations allowed after statement closed", 1169 SQLError.SQL_STATE_GENERAL_ERROR); 1170 } 1171 } catch (SQLException sqlEx) { 1172 checkAndFireConnectionError(sqlEx); 1173 } 1174 } 1175 1176 1182 public void setDate(String parameterName, Date x, Calendar cal) 1183 throws SQLException { 1184 try { 1185 if (this.wrappedStmt != null) { 1186 ((CallableStatement ) this.wrappedStmt).setDate(parameterName, 1187 x, cal); 1188 } else { 1189 throw new SQLException ( 1190 "No operations allowed after statement closed", 1191 SQLError.SQL_STATE_GENERAL_ERROR); 1192 } 1193 } catch (SQLException sqlEx) { 1194 checkAndFireConnectionError(sqlEx); 1195 } 1196 } 1197 1198 1204 public void setTime(String parameterName, Time x, Calendar cal) 1205 throws SQLException { 1206 try { 1207 if (this.wrappedStmt != null) { 1208 ((CallableStatement ) this.wrappedStmt).setTime(parameterName, 1209 x, cal); 1210 } else { 1211 throw new SQLException ( 1212 "No operations allowed after statement closed", 1213 SQLError.SQL_STATE_GENERAL_ERROR); 1214 } 1215 } catch (SQLException sqlEx) { 1216 checkAndFireConnectionError(sqlEx); 1217 } 1218 } 1219 1220 1226 public void setTimestamp(String parameterName, Timestamp x, Calendar cal) 1227 throws SQLException { 1228 try { 1229 if (this.wrappedStmt != null) { 1230 ((CallableStatement ) this.wrappedStmt).setTimestamp( 1231 parameterName, x, cal); 1232 } else { 1233 throw new SQLException ( 1234 "No operations allowed after statement closed", 1235 SQLError.SQL_STATE_GENERAL_ERROR); 1236 } 1237 } catch (SQLException sqlEx) { 1238 checkAndFireConnectionError(sqlEx); 1239 } 1240 } 1241 1242 1248 public void setNull(String parameterName, int sqlType, String typeName) 1249 throws SQLException { 1250 try { 1251 if (this.wrappedStmt != null) { 1252 ((CallableStatement ) this.wrappedStmt).setNull(parameterName, 1253 sqlType, typeName); 1254 } else { 1255 throw new SQLException ( 1256 "No operations allowed after statement closed", 1257 SQLError.SQL_STATE_GENERAL_ERROR); 1258 } 1259 } catch (SQLException sqlEx) { 1260 checkAndFireConnectionError(sqlEx); 1261 } 1262 } 1263 1264 1269 public String getString(String parameterName) throws SQLException { 1270 try { 1271 if (this.wrappedStmt != null) { 1272 return ((CallableStatement ) this.wrappedStmt) 1273 .getString(parameterName); 1274 } else { 1275 throw new SQLException ( 1276 "No operations allowed after statement closed", 1277 SQLError.SQL_STATE_GENERAL_ERROR); 1278 } 1279 } catch (SQLException sqlEx) { 1280 checkAndFireConnectionError(sqlEx); 1281 } 1282 return null; 1283 } 1284 1285 1290 public boolean getBoolean(String parameterName) throws SQLException { 1291 try { 1292 if (this.wrappedStmt != null) { 1293 return ((CallableStatement ) this.wrappedStmt) 1294 .getBoolean(parameterName); 1295 } else { 1296 throw new SQLException ( 1297 "No operations allowed after statement closed", 1298 SQLError.SQL_STATE_GENERAL_ERROR); 1299 } 1300 } catch (SQLException sqlEx) { 1301 checkAndFireConnectionError(sqlEx); 1302 } 1303 1304 return false; 1305 } 1306 1307 1312 public byte getByte(String parameterName) throws SQLException { 1313 try { 1314 if (this.wrappedStmt != null) { 1315 return ((CallableStatement ) this.wrappedStmt) 1316 .getByte(parameterName); 1317 } else { 1318 throw new SQLException ( 1319 "No operations allowed after statement closed", 1320 SQLError.SQL_STATE_GENERAL_ERROR); 1321 } 1322 } catch (SQLException sqlEx) { 1323 checkAndFireConnectionError(sqlEx); 1324 } 1325 1326 return 0; 1327 } 1328 1329 1334 public short getShort(String parameterName) throws SQLException { 1335 try { 1336 if (this.wrappedStmt != null) { 1337 return ((CallableStatement ) this.wrappedStmt) 1338 .getShort(parameterName); 1339 } else { 1340 throw new SQLException ( 1341 "No operations allowed after statement closed", 1342 SQLError.SQL_STATE_GENERAL_ERROR); 1343 } 1344 } catch (SQLException sqlEx) { 1345 checkAndFireConnectionError(sqlEx); 1346 } 1347 1348 return 0; 1349 } 1350 1351 1356 public int getInt(String parameterName) throws SQLException { 1357 try { 1358 if (this.wrappedStmt != null) { 1359 return ((CallableStatement ) this.wrappedStmt) 1360 .getInt(parameterName); 1361 } else { 1362 throw new SQLException ( 1363 "No operations allowed after statement closed", 1364 SQLError.SQL_STATE_GENERAL_ERROR); 1365 } 1366 } catch (SQLException sqlEx) { 1367 checkAndFireConnectionError(sqlEx); 1368 } 1369 1370 return 0; 1371 } 1372 1373 1378 public long getLong(String parameterName) throws SQLException { 1379 try { 1380 if (this.wrappedStmt != null) { 1381 return ((CallableStatement ) this.wrappedStmt) 1382 .getLong(parameterName); 1383 } else { 1384 throw new SQLException ( 1385 "No operations allowed after statement closed", 1386 SQLError.SQL_STATE_GENERAL_ERROR); 1387 } 1388 } catch (SQLException sqlEx) { 1389 checkAndFireConnectionError(sqlEx); 1390 } 1391 1392 return 0; 1393 } 1394 1395 1400 public float getFloat(String parameterName) throws SQLException { 1401 try { 1402 if (this.wrappedStmt != null) { 1403 return ((CallableStatement ) this.wrappedStmt) 1404 .getFloat(parameterName); 1405 } else { 1406 throw new SQLException ( 1407 "No operations allowed after statement closed", 1408 SQLError.SQL_STATE_GENERAL_ERROR); 1409 } 1410 } catch (SQLException sqlEx) { 1411 checkAndFireConnectionError(sqlEx); 1412 } 1413 1414 return 0; 1415 } 1416 1417 1422 public double getDouble(String parameterName) throws SQLException { 1423 try { 1424 if (this.wrappedStmt != null) { 1425 return ((CallableStatement ) this.wrappedStmt) 1426 .getDouble(parameterName); 1427 } else { 1428 throw new SQLException ( 1429 "No operations allowed after statement closed", 1430 SQLError.SQL_STATE_GENERAL_ERROR); 1431 } 1432 } catch (SQLException sqlEx) { 1433 checkAndFireConnectionError(sqlEx); 1434 } 1435 1436 return 0; 1437 } 1438 1439 1444 public byte[] getBytes(String parameterName) throws SQLException { 1445 try { 1446 if (this.wrappedStmt != null) { 1447 return ((CallableStatement ) this.wrappedStmt) 1448 .getBytes(parameterName); 1449 } else { 1450 throw new SQLException ( 1451 "No operations allowed after statement closed", 1452 SQLError.SQL_STATE_GENERAL_ERROR); 1453 } 1454 } catch (SQLException sqlEx) { 1455 checkAndFireConnectionError(sqlEx); 1456 } 1457 1458 return null; 1459 } 1460 1461 1466 public Date getDate(String parameterName) throws SQLException { 1467 try { 1468 if (this.wrappedStmt != null) { 1469 return ((CallableStatement ) this.wrappedStmt) 1470 .getDate(parameterName); 1471 } else { 1472 throw new SQLException ( 1473 "No operations allowed after statement closed", 1474 SQLError.SQL_STATE_GENERAL_ERROR); 1475 } 1476 } catch (SQLException sqlEx) { 1477 checkAndFireConnectionError(sqlEx); 1478 } 1479 1480 return null; 1481 } 1482 1483 1488 public Time getTime(String parameterName) throws SQLException { 1489 try { 1490 if (this.wrappedStmt != null) { 1491 return ((CallableStatement ) this.wrappedStmt) 1492 .getTime(parameterName); 1493 } else { 1494 throw new SQLException ( 1495 "No operations allowed after statement closed", 1496 SQLError.SQL_STATE_GENERAL_ERROR); 1497 } 1498 } catch (SQLException sqlEx) { 1499 checkAndFireConnectionError(sqlEx); 1500 } 1501 1502 return null; 1503 } 1504 1505 1510 public Timestamp getTimestamp(String parameterName) throws SQLException { 1511 try { 1512 if (this.wrappedStmt != null) { 1513 return ((CallableStatement ) this.wrappedStmt) 1514 .getTimestamp(parameterName); 1515 } else { 1516 throw new SQLException ( 1517 "No operations allowed after statement closed", 1518 SQLError.SQL_STATE_GENERAL_ERROR); 1519 } 1520 } catch (SQLException sqlEx) { 1521 checkAndFireConnectionError(sqlEx); 1522 } 1523 1524 return null; 1525 } 1526 1527 1532 public Object getObject(String parameterName) throws SQLException { 1533 try { 1534 if (this.wrappedStmt != null) { 1535 return ((CallableStatement ) this.wrappedStmt) 1536 .getObject(parameterName); 1537 } else { 1538 throw new SQLException ( 1539 "No operations allowed after statement closed", 1540 SQLError.SQL_STATE_GENERAL_ERROR); 1541 } 1542 } catch (SQLException sqlEx) { 1543 checkAndFireConnectionError(sqlEx); 1544 } 1545 1546 return null; 1547 } 1548 1549 1554 public BigDecimal getBigDecimal(String parameterName) throws SQLException { 1555 try { 1556 if (this.wrappedStmt != null) { 1557 return ((CallableStatement ) this.wrappedStmt) 1558 .getBigDecimal(parameterName); 1559 } else { 1560 throw new SQLException ( 1561 "No operations allowed after statement closed", 1562 SQLError.SQL_STATE_GENERAL_ERROR); 1563 } 1564 } catch (SQLException sqlEx) { 1565 checkAndFireConnectionError(sqlEx); 1566 } 1567 1568 return null; 1569 } 1570 1571 1576 public Object getObject(String parameterName, Map typeMap) 1577 throws SQLException { 1578 try { 1579 if (this.wrappedStmt != null) { 1580 return ((CallableStatement ) this.wrappedStmt).getObject( 1581 parameterName, typeMap); 1582 } else { 1583 throw new SQLException ( 1584 "No operations allowed after statement closed", 1585 SQLError.SQL_STATE_GENERAL_ERROR); 1586 } 1587 } catch (SQLException sqlEx) { 1588 checkAndFireConnectionError(sqlEx); 1589 } 1590 return null; 1591 } 1592 1593 1598 public Ref getRef(String parameterName) throws SQLException { 1599 try { 1600 if (this.wrappedStmt != null) { 1601 return ((CallableStatement ) this.wrappedStmt) 1602 .getRef(parameterName); 1603 } else { 1604 throw new SQLException ( 1605 "No operations allowed after statement closed", 1606 SQLError.SQL_STATE_GENERAL_ERROR); 1607 } 1608 } catch (SQLException sqlEx) { 1609 checkAndFireConnectionError(sqlEx); 1610 } 1611 1612 return null; 1613 } 1614 1615 1620 public Blob getBlob(String parameterName) throws SQLException { 1621 try { 1622 if (this.wrappedStmt != null) { 1623 return ((CallableStatement ) this.wrappedStmt) 1624 .getBlob(parameterName); 1625 } else { 1626 throw new SQLException ( 1627 "No operations allowed after statement closed", 1628 SQLError.SQL_STATE_GENERAL_ERROR); 1629 } 1630 } catch (SQLException sqlEx) { 1631 checkAndFireConnectionError(sqlEx); 1632 } 1633 1634 return null; 1635 } 1636 1637 1642 public Clob getClob(String parameterName) throws SQLException { 1643 try { 1644 if (this.wrappedStmt != null) { 1645 return ((CallableStatement ) this.wrappedStmt) 1646 .getClob(parameterName); 1647 } else { 1648 throw new SQLException ( 1649 "No operations allowed after statement closed", 1650 SQLError.SQL_STATE_GENERAL_ERROR); 1651 } 1652 } catch (SQLException sqlEx) { 1653 checkAndFireConnectionError(sqlEx); 1654 } 1655 return null; 1656 } 1657 1658 1663 public Array getArray(String parameterName) throws SQLException { 1664 try { 1665 if (this.wrappedStmt != null) { 1666 return ((CallableStatement ) this.wrappedStmt) 1667 .getArray(parameterName); 1668 } else { 1669 throw new SQLException ( 1670 "No operations allowed after statement closed", 1671 SQLError.SQL_STATE_GENERAL_ERROR); 1672 } 1673 } catch (SQLException sqlEx) { 1674 checkAndFireConnectionError(sqlEx); 1675 } 1676 return null; 1677 } 1678 1679 1684 public Date getDate(String parameterName, Calendar cal) throws SQLException { 1685 try { 1686 if (this.wrappedStmt != null) { 1687 return ((CallableStatement ) this.wrappedStmt).getDate( 1688 parameterName, cal); 1689 } else { 1690 throw new SQLException ( 1691 "No operations allowed after statement closed", 1692 SQLError.SQL_STATE_GENERAL_ERROR); 1693 } 1694 } catch (SQLException sqlEx) { 1695 checkAndFireConnectionError(sqlEx); 1696 } 1697 return null; 1698 } 1699 1700 1705 public Time getTime(String parameterName, Calendar cal) throws SQLException { 1706 try { 1707 if (this.wrappedStmt != null) { 1708 return ((CallableStatement ) this.wrappedStmt).getTime( 1709 parameterName, cal); 1710 } else { 1711 throw new SQLException ( 1712 "No operations allowed after statement closed", 1713 SQLError.SQL_STATE_GENERAL_ERROR); 1714 } 1715 } catch (SQLException sqlEx) { 1716 checkAndFireConnectionError(sqlEx); 1717 } 1718 return null; 1719 } 1720 1721 1726 public Timestamp getTimestamp(String parameterName, Calendar cal) 1727 throws SQLException { 1728 try { 1729 if (this.wrappedStmt != null) { 1730 return ((CallableStatement ) this.wrappedStmt).getTimestamp( 1731 parameterName, cal); 1732 } else { 1733 throw new SQLException ( 1734 "No operations allowed after statement closed", 1735 SQLError.SQL_STATE_GENERAL_ERROR); 1736 } 1737 } catch (SQLException sqlEx) { 1738 checkAndFireConnectionError(sqlEx); 1739 } 1740 return null; 1741 } 1742 1743 1748 public URL getURL(String parameterName) throws SQLException { 1749 try { 1750 if (this.wrappedStmt != null) { 1751 return ((CallableStatement ) this.wrappedStmt) 1752 .getURL(parameterName); 1753 } else { 1754 throw new SQLException ( 1755 "No operations allowed after statement closed", 1756 SQLError.SQL_STATE_GENERAL_ERROR); 1757 } 1758 } catch (SQLException sqlEx) { 1759 checkAndFireConnectionError(sqlEx); 1760 } 1761 1762 return null; 1763 } 1764 1765} 1766 | Popular Tags |