1 21 package net.sf.hajdbc.sql; 22 23 import java.io.File ; 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.Clob ; 31 import java.sql.Date ; 32 import java.sql.Ref ; 33 import java.sql.SQLException ; 34 import java.sql.Time ; 35 import java.sql.Timestamp ; 36 import java.util.Calendar ; 37 import java.util.Map ; 38 39 import net.sf.hajdbc.Database; 40 import net.sf.hajdbc.Operation; 41 42 47 public class CallableStatement extends PreparedStatement<java.sql.CallableStatement > implements java.sql.CallableStatement 48 { 49 56 public CallableStatement(Connection<?> connection, Operation<java.sql.Connection , java.sql.CallableStatement > operation, String sql) throws java.sql.SQLException 57 { 58 super(connection, operation, sql); 59 } 60 61 64 public Array getArray(final int index) throws SQLException 65 { 66 Operation<java.sql.CallableStatement , Array > operation = new Operation<java.sql.CallableStatement , Array >() 67 { 68 public Array execute(Database database, java.sql.CallableStatement statement) throws SQLException 69 { 70 return statement.getArray(index); 71 } 72 }; 73 74 return this.executeReadFromDriver(operation); 75 } 76 77 80 public Array getArray(final String name) throws SQLException 81 { 82 Operation<java.sql.CallableStatement , Array > operation = new Operation<java.sql.CallableStatement , Array >() 83 { 84 public Array execute(Database database, java.sql.CallableStatement statement) throws SQLException 85 { 86 return statement.getArray(name); 87 } 88 }; 89 90 return this.executeReadFromDriver(operation); 91 } 92 93 96 public BigDecimal getBigDecimal(final int index) throws SQLException 97 { 98 Operation<java.sql.CallableStatement , BigDecimal > operation = new Operation<java.sql.CallableStatement , BigDecimal >() 99 { 100 public BigDecimal execute(Database database, java.sql.CallableStatement statement) throws SQLException 101 { 102 return statement.getBigDecimal(index); 103 } 104 }; 105 106 return this.executeReadFromDriver(operation); 107 } 108 109 113 @Deprecated 114 public BigDecimal getBigDecimal(final int index, final int scale) throws SQLException 115 { 116 Operation<java.sql.CallableStatement , BigDecimal > operation = new Operation<java.sql.CallableStatement , BigDecimal >() 117 { 118 public BigDecimal execute(Database database, java.sql.CallableStatement statement) throws SQLException 119 { 120 return statement.getBigDecimal(index, scale); 121 } 122 }; 123 124 return this.executeReadFromDriver(operation); 125 } 126 127 130 public BigDecimal getBigDecimal(final String name) throws SQLException 131 { 132 Operation<java.sql.CallableStatement , BigDecimal > operation = new Operation<java.sql.CallableStatement , BigDecimal >() 133 { 134 public BigDecimal execute(Database database, java.sql.CallableStatement statement) throws SQLException 135 { 136 return statement.getBigDecimal(name); 137 } 138 }; 139 140 return this.executeReadFromDriver(operation); 141 } 142 143 146 public Blob getBlob(final int index) throws SQLException 147 { 148 Operation<java.sql.CallableStatement , java.sql.Blob > operation = new Operation<java.sql.CallableStatement , Blob >() 149 { 150 public Blob execute(Database database, java.sql.CallableStatement statement) throws SQLException 151 { 152 return statement.getBlob(index); 153 } 154 }; 155 156 return this.executeReadFromDriver(operation); 157 } 158 159 162 public Blob getBlob(final String name) throws SQLException 163 { 164 Operation<java.sql.CallableStatement , java.sql.Blob > operation = new Operation<java.sql.CallableStatement , Blob >() 165 { 166 public Blob execute(Database database, java.sql.CallableStatement statement) throws SQLException 167 { 168 return statement.getBlob(name); 169 } 170 }; 171 172 return this.executeReadFromDriver(operation); 173 } 174 175 178 public boolean getBoolean(final int index) throws SQLException 179 { 180 Operation<java.sql.CallableStatement , Boolean > operation = new Operation<java.sql.CallableStatement , Boolean >() 181 { 182 public Boolean execute(Database database, java.sql.CallableStatement statement) throws SQLException 183 { 184 return statement.getBoolean(index); 185 } 186 }; 187 188 return this.executeReadFromDriver(operation); 189 } 190 191 194 public boolean getBoolean(final String name) throws SQLException 195 { 196 Operation<java.sql.CallableStatement , Boolean > operation = new Operation<java.sql.CallableStatement , Boolean >() 197 { 198 public Boolean execute(Database database, java.sql.CallableStatement statement) throws SQLException 199 { 200 return statement.getBoolean(name); 201 } 202 }; 203 204 return this.executeReadFromDriver(operation); 205 } 206 207 210 public byte getByte(final int index) throws SQLException 211 { 212 Operation<java.sql.CallableStatement , Byte > operation = new Operation<java.sql.CallableStatement , Byte >() 213 { 214 public Byte execute(Database database, java.sql.CallableStatement statement) throws SQLException 215 { 216 return statement.getByte(index); 217 } 218 }; 219 220 return this.executeReadFromDriver(operation); 221 } 222 223 226 public byte getByte(final String name) throws SQLException 227 { 228 Operation<java.sql.CallableStatement , Byte > operation = new Operation<java.sql.CallableStatement , Byte >() 229 { 230 public Byte execute(Database database, java.sql.CallableStatement statement) throws SQLException 231 { 232 return statement.getByte(name); 233 } 234 }; 235 236 return this.executeReadFromDriver(operation); 237 } 238 239 242 public byte[] getBytes(final int index) throws SQLException 243 { 244 Operation<java.sql.CallableStatement , byte[]> operation = new Operation<java.sql.CallableStatement , byte[]>() 245 { 246 public byte[] execute(Database database, java.sql.CallableStatement statement) throws SQLException 247 { 248 return statement.getBytes(index); 249 } 250 }; 251 252 return this.executeReadFromDriver(operation); 253 } 254 255 258 public byte[] getBytes(final String name) throws SQLException 259 { 260 Operation<java.sql.CallableStatement , byte[]> operation = new Operation<java.sql.CallableStatement , byte[]>() 261 { 262 public byte[] execute(Database database, java.sql.CallableStatement statement) throws SQLException 263 { 264 return statement.getBytes(name); 265 } 266 }; 267 268 return this.executeReadFromDriver(operation); 269 } 270 271 274 public Clob getClob(final int index) throws SQLException 275 { 276 Operation<java.sql.CallableStatement , java.sql.Clob > operation = new Operation<java.sql.CallableStatement , Clob >() 277 { 278 public Clob execute(Database database, java.sql.CallableStatement statement) throws SQLException 279 { 280 return statement.getClob(index); 281 } 282 }; 283 284 return this.executeReadFromDriver(operation); 285 } 286 287 290 public Clob getClob(final String name) throws SQLException 291 { 292 Operation<java.sql.CallableStatement , java.sql.Clob > operation = new Operation<java.sql.CallableStatement , Clob >() 293 { 294 public Clob execute(Database database, java.sql.CallableStatement statement) throws SQLException 295 { 296 return statement.getClob(name); 297 } 298 }; 299 300 return this.executeReadFromDriver(operation); 301 } 302 303 306 public Date getDate(final int index) throws SQLException 307 { 308 Operation<java.sql.CallableStatement , Date > operation = new Operation<java.sql.CallableStatement , Date >() 309 { 310 public Date execute(Database database, java.sql.CallableStatement statement) throws SQLException 311 { 312 return statement.getDate(index); 313 } 314 }; 315 316 return this.executeReadFromDriver(operation); 317 } 318 319 322 public Date getDate(final int index, final Calendar calendar) throws SQLException 323 { 324 Operation<java.sql.CallableStatement , Date > operation = new Operation<java.sql.CallableStatement , Date >() 325 { 326 public Date execute(Database database, java.sql.CallableStatement statement) throws SQLException 327 { 328 return statement.getDate(index, calendar); 329 } 330 }; 331 332 return this.executeReadFromDriver(operation); 333 } 334 335 338 public Date getDate(final String name) throws SQLException 339 { 340 Operation<java.sql.CallableStatement , Date > operation = new Operation<java.sql.CallableStatement , Date >() 341 { 342 public Date execute(Database database, java.sql.CallableStatement statement) throws SQLException 343 { 344 return statement.getDate(name); 345 } 346 }; 347 348 return this.executeReadFromDriver(operation); 349 } 350 351 354 public Date getDate(final String name, final Calendar calendar) throws SQLException 355 { 356 Operation<java.sql.CallableStatement , Date > operation = new Operation<java.sql.CallableStatement , Date >() 357 { 358 public Date execute(Database database, java.sql.CallableStatement statement) throws SQLException 359 { 360 return statement.getDate(name, calendar); 361 } 362 }; 363 364 return this.executeReadFromDriver(operation); 365 } 366 367 370 public double getDouble(final int index) throws SQLException 371 { 372 Operation<java.sql.CallableStatement , Double > operation = new Operation<java.sql.CallableStatement , Double >() 373 { 374 public Double execute(Database database, java.sql.CallableStatement statement) throws SQLException 375 { 376 return statement.getDouble(index); 377 } 378 }; 379 380 return this.executeReadFromDriver(operation); 381 } 382 383 386 public double getDouble(final String name) throws SQLException 387 { 388 Operation<java.sql.CallableStatement , Double > operation = new Operation<java.sql.CallableStatement , Double >() 389 { 390 public Double execute(Database database, java.sql.CallableStatement statement) throws SQLException 391 { 392 return statement.getDouble(name); 393 } 394 }; 395 396 return this.executeReadFromDriver(operation); 397 } 398 399 402 public float getFloat(final int index) throws SQLException 403 { 404 Operation<java.sql.CallableStatement , Float > operation = new Operation<java.sql.CallableStatement , Float >() 405 { 406 public Float execute(Database database, java.sql.CallableStatement statement) throws SQLException 407 { 408 return statement.getFloat(index); 409 } 410 }; 411 412 return this.executeReadFromDriver(operation); 413 } 414 415 418 public float getFloat(final String name) throws SQLException 419 { 420 Operation<java.sql.CallableStatement , Float > operation = new Operation<java.sql.CallableStatement , Float >() 421 { 422 public Float execute(Database database, java.sql.CallableStatement statement) throws SQLException 423 { 424 return statement.getFloat(name); 425 } 426 }; 427 428 return this.executeReadFromDriver(operation); 429 } 430 431 434 public int getInt(final int index) throws SQLException 435 { 436 Operation<java.sql.CallableStatement , Integer > operation = new Operation<java.sql.CallableStatement , Integer >() 437 { 438 public Integer execute(Database database, java.sql.CallableStatement statement) throws SQLException 439 { 440 return statement.getInt(index); 441 } 442 }; 443 444 return this.executeReadFromDriver(operation); 445 } 446 447 450 public int getInt(final String name) throws SQLException 451 { 452 Operation<java.sql.CallableStatement , Integer > operation = new Operation<java.sql.CallableStatement , Integer >() 453 { 454 public Integer execute(Database database, java.sql.CallableStatement statement) throws SQLException 455 { 456 return statement.getInt(name); 457 } 458 }; 459 460 return this.executeReadFromDriver(operation); 461 } 462 463 466 public long getLong(final int index) throws SQLException 467 { 468 Operation<java.sql.CallableStatement , Long > operation = new Operation<java.sql.CallableStatement , Long >() 469 { 470 public Long execute(Database database, java.sql.CallableStatement statement) throws SQLException 471 { 472 return statement.getLong(index); 473 } 474 }; 475 476 return this.executeReadFromDriver(operation); 477 } 478 479 482 public long getLong(final String name) throws SQLException 483 { 484 Operation<java.sql.CallableStatement , Long > operation = new Operation<java.sql.CallableStatement , Long >() 485 { 486 public Long execute(Database database, java.sql.CallableStatement statement) throws SQLException 487 { 488 return statement.getLong(name); 489 } 490 }; 491 492 return this.executeReadFromDriver(operation); 493 } 494 495 498 public Object getObject(final int index) throws SQLException 499 { 500 Operation<java.sql.CallableStatement , Object > operation = new Operation<java.sql.CallableStatement , Object >() 501 { 502 public Object execute(Database database, java.sql.CallableStatement statement) throws SQLException 503 { 504 return statement.getObject(index); 505 } 506 }; 507 508 return this.executeReadFromDriver(operation); 509 } 510 511 514 public Object getObject(final int index, final Map <String , Class <?>> typeMap) throws SQLException 515 { 516 Operation<java.sql.CallableStatement , Object > operation = new Operation<java.sql.CallableStatement , Object >() 517 { 518 public Object execute(Database database, java.sql.CallableStatement statement) throws SQLException 519 { 520 return statement.getObject(index, typeMap); 521 } 522 }; 523 524 return this.executeReadFromDriver(operation); 525 } 526 527 530 public Object getObject(final String name) throws SQLException 531 { 532 Operation<java.sql.CallableStatement , Object > operation = new Operation<java.sql.CallableStatement , Object >() 533 { 534 public Object execute(Database database, java.sql.CallableStatement statement) throws SQLException 535 { 536 return statement.getObject(name); 537 } 538 }; 539 540 return this.executeReadFromDriver(operation); 541 } 542 543 546 public Object getObject(final String name, final Map <String , Class <?>> typeMap) throws SQLException 547 { 548 Operation<java.sql.CallableStatement , Object > operation = new Operation<java.sql.CallableStatement , Object >() 549 { 550 public Object execute(Database database, java.sql.CallableStatement statement) throws SQLException 551 { 552 return statement.getObject(name, typeMap); 553 } 554 }; 555 556 return this.executeReadFromDriver(operation); 557 } 558 559 562 public Ref getRef(final int index) throws SQLException 563 { 564 Operation<java.sql.CallableStatement , Ref > operation = new Operation<java.sql.CallableStatement , Ref >() 565 { 566 public Ref execute(Database database, java.sql.CallableStatement statement) throws SQLException 567 { 568 return statement.getRef(index); 569 } 570 }; 571 572 return this.executeReadFromDriver(operation); 573 } 574 575 578 public Ref getRef(final String name) throws SQLException 579 { 580 Operation<java.sql.CallableStatement , Ref > operation = new Operation<java.sql.CallableStatement , Ref >() 581 { 582 public Ref execute(Database database, java.sql.CallableStatement statement) throws SQLException 583 { 584 return statement.getRef(name); 585 } 586 }; 587 588 return this.executeReadFromDriver(operation); 589 } 590 591 594 public short getShort(final int index) throws SQLException 595 { 596 Operation<java.sql.CallableStatement , Short > operation = new Operation<java.sql.CallableStatement , Short >() 597 { 598 public Short execute(Database database, java.sql.CallableStatement statement) throws SQLException 599 { 600 return statement.getShort(index); 601 } 602 }; 603 604 return this.executeReadFromDriver(operation); 605 } 606 607 610 public short getShort(final String name) throws SQLException 611 { 612 Operation<java.sql.CallableStatement , Short > operation = new Operation<java.sql.CallableStatement , Short >() 613 { 614 public Short execute(Database database, java.sql.CallableStatement statement) throws SQLException 615 { 616 return statement.getShort(name); 617 } 618 }; 619 620 return this.executeReadFromDriver(operation); 621 } 622 623 626 public String getString(final int index) throws SQLException 627 { 628 Operation<java.sql.CallableStatement , String > operation = new Operation<java.sql.CallableStatement , String >() 629 { 630 public String execute(Database database, java.sql.CallableStatement statement) throws SQLException 631 { 632 return statement.getString(index); 633 } 634 }; 635 636 return this.executeReadFromDriver(operation); 637 } 638 639 642 public String getString(final String name) throws SQLException 643 { 644 Operation<java.sql.CallableStatement , String > operation = new Operation<java.sql.CallableStatement , String >() 645 { 646 public String execute(Database database, java.sql.CallableStatement statement) throws SQLException 647 { 648 return statement.getString(name); 649 } 650 }; 651 652 return this.executeReadFromDriver(operation); 653 } 654 655 658 public Time getTime(final int index) throws SQLException 659 { 660 Operation<java.sql.CallableStatement , Time > operation = new Operation<java.sql.CallableStatement , Time >() 661 { 662 public Time execute(Database database, java.sql.CallableStatement statement) throws SQLException 663 { 664 return statement.getTime(index); 665 } 666 }; 667 668 return this.executeReadFromDriver(operation); 669 } 670 671 674 public Time getTime(final int index, final Calendar calendar) throws SQLException 675 { 676 Operation<java.sql.CallableStatement , Time > operation = new Operation<java.sql.CallableStatement , Time >() 677 { 678 public Time execute(Database database, java.sql.CallableStatement statement) throws SQLException 679 { 680 return statement.getTime(index, calendar); 681 } 682 }; 683 684 return this.executeReadFromDriver(operation); 685 } 686 687 690 public Time getTime(final String name) throws SQLException 691 { 692 Operation<java.sql.CallableStatement , Time > operation = new Operation<java.sql.CallableStatement , Time >() 693 { 694 public Time execute(Database database, java.sql.CallableStatement statement) throws SQLException 695 { 696 return statement.getTime(name); 697 } 698 }; 699 700 return this.executeReadFromDriver(operation); 701 } 702 703 706 public Time getTime(final String name, final Calendar calendar) throws SQLException 707 { 708 Operation<java.sql.CallableStatement , Time > operation = new Operation<java.sql.CallableStatement , Time >() 709 { 710 public Time execute(Database database, java.sql.CallableStatement statement) throws SQLException 711 { 712 return statement.getTime(name, calendar); 713 } 714 }; 715 716 return this.executeReadFromDriver(operation); 717 } 718 719 722 public Timestamp getTimestamp(final int index) throws SQLException 723 { 724 Operation<java.sql.CallableStatement , Timestamp > operation = new Operation<java.sql.CallableStatement , Timestamp >() 725 { 726 public Timestamp execute(Database database, java.sql.CallableStatement statement) throws SQLException 727 { 728 return statement.getTimestamp(index); 729 } 730 }; 731 732 return this.executeReadFromDriver(operation); 733 } 734 735 738 public Timestamp getTimestamp(final int index, final Calendar calendar) throws SQLException 739 { 740 Operation<java.sql.CallableStatement , Timestamp > operation = new Operation<java.sql.CallableStatement , Timestamp >() 741 { 742 public Timestamp execute(Database database, java.sql.CallableStatement statement) throws SQLException 743 { 744 return statement.getTimestamp(index, calendar); 745 } 746 }; 747 748 return this.executeReadFromDriver(operation); 749 } 750 751 754 public Timestamp getTimestamp(final String name) throws SQLException 755 { 756 Operation<java.sql.CallableStatement , Timestamp > operation = new Operation<java.sql.CallableStatement , Timestamp >() 757 { 758 public Timestamp execute(Database database, java.sql.CallableStatement statement) throws SQLException 759 { 760 return statement.getTimestamp(name); 761 } 762 }; 763 764 return this.executeReadFromDriver(operation); 765 } 766 767 770 public Timestamp getTimestamp(final String name, final Calendar calendar) throws SQLException 771 { 772 Operation<java.sql.CallableStatement , Timestamp > operation = new Operation<java.sql.CallableStatement , Timestamp >() 773 { 774 public Timestamp execute(Database database, java.sql.CallableStatement statement) throws SQLException 775 { 776 return statement.getTimestamp(name, calendar); 777 } 778 }; 779 780 return this.executeReadFromDriver(operation); 781 } 782 783 786 public URL getURL(final int index) throws SQLException 787 { 788 Operation<java.sql.CallableStatement , URL > operation = new Operation<java.sql.CallableStatement , URL >() 789 { 790 public URL execute(Database database, java.sql.CallableStatement statement) throws SQLException 791 { 792 return statement.getURL(index); 793 } 794 }; 795 796 return this.executeReadFromDriver(operation); 797 } 798 799 802 public URL getURL(final String name) throws SQLException 803 { 804 Operation<java.sql.CallableStatement , URL > operation = new Operation<java.sql.CallableStatement , URL >() 805 { 806 public URL execute(Database database, java.sql.CallableStatement statement) throws SQLException 807 { 808 return statement.getURL(name); 809 } 810 }; 811 812 return this.executeReadFromDriver(operation); 813 } 814 815 818 public void registerOutParameter(final int index, final int sqlType) throws SQLException 819 { 820 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 821 { 822 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 823 { 824 statement.registerOutParameter(index, sqlType); 825 826 return null; 827 } 828 }; 829 830 this.executeWriteToDriver(operation); 831 } 832 833 836 public void registerOutParameter(final int index, final int sqlType, final int scale) throws SQLException 837 { 838 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 839 { 840 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 841 { 842 statement.registerOutParameter(index, sqlType, scale); 843 844 return null; 845 } 846 }; 847 848 this.executeWriteToDriver(operation); 849 } 850 851 854 public void registerOutParameter(final int index, final int sqlType, final String typeName) throws SQLException 855 { 856 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 857 { 858 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 859 { 860 statement.registerOutParameter(index, sqlType, typeName); 861 862 return null; 863 } 864 }; 865 866 this.executeWriteToDriver(operation); 867 } 868 869 872 public void registerOutParameter(final String name, final int sqlType) throws SQLException 873 { 874 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 875 { 876 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 877 { 878 statement.registerOutParameter(name, sqlType); 879 880 return null; 881 } 882 }; 883 884 this.executeWriteToDriver(operation); 885 } 886 887 890 public void registerOutParameter(final String name, final int sqlType, final int scale) throws SQLException 891 { 892 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 893 { 894 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 895 { 896 statement.registerOutParameter(name, sqlType, scale); 897 898 return null; 899 } 900 }; 901 902 this.executeWriteToDriver(operation); 903 } 904 905 908 public void registerOutParameter(final String name, final int sqlType, final String typeName) throws SQLException 909 { 910 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 911 { 912 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 913 { 914 statement.registerOutParameter(name, sqlType, typeName); 915 916 return null; 917 } 918 }; 919 920 this.executeWriteToDriver(operation); 921 } 922 923 926 public void setAsciiStream(final String name, InputStream inputStream, final int length) throws SQLException 927 { 928 final FileSupport fileSupport = this.getFileSupport(); 929 final File file = fileSupport.createFile(inputStream); 930 931 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 932 { 933 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 934 { 935 statement.setAsciiStream(name, fileSupport.getInputStream(file), length); 936 937 return null; 938 } 939 }; 940 941 this.executeWriteToDriver(operation); 942 } 943 944 947 public void setBigDecimal(final String name, final BigDecimal value) throws SQLException 948 { 949 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 950 { 951 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 952 { 953 statement.setBigDecimal(name, value); 954 955 return null; 956 } 957 }; 958 959 this.executeWriteToDriver(operation); 960 } 961 962 965 public void setBinaryStream(final String name, InputStream inputStream, final int length) throws SQLException 966 { 967 final FileSupport fileSupport = this.getFileSupport(); 968 final File file = fileSupport.createFile(inputStream); 969 970 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 971 { 972 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 973 { 974 statement.setBinaryStream(name, fileSupport.getInputStream(file), length); 975 976 return null; 977 } 978 }; 979 980 this.executeWriteToDriver(operation); 981 } 982 983 986 public void setBoolean(final String name, final boolean value) throws SQLException 987 { 988 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 989 { 990 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 991 { 992 statement.setBoolean(name, value); 993 994 return null; 995 } 996 }; 997 998 this.executeWriteToDriver(operation); 999 } 1000 1001 1004 public void setByte(final String name, final byte value) throws SQLException 1005 { 1006 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 1007 { 1008 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 1009 { 1010 statement.setByte(name, value); 1011 1012 return null; 1013 } 1014 }; 1015 1016 this.executeWriteToDriver(operation); 1017 } 1018 1019 1022 public void setBytes(final String name, final byte[] value) throws SQLException 1023 { 1024 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 1025 { 1026 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 1027 { 1028 statement.setBytes(name, value); 1029 1030 return null; 1031 } 1032 }; 1033 1034 this.executeWriteToDriver(operation); 1035 } 1036 1037 1040 public void setCharacterStream(final String name, Reader reader, final int length) throws SQLException 1041 { 1042 final FileSupport fileSupport = this.getFileSupport(); 1043 final File file = fileSupport.createFile(reader); 1044 1045 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 1046 { 1047 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 1048 { 1049 statement.setCharacterStream(name, fileSupport.getReader(file), length); 1050 1051 return null; 1052 } 1053 }; 1054 1055 this.executeWriteToDriver(operation); 1056 } 1057 1058 1061 public void setDate(final String name, final Date value) throws SQLException 1062 { 1063 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 1064 { 1065 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 1066 { 1067 statement.setDate(name, value); 1068 1069 return null; 1070 } 1071 }; 1072 1073 this.executeWriteToDriver(operation); 1074 } 1075 1076 1079 public void setDate(final String name, final Date value, final Calendar calendar) throws SQLException 1080 { 1081 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 1082 { 1083 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 1084 { 1085 statement.setDate(name, value, calendar); 1086 1087 return null; 1088 } 1089 }; 1090 1091 this.executeWriteToDriver(operation); 1092 } 1093 1094 1097 public void setDouble(final String name, final double value) throws SQLException 1098 { 1099 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 1100 { 1101 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 1102 { 1103 statement.setDouble(name, value); 1104 1105 return null; 1106 } 1107 }; 1108 1109 this.executeWriteToDriver(operation); 1110 } 1111 1112 1115 public void setFloat(final String name, final float value) throws SQLException 1116 { 1117 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 1118 { 1119 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 1120 { 1121 statement.setFloat(name, value); 1122 1123 return null; 1124 } 1125 }; 1126 1127 this.executeWriteToDriver(operation); 1128 } 1129 1130 1133 public void setInt(final String name, final int value) throws SQLException 1134 { 1135 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 1136 { 1137 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 1138 { 1139 statement.setInt(name, value); 1140 1141 return null; 1142 } 1143 }; 1144 1145 this.executeWriteToDriver(operation); 1146 } 1147 1148 1151 public void setLong(final String name, final long value) throws SQLException 1152 { 1153 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 1154 { 1155 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 1156 { 1157 statement.setLong(name, value); 1158 1159 return null; 1160 } 1161 }; 1162 1163 this.executeWriteToDriver(operation); 1164 } 1165 1166 1169 public void setNull(final String name, final int sqlType) throws SQLException 1170 { 1171 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 1172 { 1173 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 1174 { 1175 statement.setNull(name, sqlType); 1176 1177 return null; 1178 } 1179 }; 1180 1181 this.executeWriteToDriver(operation); 1182 } 1183 1184 1187 public void setNull(final String name, final int sqlType, final String typeName) throws SQLException 1188 { 1189 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 1190 { 1191 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 1192 { 1193 statement.setNull(name, sqlType, typeName); 1194 1195 return null; 1196 } 1197 }; 1198 1199 this.executeWriteToDriver(operation); 1200 } 1201 1202 1205 public void setObject(final String name, final Object value) throws SQLException 1206 { 1207 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 1208 { 1209 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 1210 { 1211 statement.setObject(name, value); 1212 1213 return null; 1214 } 1215 }; 1216 1217 this.executeWriteToDriver(operation); 1218 } 1219 1220 1223 public void setObject(final String name, final Object value, final int sqlType) throws SQLException 1224 { 1225 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 1226 { 1227 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 1228 { 1229 statement.setObject(name, value, sqlType); 1230 1231 return null; 1232 } 1233 }; 1234 1235 this.executeWriteToDriver(operation); 1236 } 1237 1238 1241 public void setObject(final String name, final Object value, final int sqlType, final int scale) throws SQLException 1242 { 1243 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 1244 { 1245 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 1246 { 1247 statement.setObject(name, value, sqlType, scale); 1248 1249 return null; 1250 } 1251 }; 1252 1253 this.executeWriteToDriver(operation); 1254 } 1255 1256 1259 public void setShort(final String name, final short value) throws SQLException 1260 { 1261 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 1262 { 1263 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 1264 { 1265 statement.setShort(name, value); 1266 1267 return null; 1268 } 1269 }; 1270 1271 this.executeWriteToDriver(operation); 1272 } 1273 1274 1277 public void setString(final String name, final String value) throws SQLException 1278 { 1279 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 1280 { 1281 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 1282 { 1283 statement.setString(name, value); 1284 1285 return null; 1286 } 1287 }; 1288 1289 this.executeWriteToDriver(operation); 1290 } 1291 1292 1295 public void setTime(final String name, final Time value) throws SQLException 1296 { 1297 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 1298 { 1299 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 1300 { 1301 statement.setTime(name, value); 1302 1303 return null; 1304 } 1305 }; 1306 1307 this.executeWriteToDriver(operation); 1308 } 1309 1310 1313 public void setTime(final String name, final Time value, final Calendar calendar) throws SQLException 1314 { 1315 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 1316 { 1317 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 1318 { 1319 statement.setTime(name, value, calendar); 1320 1321 return null; 1322 } 1323 }; 1324 1325 this.executeWriteToDriver(operation); 1326 } 1327 1328 1331 public void setTimestamp(final String name, final Timestamp value) throws SQLException 1332 { 1333 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 1334 { 1335 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 1336 { 1337 statement.setTimestamp(name, value); 1338 1339 return null; 1340 } 1341 }; 1342 1343 this.executeWriteToDriver(operation); 1344 } 1345 1346 1349 public void setTimestamp(final String name, final Timestamp value, final Calendar calendar) throws SQLException 1350 { 1351 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 1352 { 1353 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 1354 { 1355 statement.setTimestamp(name, value, calendar); 1356 1357 return null; 1358 } 1359 }; 1360 1361 this.executeWriteToDriver(operation); 1362 } 1363 1364 1367 public void setURL(final String name, final URL value) throws SQLException 1368 { 1369 Operation<java.sql.CallableStatement , Void > operation = new Operation<java.sql.CallableStatement , Void >() 1370 { 1371 public Void execute(Database database, java.sql.CallableStatement statement) throws SQLException 1372 { 1373 statement.setURL(name, value); 1374 1375 return null; 1376 } 1377 }; 1378 1379 this.executeWriteToDriver(operation); 1380 } 1381 1382 1385 public boolean wasNull() throws SQLException 1386 { 1387 Operation<java.sql.CallableStatement , Boolean > operation = new Operation<java.sql.CallableStatement , Boolean >() 1388 { 1389 public Boolean execute(Database database, java.sql.CallableStatement statement) throws SQLException 1390 { 1391 return statement.wasNull(); 1392 } 1393 }; 1394 1395 return this.executeReadFromDriver(operation); 1396 } 1397} 1398 | Popular Tags |