View Javadoc
1 /* 2 QueryJ 3 4 Copyright (C) 2002 Jose San Leandro Armend?riz 5 jsanleandro@yahoo.es 6 chousz@yahoo.com 7 8 This library is free software; you can redistribute it and/or 9 modify it under the terms of the GNU General Public 10 License as published by the Free Software Foundation; either 11 version 2.1 of the License, or (at your option) any later version. 12 13 This library is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 General Public License for more details. 17 18 You should have received a copy of the GNU General Public 19 License along with this library; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 22 Thanks to ACM S.L. for distributing this library under the GPL license. 23 Contact info: jsanleandro@yahoo.es 24 Postal Address: c/Playa de Lagoa, 1 25 Urb. Valdecaba?as 26 Boadilla del monte 27 28660 Madrid 28 Spain 29 30 ****************************************************************************** 31 * 32 * Filename: $RCSfile: Query.java,v $ 33 * 34 * Author: Jose San Leandro Armend?riz 35 * 36 * Description: Represents queries to access persistent data. 37 * 38 * Last modified by: $Author: chous $ at $Date: 2003/08/29 08:14:59 $ 39 * 40 * File version: $Revision: 1.1 $ 41 * 42 * Project version: $Name: $ 43 * 44 * $Id: Query.java,v 1.1 2003/08/29 08:14:59 chous Exp $ 45 * 46 */ 47 package org.acmsl.queryj; 48 49 /* 50 * Importing some JDK1.3 classes. 51 */ 52 import java.io.InputStream; 53 import java.io.Reader; 54 import java.math.BigDecimal; 55 import java.net.URL; 56 import java.sql.Array; 57 import java.sql.Blob; 58 import java.sql.Clob; 59 import java.sql.Connection; 60 import java.sql.Date; 61 import java.sql.ParameterMetaData; 62 import java.sql.PreparedStatement; 63 import java.sql.Ref; 64 import java.sql.ResultSet; 65 import java.sql.ResultSetMetaData; 66 import java.sql.SQLException; 67 import java.sql.SQLWarning; 68 import java.sql.Statement; 69 import java.sql.Time; 70 import java.sql.Timestamp; 71 import java.util.ArrayList; 72 import java.util.Calendar; 73 import java.util.List; 74 75 /*** 76 * Represents queries to access persistent data. 77 * @author <a href="mailto:jsanleandro@yahoo.es" 78 >Jose San Leandro</a> 79 * @version $Revision: 1.1 $ 80 */ 81 public abstract class Query 82 implements PreparedStatement 83 { 84 /*** 85 * The wrapped statement. 86 */ 87 private PreparedStatement m__PreparedStatement; 88 89 /*** 90 * The tables. 91 */ 92 private List m__lTables; 93 94 /*** 95 * The conditions. 96 */ 97 private List m__lConditions; 98 99 /*** 100 * The variable conditions. 101 */ 102 private List m__lVariableConditions; 103 104 /*** 105 * Constructs a query. 106 */ 107 public Query() 108 { 109 unmodifiableSetTables(new ArrayList()); 110 unmodifiableSetConditions(new ArrayList()); 111 unmodifiableSetVariableConditions(new ArrayList()); 112 } 113 114 /*** 115 * Specifies the statement. 116 * @param statement the prepared statement. 117 */ 118 protected void setPreparedStatement(PreparedStatement statement) 119 { 120 m__PreparedStatement = statement; 121 } 122 123 /*** 124 * Retrieves the statement. 125 * @return such statement. 126 */ 127 protected PreparedStatement getPreparedStatement() 128 { 129 return m__PreparedStatement; 130 } 131 132 /*** 133 * Specifies new table collection. 134 * @param list the new list. 135 */ 136 private void unmodifiableSetTables(List list) 137 { 138 m__lTables = list; 139 } 140 141 /*** 142 * Specifies new table collection. 143 * @param list the new list. 144 */ 145 protected void setTables(List list) 146 { 147 unmodifiableSetTables(list); 148 } 149 150 /*** 151 * Retrieves the table collection. 152 * @return such list. 153 */ 154 protected List getTables() 155 { 156 return m__lTables; 157 } 158 159 /*** 160 * Adds a new table. 161 * @param table the table to add. 162 */ 163 protected void addTable(Table table) 164 { 165 if (table != null) 166 { 167 List t_Tables = getTables(); 168 169 if (t_Tables != null) 170 { 171 t_Tables.add(table); 172 } 173 } 174 } 175 176 /*** 177 * Specifies new condition collection. 178 * @param list the new list. 179 */ 180 private void unmodifiableSetConditions(List list) 181 { 182 m__lConditions = list; 183 } 184 185 /*** 186 * Specifies new condition collection. 187 * @param list the new list. 188 */ 189 protected void setConditions(List list) 190 { 191 unmodifiableSetConditions(list); 192 } 193 194 /*** 195 * Retrieves the condition collection. 196 * @return such list. 197 */ 198 protected List getConditions() 199 { 200 return m__lConditions; 201 } 202 203 /*** 204 * Adds a new condition. 205 * @param condition the condition to add. 206 */ 207 protected void addCondition(Condition condition) 208 { 209 if (condition != null) 210 { 211 List t_Conditions = getConditions(); 212 213 if (t_Conditions != null) 214 { 215 t_Conditions.add(condition); 216 } 217 } 218 } 219 220 /*** 221 * Specifies new variable condition collection. 222 * @param list the new list. 223 */ 224 private void unmodifiableSetVariableConditions(List list) 225 { 226 m__lVariableConditions = list; 227 } 228 229 /*** 230 * Specifies new variable condition collection. 231 * @param list the new list. 232 */ 233 protected void setVariableConditions(List list) 234 { 235 unmodifiableSetVariableConditions(list); 236 } 237 238 /*** 239 * Retrieves the variable condition collection. 240 * @return such list. 241 */ 242 protected List getVariableConditions() 243 { 244 return m__lVariableConditions; 245 } 246 247 /*** 248 * Adds a new variable condition. 249 * @param variableCondition the variable condition to add. 250 */ 251 protected void addVariableCondition( 252 VariableCondition variableCondition) 253 { 254 if (variableCondition != null) 255 { 256 List t_VariableConditions = getVariableConditions(); 257 258 if (t_VariableConditions != null) 259 { 260 t_VariableConditions.add(variableCondition); 261 } 262 } 263 } 264 265 /*** 266 * Retrieves the position of given item on the query. 267 * @param list the concrete list (fields, tables, conditions, etc.). 268 * @param object the object to find. 269 * @return its position, or -1 if such item doesn't belong to 270 * this query. 271 */ 272 protected int getIndex(List list, Object object) 273 { 274 int result = -1; 275 276 if ( (list != null) 277 && (object != null)) 278 { 279 result = list.indexOf(object); 280 } 281 282 return result; 283 } 284 285 // Helper methods // 286 287 /*** 288 * Prepares a statement. 289 * @param connection the JDBC connection. 290 * @return the statement. 291 * @exception SQLException if an error occurs. 292 */ 293 public PreparedStatement prepareStatement(Connection connection) 294 throws SQLException 295 { 296 PreparedStatement result = this; 297 298 setPreparedStatement(connection.prepareStatement(toString())); 299 300 return result; 301 } 302 303 /*** 304 * Looks for the records that match the filter. 305 * @param sql (Taken from Sun's Javadoc) an SQL statement to be sent 306 * to the database, typically a static SQL SELECT statement. 307 * @return (Taken from Sun's Javadoc) a ResultSet object that 308 * contains the data produced by the given query; never null. 309 * @exception SQLException if an error occurs. 310 */ 311 public abstract QueryResultSet retrieveMatchingResults() 312 throws SQLException; 313 314 // Implementation of java.sql.Statement // 315 316 /*** 317 * See java.sql.Statement#close(). 318 * @see java.sql.Statement#close() 319 * @exception SQLException if an error occurs. 320 */ 321 public void close() 322 throws SQLException 323 { 324 Statement t_Statement = getPreparedStatement(); 325 326 if (t_Statement != null) 327 { 328 t_Statement.close(); 329 } 330 } 331 332 /*** 333 * See java.sql.Statement#execute(String). 334 * @see java.sql.Statement#close(String) 335 * @param sql (Taken from Sun's Javadoc) any SQL statement. 336 * @return (Taken from Sun's Javadoc) <code>true</code> if the first 337 * result is a ResultSet object; false if it is an update count 338 * or there are no results. 339 * @exception SQLException if an error occurs. 340 */ 341 public boolean execute(String sql) 342 throws SQLException 343 { 344 boolean result = false; 345 346 Statement t_Statement = getPreparedStatement(); 347 348 if (t_Statement != null) 349 { 350 result = t_Statement.execute(sql); 351 } 352 353 return result; 354 } 355 356 /*** 357 * See java.sql.Statement#getConnection(). 358 * @see java.sql.Statement#getConnection() 359 * @return (Taken from Sun's Javadoc) the connection that produced 360 * this statement. 361 * @exception SQLException if an error occurs 362 */ 363 public Connection getConnection() 364 throws SQLException 365 { 366 Connection result = null; 367 368 Statement t_Statement = getPreparedStatement(); 369 370 if (t_Statement != null) 371 { 372 result = t_Statement.getConnection(); 373 } 374 375 return result; 376 } 377 378 /*** 379 * See java.sql.Statement#getWarnings(). 380 * @see java.sql.Statement#getWarnings() 381 * @return (Taken from Sun's Javadoc) the first SQLWarning object 382 * or null if there are no warnings . 383 * @exception SQLException if an error occurs. 384 */ 385 public SQLWarning getWarnings() 386 throws SQLException 387 { 388 SQLWarning result = null; 389 390 Statement t_Statement = getPreparedStatement(); 391 392 if (t_Statement != null) 393 { 394 result = t_Statement.getWarnings(); 395 } 396 397 return result; 398 } 399 400 /*** 401 * See java.sql.Statement#clearWarnings(). 402 * @see java.sql.Statement#clearWarnings() 403 * @exception SQLException if an error occurs 404 */ 405 public void clearWarnings() 406 throws SQLException 407 { 408 Statement t_Statement = getPreparedStatement(); 409 410 if (t_Statement != null) 411 { 412 t_Statement.clearWarnings(); 413 } 414 } 415 416 /*** 417 * See java.sql.Statement#executeQuery(). 418 * @see java.sql.Statement#executeQuery() 419 * @param sql (Taken from Sun's Javadoc) an SQL statement to be sent 420 * to the database, typically a static SQL SELECT statement. 421 * @return (Taken from Sun's Javadoc) a ResultSet object that 422 * contains the data produced by the given query; never null. 423 * @exception SQLException if an error occurs. 424 */ 425 public ResultSet executeQuery(String sql) 426 throws SQLException 427 { 428 ResultSet result = null; 429 430 Statement t_Statement = getPreparedStatement(); 431 432 if (t_Statement != null) 433 { 434 result = t_Statement.executeQuery(sql); 435 } 436 437 return result; 438 } 439 440 /*** 441 * See java.sql.Statement#executeUpdate(). 442 * @see java.sql.Statement#executeUpdate() 443 * @param sql (Taken from Sun's Javadoc) an SQL INSERT, UPDATE or 444 * DELETE statement or an SQL statement that returns nothing. 445 * @return (Taken from Sun's Javadoc) a ResultSet object that 446 * contains the data produced by the given query; never null. 447 * @exception SQLException if an error occurs. 448 */ 449 public int executeUpdate(String sql) 450 throws SQLException 451 { 452 int result = 0; 453 454 Statement t_Statement = getPreparedStatement(); 455 456 if (t_Statement != null) 457 { 458 result = t_Statement.executeUpdate(sql); 459 } 460 461 return result; 462 } 463 464 /*** 465 * See java.sql.Statement#getMaxFieldSize(). 466 * @see java.sql.Statement#getMaxFieldSize() 467 * @return (Taken from Sun's Javadoc) the current 468 * column size limit for columns storing character 469 * and binary values; zero means there is no limit. 470 * @exception SQLException if an error occurs. 471 */ 472 public int getMaxFieldSize() 473 throws SQLException 474 { 475 int result = 0; 476 477 Statement t_Statement = getPreparedStatement(); 478 479 if (t_Statement != null) 480 { 481 result = t_Statement.getMaxFieldSize(); 482 } 483 484 return result; 485 } 486 487 /*** 488 * See java.sql.Statement#setMaxFieldSize(int). 489 * @see java.sql.Statement#setMaxFieldSize(int) 490 * @param size (Taken from Sun's Javadoc) the new column size 491 * limit in bytes; zero means there is no limit. 492 * @exception SQLException if an error occurs 493 */ 494 public void setMaxFieldSize(int size) 495 throws SQLException 496 { 497 Statement t_Statement = getPreparedStatement(); 498 499 if (t_Statement != null) 500 { 501 t_Statement.setMaxFieldSize(size); 502 } 503 } 504 505 /*** 506 * See java.sql.Statement#getMaxRows(). 507 * @see java.sql.Statement#getMaxRows() 508 * @return (Taken from Sun's Javadoc) the current maximum 509 * number of rows for a ResultSet object produced by this 510 * Statement object; zero means there is no limit. 511 * @exception SQLException if an error occurs 512 */ 513 public int getMaxRows() 514 throws SQLException 515 { 516 int result = 0; 517 518 Statement t_Statement = getPreparedStatement(); 519 520 if (t_Statement != null) 521 { 522 result = t_Statement.getMaxRows(); 523 } 524 525 return result; 526 } 527 528 /*** 529 * See java.sql.Statement#setMaxRows(int). 530 * @see java.sql.Statement#setMaxRows(int) 531 * @param max (Taken from Sun's Javadoc) the new max rows 532 * limit; zero means there is no limit. 533 * @exception SQLException if an error occurs 534 */ 535 public void setMaxRows(int max) 536 throws SQLException 537 { 538 Statement t_Statement = getPreparedStatement(); 539 540 if (t_Statement != null) 541 { 542 t_Statement.setMaxRows(max); 543 } 544 } 545 546 /*** 547 * See java.sql.Statement#setEscapeProcessing(boolean). 548 * @see java.sql.Statement#setEscapeProcessing(boolean) 549 * @param enable (Taken from Sun's Javadoc) <code>true</code> 550 * to enable escape processing; <code>false</code> to 551 * disable it. 552 * @exception SQLException if an error occurs 553 */ 554 public void setEscapeProcessing(boolean flag) 555 throws SQLException 556 { 557 Statement t_Statement = getPreparedStatement(); 558 559 if (t_Statement != null) 560 { 561 t_Statement.setEscapeProcessing(flag); 562 } 563 } 564 565 /*** 566 * See java.sql.Statement#getQueryTimeout(). 567 * @see java.sql.Statement#getQueryTimeout() 568 * @return (Taken from Sun's Javadoc) the current query 569 * timeout limit in seconds; zero means there is no limit. 570 * @exception SQLException if an error occurs. 571 */ 572 public int getQueryTimeout() 573 throws SQLException 574 { 575 int result = 0; 576 577 Statement t_Statement = getPreparedStatement(); 578 579 if (t_Statement != null) 580 { 581 result = t_Statement.getQueryTimeout(); 582 } 583 584 return result; 585 } 586 587 /*** 588 * See java.sql.Statement#setQueryTimeout(int). 589 * @see java.sql.Statement#setQueryTimeout(int) 590 * @param timeout (Taken from Sun's Javadoc) the new query 591 * timeout limit in seconds; zero means there is no limit. 592 * @exception SQLException if an error occurs 593 */ 594 public void setQueryTimeout(int timeout) 595 throws SQLException 596 { 597 Statement t_Statement = getPreparedStatement(); 598 599 if (t_Statement != null) 600 { 601 t_Statement.setQueryTimeout(timeout); 602 } 603 } 604 605 /*** 606 * See java.sql.Statement#cancel(). 607 * @see java.sql.Statement#cancel() 608 * @exception SQLException if an error occurs. 609 */ 610 public void cancel() 611 throws SQLException 612 { 613 Statement t_Statement = getPreparedStatement(); 614 615 if (t_Statement != null) 616 { 617 t_Statement.cancel(); 618 } 619 } 620 621 /*** 622 * See java.sql.Statement#setCursorName(String). 623 * @see java.sql.Statement#setCursorName(String) 624 * @param name (Taken from Sun's Javadoc) the new 625 * cursor name, which must be unique within a connection. 626 * @exception SQLException if an error occurs. 627 */ 628 public void setCursorName(String name) 629 throws SQLException 630 { 631 Statement t_Statement = getPreparedStatement(); 632 633 if (t_Statement != null) 634 { 635 t_Statement.setCursorName(name); 636 } 637 } 638 639 /*** 640 * See java.sql.Statement#getResultSet(). 641 * @see java.sql.Statement#getResultSet() 642 * @return (Taken from Sun's Javadoc) the current result 643 * as a ResultSet object or null if the result is an 644 * update count or there are no more results. 645 * @exception SQLException if an error occurs. 646 */ 647 public ResultSet getResultSet() 648 throws SQLException 649 { 650 ResultSet result = null; 651 652 Statement t_Statement = getPreparedStatement(); 653 654 if (t_Statement != null) 655 { 656 result = t_Statement.getResultSet(); 657 } 658 659 return result; 660 } 661 662 /*** 663 * See java.sql.Statement#getUpdateCount(). 664 * @see java.sql.Statement#getUpdateCount() 665 * @return (Taken from Sun's Javadoc) the current 666 * result as an update count; -1 if the current result 667 * is a ResultSet object or there are no more results. 668 * @exception SQLException if an error occurs. 669 */ 670 public int getUpdateCount() 671 throws SQLException 672 { 673 int result = 0; 674 675 Statement t_Statement = getPreparedStatement(); 676 677 if (t_Statement != null) 678 { 679 result = t_Statement.getUpdateCount(); 680 } 681 682 return result; 683 } 684 685 /*** 686 * See java.sql.Statement#getMoreResults(). 687 * @see java.sql.Statement#getMoreResults() 688 * @return (Taken from Sun's Javadoc) <code>true</code> 689 * if the next result is a ResultSet object; 690 * <code>false</code> if it is an update count 691 * or there are no more results. 692 * @exception SQLException if an error occurs. 693 */ 694 public boolean getMoreResults() 695 throws SQLException 696 { 697 boolean result = false; 698 699 Statement t_Statement = getPreparedStatement(); 700 701 if (t_Statement != null) 702 { 703 result = t_Statement.getMoreResults(); 704 } 705 706 return result; 707 } 708 709 /*** 710 * See java.sql.Statement#setFetchDirection(int). 711 * @see java.sql.Statement#setFetchDirection(int) 712 * @param direction (Taken from Sun's Javadoc) the initial 713 * direction for processing rows. 714 * @exception SQLException if an error occurs. 715 */ 716 public void setFetchDirection(int direction) 717 throws SQLException 718 { 719 Statement t_Statement = getPreparedStatement(); 720 721 if (t_Statement != null) 722 { 723 t_Statement.setFetchDirection(direction); 724 } 725 } 726 727 /*** 728 * See java.sql.Statement#getFetchDirection(). 729 * @see java.sql.Statement#getFetchDirection() 730 * @return (Taken from Sun's Javadoc) the default 731 * fetch direction for result sets generated 732 * from this Statement object. 733 * @exception SQLException if an error occurs. 734 */ 735 public int getFetchDirection() 736 throws SQLException 737 { 738 int result = 0; 739 740 Statement t_Statement = getPreparedStatement(); 741 742 if (t_Statement != null) 743 { 744 result = t_Statement.getFetchDirection(); 745 } 746 747 return result; 748 } 749 750 /*** 751 * See java.sql.Statement#setFetchSize(int). 752 * @see java.sql.Statement#setFetchSize(int) 753 * @param size (Taken from Sun's Javadoc) the number of rows to fetch. 754 * @exception SQLException if an error occurs. 755 */ 756 public void setFetchSize(int size) 757 throws SQLException 758 { 759 Statement t_Statement = getPreparedStatement(); 760 761 if (t_Statement != null) 762 { 763 t_Statement.setFetchSize(size); 764 } 765 } 766 767 /*** 768 * See java.sql.Statement#getFetchSize(). 769 * @see java.sql.Statement#getFetchSize() 770 * @return (Taken from Sun's Javadoc) the default fetch 771 * size for result sets generated from this Statement object. 772 * @exception SQLException if an error occurs. 773 */ 774 public int getFetchSize() 775 throws SQLException 776 { 777 int result = 0; 778 779 Statement t_Statement = getPreparedStatement(); 780 781 if (t_Statement != null) 782 { 783 result = t_Statement.getFetchSize(); 784 } 785 786 return result; 787 } 788 789 /*** 790 * See java.sql.Statement#getResultSetConcurrency(). 791 * @see java.sql.Statement#getResultSetConcurrency() 792 * @return (Taken from Sun's Javadoc) either 793 * ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE. 794 * @exception SQLException if an error occurs. 795 */ 796 public int getResultSetConcurrency() 797 throws SQLException 798 { 799 int result = 0; 800 801 Statement t_Statement = getPreparedStatement(); 802 803 if (t_Statement != null) 804 { 805 result = t_Statement.getResultSetConcurrency(); 806 } 807 808 return result; 809 } 810 811 /*** 812 * See java.sql.Statement#getResultSetType(). 813 * @see java.sql.Statement#getResultSetType() 814 * @return (Taken from Sun's Javadoc) one of 815 * ResultSet.TYPE_FORWARD_ONLY, 816 * ResultSet.TYPE_SCROLL_INSENSITIVE, or 817 * ResultSet.TYPE_SCROLL_SENSITIVE. 818 * @exception SQLException if an error occurs. 819 */ 820 public int getResultSetType() 821 throws SQLException 822 { 823 int result = 0; 824 825 Statement t_Statement = getPreparedStatement(); 826 827 if (t_Statement != null) 828 { 829 result = t_Statement.getResultSetType(); 830 } 831 832 return result; 833 } 834 835 /*** 836 * See java.sql.Statement#addBatch(String). 837 * @see java.sql.Statement#addBatch(String) 838 * @param sql (Taken from Sun's Javadoc) typically this 839 * is a static SQL INSERT or UPDATE statement. 840 * @exception SQLException if an error occurs. 841 */ 842 public void addBatch(String sql) 843 throws SQLException 844 { 845 Statement t_Statement = getPreparedStatement(); 846 847 if (t_Statement != null) 848 { 849 t_Statement.addBatch(sql); 850 } 851 } 852 853 /*** 854 * See java.sql.Statement#clearBatch(). 855 * @see java.sql.Statement#clearBatch() 856 * @exception SQLException if an error occurs 857 */ 858 public void clearBatch() 859 throws SQLException 860 { 861 Statement t_Statement = getPreparedStatement(); 862 863 if (t_Statement != null) 864 { 865 t_Statement.clearBatch(); 866 } 867 } 868 869 /*** 870 * See java.sql.Statement#executeBatch(). 871 * @see java.sql.Statement#executeBatch() 872 * @return (Taken from Sun's Javadoc) an array of update 873 * counts containing one element for each command in the 874 * batch. The elements of the array are ordered according 875 * to the order in which commands were added to the batch. 876 * @exception SQLException if an error occurs. 877 */ 878 public int[] executeBatch() 879 throws SQLException 880 { 881 int[] result = new int[0]; 882 883 Statement t_Statement = getPreparedStatement(); 884 885 if (t_Statement != null) 886 { 887 result = t_Statement.executeBatch(); 888 } 889 890 return result; 891 } 892 893 // Implementation of java.sql.PreparedStatement // 894 895 /*** 896 * See java.sql.PreparedStatement#setTime(int,java.sql.Time). 897 * @see java.sql.PreparedStatement#setTime(int,java.sql.Time) 898 * @param index (Taken from Sun's Javadoc) the first parameter 899 * is 1, the second is 2, ... 900 * @param time (Taken from Sun's Javadoc) the parameter value (!!). 901 * @exception SQLException if an error occurs. 902 */ 903 public void setTime(int index, Time time) 904 throws SQLException 905 { 906 PreparedStatement t_PreparedStatement = 907 getPreparedStatement(); 908 909 if (t_PreparedStatement != null) 910 { 911 t_PreparedStatement.setTime(index, time); 912 } 913 } 914 915 /*** 916 * See java.sql.PreparedStatement#setTime(int,Time,Calendar). 917 * @see java.sql.PreparedStatement#setTime(int,java.sql.Time,java.util.Calendar) 918 * @param index (Taken from Sun's Javadoc) the first parameter 919 * is 1, the second is 2, ... 920 * @param time (Taken from Sun's Javadoc) the parameter value (!!). 921 * @param calendar (Taken from Sun's Javadoc) the Calendar object 922 * the driver will use to construct the time. 923 * @exception SQLException if an error occurs. 924 */ 925 public void setTime(int index, Time time, Calendar calendar) 926 throws SQLException 927 { 928 PreparedStatement t_PreparedStatement = 929 getPreparedStatement(); 930 931 if (t_PreparedStatement != null) 932 { 933 t_PreparedStatement.setTime(index, time, calendar); 934 } 935 } 936 937 /*** 938 * See java.sql.PreparedStatement#execute(). 939 * @see java.sql.PreparedStatement#execute() 940 * @return (Taken from Sun's Javadoc) <code>true</code> if 941 * the first result is a ResultSet object; <code>false</code> 942 * if the first result is an update count or there is no result. 943 * @exception SQLException if an error occurs. 944 */ 945 public boolean execute() 946 throws SQLException 947 { 948 boolean result = false; 949 950 PreparedStatement t_PreparedStatement = 951 getPreparedStatement(); 952 953 if (t_PreparedStatement != null) 954 { 955 result = t_PreparedStatement.execute(); 956 } 957 958 return result; 959 } 960 961 /*** 962 * See java.sql.PreparedStatement#setBoolean(int,boolean). 963 * @see java.sql.PreparedStatement#setBoolean(int,boolean) 964 * @param index (Taken from Sun's Javadoc) the first parameter 965 * is 1, the second is 2, ... 966 * @param flag (Taken from Sun's Javadoc) the parameter value (!!). 967 * @exception SQLException if an error occurs. 968 */ 969 public void setBoolean(int index, boolean flag) 970 throws SQLException 971 { 972 PreparedStatement t_PreparedStatement = 973 getPreparedStatement(); 974 975 if (t_PreparedStatement != null) 976 { 977 t_PreparedStatement.setBoolean(index, flag); 978 } 979 } 980 981 /*** 982 * See java.sql.PreparedStatement#setByte(int,byte). 983 * @see java.sql.PreparedStatement#setByte(int,byte) 984 * @param index (Taken from Sun's Javadoc) the first parameter 985 * is 1, the second is 2, ... 986 * @param b (Taken from Sun's Javadoc) the parameter value (!!). 987 * @exception SQLException if an error occurs. 988 */ 989 public void setByte(int index, byte b) 990 throws SQLException 991 { 992 PreparedStatement t_PreparedStatement = 993 getPreparedStatement(); 994 995 if (t_PreparedStatement != null) 996 { 997 t_PreparedStatement.setByte(index, b); 998 } 999 } 1000 1001 /*** 1002 * See java.sql.PreparedStatement#setShort(int,short). 1003 * @see java.sql.PreparedStatement#setShort(int,short) 1004 * @param index (Taken from Sun's Javadoc) the first parameter 1005 * is 1, the second is 2, ... 1006 * @param s (Taken from Sun's Javadoc) the parameter value (!!). 1007 * @exception SQLException if an error occurs. 1008 */ 1009 public void setShort(int index, short s) 1010 throws SQLException 1011 { 1012 PreparedStatement t_PreparedStatement = 1013 getPreparedStatement(); 1014 1015 if (t_PreparedStatement != null) 1016 { 1017 t_PreparedStatement.setShort(index, s); 1018 } 1019 } 1020 1021 /*** 1022 * See java.sql.PreparedStatement#setInt(int,int). 1023 * @see java.sql.PreparedStatement#setInt(int,int) 1024 * @param index (Taken from Sun's Javadoc) the first parameter 1025 * is 1, the second is 2, ... 1026 * @param value (Taken from Sun's Javadoc) the parameter value (!!). 1027 * @exception SQLException if an error occurs. 1028 */ 1029 public void setInt(int index, int value) 1030 throws SQLException 1031 { 1032 PreparedStatement t_PreparedStatement = 1033 getPreparedStatement(); 1034 1035 if (t_PreparedStatement != null) 1036 { 1037 t_PreparedStatement.setInt(index, value); 1038 } 1039 } 1040 1041 /*** 1042 * See java.sql.PreparedStatement#setLong(int,long). 1043 * @see java.sql.PreparedStatement#setLong(int,long) 1044 * @param index (Taken from Sun's Javadoc) the first parameter 1045 * is 1, the second is 2, ... 1046 * @param value (Taken from Sun's Javadoc) the parameter value (!!). 1047 * @exception SQLException if an error occurs. 1048 */ 1049 public void setLong(int index, long value) 1050 throws SQLException 1051 { 1052 PreparedStatement t_PreparedStatement = 1053 getPreparedStatement(); 1054 1055 if (t_PreparedStatement != null) 1056 { 1057 t_PreparedStatement.setLong(index, value); 1058 } 1059 } 1060 1061 /*** 1062 * See java.sql.PreparedStatement#setFloat(int,float). 1063 * @see java.sql.PreparedStatement#setFloat(int,float) 1064 * @param index (Taken from Sun's Javadoc) the first parameter 1065 * is 1, the second is 2, ... 1066 * @param value (Taken from Sun's Javadoc) the parameter value (!!). 1067 * @exception SQLException if an error occurs. 1068 */ 1069 public void setFloat(int index, float value) 1070 throws SQLException 1071 { 1072 PreparedStatement t_PreparedStatement = 1073 getPreparedStatement(); 1074 1075 if (t_PreparedStatement != null) 1076 { 1077 t_PreparedStatement.setFloat(index, value); 1078 } 1079 } 1080 1081 /*** 1082 * See java.sql.PreparedStatement#setDouble(int,double). 1083 * @see java.sql.PreparedStatement#setDouble(int,double) 1084 * @param index (Taken from Sun's Javadoc) the first parameter 1085 * is 1, the second is 2, ... 1086 * @param value (Taken from Sun's Javadoc) the parameter value (!!). 1087 * @exception SQLException if an error occurs. 1088 */ 1089 public void setDouble(int index, double value) 1090 throws SQLException 1091 { 1092 PreparedStatement t_PreparedStatement = 1093 getPreparedStatement(); 1094 1095 if (t_PreparedStatement != null) 1096 { 1097 t_PreparedStatement.setDouble(index, value); 1098 } 1099 } 1100 1101 /*** 1102 * See java.sql.PreparedStatement#getMetaData(). 1103 * @see java.sql.PreparedStatement#getMetaData() 1104 * @return (Taken from Sun's Javadoc) a ParameterMetaData 1105 * object that contains information about the number, 1106 * types and properties of this PreparedStatement 1107 * object's parameters. 1108 * @exception SQLException if an error occurs. 1109 */ 1110 public ResultSetMetaData getMetaData() 1111 throws SQLException 1112 { 1113 ResultSetMetaData result = null; 1114 1115 PreparedStatement t_PreparedStatement = 1116 getPreparedStatement(); 1117 1118 if (t_PreparedStatement != null) 1119 { 1120 result = t_PreparedStatement.getMetaData(); 1121 } 1122 1123 return result; 1124 } 1125 1126 /*** 1127 * See java.sql.PreparedStatement#executeQuery(). 1128 * @see java.sql.PreparedStatement#executeQuery() 1129 * @return (Taken from Sun's Javadoc) a ResultSet object 1130 * that contains the data produced by the query; never null. 1131 * @exception SQLException if an error occurs. 1132 */ 1133 public abstract ResultSet executeQuery() 1134 throws SQLException; 1135 1136 /*** 1137 * See java.sql.PreparedStatement#executeUpdate(). 1138 * @see java.sql.PreparedStatement#executeUpdate() 1139 * @return (Taken from Sun's Javadoc) either (1) the row 1140 * count for INSERT, UPDATE, or DELETE statements or 1141 * (2) 0 for SQL statements that return nothing. 1142 * @exception SQLException if an error occurs. 1143 */ 1144 public int executeUpdate() 1145 throws SQLException 1146 { 1147 int result = 0; 1148 1149 PreparedStatement t_PreparedStatement = 1150 getPreparedStatement(); 1151 1152 if (t_PreparedStatement != null) 1153 { 1154 result = t_PreparedStatement.executeUpdate(); 1155 } 1156 1157 return result; 1158 } 1159 1160 /*** 1161 * See java.sql.PreparedStatement#addBatch(). 1162 * @see java.sql.PreparedStatement#addBatch() 1163 * @exception SQLException if an error occurs. 1164 */ 1165 public void addBatch() 1166 throws SQLException 1167 { 1168 PreparedStatement t_PreparedStatement = 1169 getPreparedStatement(); 1170 1171 if (t_PreparedStatement != null) 1172 { 1173 t_PreparedStatement.addBatch(); 1174 } 1175 } 1176 1177 /*** 1178 * See java.sql.PreparedStatement#setNull(int,int). 1179 * @see java.sql.PreparedStatement#setNull(int,int) 1180 * @param index (Taken from Sun's Javadoc) the first parameter 1181 * is 1, the second is 2, ... 1182 * @param sqlType (Taken from Sun's Javadoc) the SQL type 1183 * code defined in java.sql.Types. 1184 * @exception SQLException if an error occurs. 1185 */ 1186 public void setNull(int index, int sqlType) 1187 throws SQLException 1188 { 1189 PreparedStatement t_PreparedStatement = 1190 getPreparedStatement(); 1191 1192 if (t_PreparedStatement != null) 1193 { 1194 t_PreparedStatement.setNull(index, sqlType); 1195 } 1196 } 1197 1198 /*** 1199 * See java.sql.PreparedStatement#setNull(int,int,String). 1200 * @see java.sql.PreparedStatement#setNull(int,int,String) 1201 * @param index (Taken from Sun's Javadoc) the first parameter 1202 * is 1, the second is 2, ... 1203 * @param sqlType (Taken from Sun's Javadoc) the SQL type 1204 * code defined in java.sql.Types. 1205 * @param typeName (Taken from Sun's Javadoc) the fully-qualified 1206 * name of an SQL user-defined type; ignored if the 1207 * parameter is not a user-defined type or REF. 1208 * @exception SQLException if an error occurs. 1209 */ 1210 public void setNull(int index, int sqlType, String typeName) 1211 throws SQLException 1212 { 1213 PreparedStatement t_PreparedStatement = 1214 getPreparedStatement(); 1215 1216 if (t_PreparedStatement != null) 1217 { 1218 t_PreparedStatement.setNull(index, sqlType, typeName); 1219 } 1220 } 1221 1222 /*** 1223 * See java.sql.PreparedStatement#setString(int,String). 1224 * @see java.sql.PreparedStatement#setString(int,String) 1225 * @param index (Taken from Sun's Javadoc) the first parameter 1226 * is 1, the second is 2, ... 1227 * @param value (Taken from Sun's Javadoc) the parameter value (!!). 1228 * @exception SQLException if an error occurs. 1229 */ 1230 public void setString(int index, String value) 1231 throws SQLException 1232 { 1233 PreparedStatement t_PreparedStatement = 1234 getPreparedStatement(); 1235 1236 if (t_PreparedStatement != null) 1237 { 1238 t_PreparedStatement.setString(index, value); 1239 } 1240 } 1241 1242 /*** 1243 * See java.sql.PreparedStatement#clearParameters(). 1244 * @see java.sql.PreparedStatement#clearParameters() 1245 * @exception SQLException if an error occurs. 1246 */ 1247 public void clearParameters() 1248 throws SQLException 1249 { 1250 PreparedStatement t_PreparedStatement = 1251 getPreparedStatement(); 1252 1253 if (t_PreparedStatement != null) 1254 { 1255 t_PreparedStatement.clearParameters(); 1256 } 1257 } 1258 1259 /*** 1260 * See java.sql.PreparedStatement#setArray(int,Array). 1261 * @see java.sql.PreparedStatement#setArray(int,java.sql.Array) 1262 * @param index (Taken from Sun's Javadoc) the first parameter 1263 * is 1, the second is 2, ... 1264 * @param value (Taken from Sun's Javadoc) the parameter value (!!). 1265 * @exception SQLException if an error occurs. 1266 */ 1267 public void setArray(int index, Array value) 1268 throws SQLException 1269 { 1270 PreparedStatement t_PreparedStatement = 1271 getPreparedStatement(); 1272 1273 if (t_PreparedStatement != null) 1274 { 1275 t_PreparedStatement.setArray(index, value); 1276 } 1277 } 1278 1279 /*** 1280 * See java.sql.PreparedStatement#setAsciiStream(int,InputStram,int). 1281 * @see java.sql.PreparedStatement#setAsciiStream(int,java.io.InputStream,int) 1282 * @param index (Taken from Sun's Javadoc) the first parameter 1283 * is 1, the second is 2, ... 1284 * @param inputStream (Taken from Sun's Javadoc) the Java input stream 1285 * that contains the ASCII parameter value. 1286 * @param length (Taken from Sun's Javadoc) the number of bytes 1287 * in the stream. 1288 * @exception SQLException if an error occurs. 1289 */ 1290 public void setAsciiStream( 1291 int index, 1292 InputStream inputStream, 1293 int length) 1294 throws SQLException 1295 { 1296 PreparedStatement t_PreparedStatement = 1297 getPreparedStatement(); 1298 1299 if (t_PreparedStatement != null) 1300 { 1301 t_PreparedStatement.setAsciiStream(index, inputStream, length); 1302 } 1303 } 1304 1305 /*** 1306 * See java.sql.PreparedStatement#setBigDecimal(int,BigDecimal). 1307 * @see java.sql.PreparedStatement#setBigDecimal(int,java.math.BigDecimal) 1308 * @param index (Taken from Sun's Javadoc) the first parameter 1309 * is 1, the second is 2, ... 1310 * @param value (Taken from Sun's Javadoc) the parameter value (!!). 1311 * @exception SQLException if an error occurs. 1312 */ 1313 public void setBigDecimal(int index, BigDecimal value) 1314 throws SQLException 1315 { 1316 PreparedStatement t_PreparedStatement = 1317 getPreparedStatement(); 1318 1319 if (t_PreparedStatement != null) 1320 { 1321 t_PreparedStatement.setBigDecimal(index, value); 1322 } 1323 } 1324 1325 /*** 1326 * See java.sql.PreparedStatement#setBinaryStream(int,InputStream). 1327 * @see java.sql.PreparedStatement#setBinaryStream(int,java.io.InputStream,int) 1328 * @param index (Taken from Sun's Javadoc) the first parameter 1329 * is 1, the second is 2, ... 1330 * @param inputStream (Taken from Sun's Javadoc) the Java input stream 1331 * that contains the binary parameter value. 1332 * @param length (Taken from Sun's Javadoc) the number of bytes 1333 * in the stream. 1334 * @exception SQLException if an error occurs. 1335 */ 1336 public void setBinaryStream( 1337 int index, 1338 InputStream inputStream, 1339 int length) 1340 throws SQLException 1341 { 1342 PreparedStatement t_PreparedStatement = 1343 getPreparedStatement(); 1344 1345 if (t_PreparedStatement != null) 1346 { 1347 t_PreparedStatement 1348 .setBinaryStream(index, inputStream, length); 1349 } 1350 } 1351 1352 /*** 1353 * See java.sql.PreparedStatement#setBlob(int,Blob). 1354 * @see java.sql.PreparedStatement#setBlob(int,java.sql.Blob) 1355 * @param index (Taken from Sun's Javadoc) the first parameter 1356 * is 1, the second is 2, ... 1357 * @param value (Taken from Sun's Javadoc) the parameter value (!!). 1358 * @exception SQLException if an error occurs. 1359 */ 1360 public void setBlob(int index, Blob value) 1361 throws SQLException 1362 { 1363 PreparedStatement t_PreparedStatement = 1364 getPreparedStatement(); 1365 1366 if (t_PreparedStatement != null) 1367 { 1368 t_PreparedStatement.setBlob(index, value); 1369 } 1370 } 1371 1372 /*** 1373 * See java.sql.PreparedStatement#setBytes(int,byte[]). 1374 * @see java.sql.PreparedStatement#setBytes(int,byte[]) 1375 * @param index (Taken from Sun's Javadoc) the first parameter 1376 * is 1, the second is 2, ... 1377 * @param value (Taken from Sun's Javadoc) the parameter value (!!). 1378 * @exception SQLException if an error occurs. 1379 */ 1380 public void setBytes(int index, byte[] value) 1381 throws SQLException 1382 { 1383 PreparedStatement t_PreparedStatement = 1384 getPreparedStatement(); 1385 1386 if (t_PreparedStatement != null) 1387 { 1388 t_PreparedStatement.setBytes(index, value); 1389 } 1390 } 1391 1392 /*** 1393 * See java.sql.PreparedStatement#setCharacterStream(int,Reader,int). 1394 * @see java.sql.PreparedStatement#setCharacterStream(int,java.io.Reader,int) 1395 * @param index (Taken from Sun's Javadoc) the first parameter 1396 * is 1, the second is 2, ... 1397 * @param reader (Taken from Sun's Javadoc) the java.io.Reader 1398 * object that contains the Unicode data. 1399 * @param length (Taken from Sun's Javadoc) the number of bytes 1400 * in the stream. 1401 * @exception SQLException if an error occurs. 1402 */ 1403 public void setCharacterStream( 1404 int index, 1405 Reader reader, 1406 int length) 1407 throws SQLException 1408 { 1409 PreparedStatement t_PreparedStatement = 1410 getPreparedStatement(); 1411 1412 if (t_PreparedStatement != null) 1413 { 1414 t_PreparedStatement.setCharacterStream(index, reader, length); 1415 } 1416 } 1417 1418 /*** 1419 * See java.sql.PreparedStatement#setClob(int,Clob). 1420 * @see java.sql.PreparedStatement#setClob(int,java.sql.Clob) 1421 * @param index (Taken from Sun's Javadoc) the first parameter 1422 * is 1, the second is 2, ... 1423 * @param value (Taken from Sun's Javadoc) the parameter value (!!). 1424 * @exception SQLException if an error occurs. 1425 */ 1426 public void setClob(int index, Clob value) 1427 throws SQLException 1428 { 1429 PreparedStatement t_PreparedStatement = 1430 getPreparedStatement(); 1431 1432 if (t_PreparedStatement != null) 1433 { 1434 t_PreparedStatement.setClob(index, value); 1435 } 1436 } 1437 1438 /*** 1439 * See java.sql.PreparedStatement#setDate(int,Date). 1440 * @see java.sql.PreparedStatement#setDate(int,java.sql.Date) 1441 * @param index (Taken from Sun's Javadoc) the first parameter 1442 * is 1, the second is 2, ... 1443 * @param value (Taken from Sun's Javadoc) the parameter value (!!). 1444 * @exception SQLException if an error occurs. 1445 */ 1446 public void setDate(int index, Date value) 1447 throws SQLException 1448 { 1449 PreparedStatement t_PreparedStatement = 1450 getPreparedStatement(); 1451 1452 if (t_PreparedStatement != null) 1453 { 1454 t_PreparedStatement.setDate(index, value); 1455 } 1456 } 1457 1458 /*** 1459 * See java.sql.PreparedStatement#setDate(int,Date,Calendar). 1460 * @see java.sql.PreparedStatement#setDate(int,java.sql.Date,java.util.Calendar) 1461 * @param index (Taken from Sun's Javadoc) the first parameter 1462 * is 1, the second is 2, ... 1463 * @param value (Taken from Sun's Javadoc) the parameter value (!!). 1464 * @param calendar (Taken from Sun's Javadoc) the Calendar object 1465 * the driver will use to construct the time. 1466 * @exception SQLException if an error occurs. 1467 */ 1468 public void setDate(int index, Date value, Calendar calendar) 1469 throws SQLException 1470 { 1471 PreparedStatement t_PreparedStatement = 1472 getPreparedStatement(); 1473 1474 if (t_PreparedStatement != null) 1475 { 1476 t_PreparedStatement.setDate(index, value, calendar); 1477 } 1478 } 1479 1480 /*** 1481 * See java.sql.PreparedStatement#setObject(int,Object,int,int). 1482 * @see java.sql.PreparedStatement#setObject(int,Object,int,int) 1483 * @param index (Taken from Sun's Javadoc) the first parameter 1484 * is 1, the second is 2, ... 1485 * @param value (Taken from Sun's Javadoc) the parameter value (!!). 1486 * @param sqlType (Taken from Sun's Javadoc) the SQL type 1487 * (as defined in java.sql.Types) to be sent to the database. 1488 * The scale argument may further qualify this type. 1489 * @param scale (Taken from Sun's Javadoc) for 1490 * java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types, 1491 * this is the number of digits after the decimal point. For all 1492 * other types, this value will be ignored. 1493 * @exception SQLException if an error occurs. 1494 */ 1495 public void setObject(int index, Object value, int sqlType, int scale) 1496 throws SQLException 1497 { 1498 PreparedStatement t_PreparedStatement = 1499 getPreparedStatement(); 1500 1501 if (t_PreparedStatement != null) 1502 { 1503 t_PreparedStatement.setObject(index, value, sqlType, scale); 1504 } 1505 } 1506 1507 /*** 1508 * See java.sql.PreparedStatement#setObject(int,Object,int). 1509 * @see java.sql.PreparedStatement#setObject(int,Object,int) 1510 * @param index (Taken from Sun's Javadoc) the first parameter 1511 * is 1, the second is 2, ... 1512 * @param value (Taken from Sun's Javadoc) the parameter value (!!). 1513 * @param sqlType (Taken from Sun's Javadoc) the SQL type 1514 * (as defined in java.sql.Types) to be sent to the database. 1515 * The scale argument may further qualify this type. 1516 * @exception SQLException if an error occurs. 1517 */ 1518 public void setObject(int index, Object value, int sqlType) 1519 throws SQLException 1520 { 1521 PreparedStatement t_PreparedStatement = 1522 getPreparedStatement(); 1523 1524 if (t_PreparedStatement != null) 1525 { 1526 t_PreparedStatement.setObject(index, value, sqlType); 1527 } 1528 } 1529 1530 /*** 1531 * See java.sql.PreparedStatement#setObject(int,Object). 1532 * @see java.sql.PreparedStatement#setObject(int,Object) 1533 * @param index (Taken from Sun's Javadoc) the first parameter 1534 * is 1, the second is 2, ... 1535 * @param value (Taken from Sun's Javadoc) the parameter value (!!). 1536 * @exception SQLException if an error occurs. 1537 */ 1538 public void setObject(int index, Object value) 1539 throws SQLException 1540 { 1541 PreparedStatement t_PreparedStatement = 1542 getPreparedStatement(); 1543 1544 if (t_PreparedStatement != null) 1545 { 1546 t_PreparedStatement.setObject(index, value); 1547 } 1548 } 1549 1550 /*** 1551 * See java.sql.PreparedStatement#setRef(int,Ref). 1552 * @see java.sql.PreparedStatement#setRef(int,java.sql.Ref) 1553 * @param index (Taken from Sun's Javadoc) the first parameter 1554 * is 1, the second is 2, ... 1555 * @param value (Taken from Sun's Javadoc) the parameter value (!!). 1556 * @exception SQLException if an error occurs. 1557 */ 1558 public void setRef(int index, Ref value) 1559 throws SQLException 1560 { 1561 PreparedStatement t_PreparedStatement = 1562 getPreparedStatement(); 1563 1564 if (t_PreparedStatement != null) 1565 { 1566 t_PreparedStatement.setRef(index, value); 1567 } 1568 } 1569 1570 /*** 1571 * See java.sql.PreparedStatement#setTimestamp(int,Timestamp). 1572 * @see java.sql.PreparedStatement#setTimestamp(int,java.sql.Timestamp) 1573 * @param index (Taken from Sun's Javadoc) the first parameter 1574 * is 1, the second is 2, ... 1575 * @param value (Taken from Sun's Javadoc) the parameter value (!!). 1576 * @exception SQLException if an error occurs. 1577 */ 1578 public void setTimestamp(int index, Timestamp value) 1579 throws SQLException 1580 { 1581 PreparedStatement t_PreparedStatement = 1582 getPreparedStatement(); 1583 1584 if (t_PreparedStatement != null) 1585 { 1586 t_PreparedStatement.setTimestamp(index, value); 1587 } 1588 } 1589 1590 /*** 1591 * See java.sql.PreparedStatement#setTimestamp(int,Timestamp,Calendar). 1592 * @see java.sql.PreparedStatement#setTimestamp(int,java.sql.Timestamp,java.util.Calendar) 1593 * @param index (Taken from Sun's Javadoc) the first parameter 1594 * is 1, the second is 2, ... 1595 * @param value (Taken from Sun's Javadoc) the parameter value (!!). 1596 * @param calendar (Taken from Sun's Javadoc) the Calendar object 1597 * the driver will use to construct the time. 1598 * @exception SQLException if an error occurs. 1599 */ 1600 public void setTimestamp(int index, Timestamp value, Calendar calendar) 1601 throws SQLException 1602 { 1603 PreparedStatement t_PreparedStatement = 1604 getPreparedStatement(); 1605 1606 if (t_PreparedStatement != null) 1607 { 1608 t_PreparedStatement.setTimestamp(index, value, calendar); 1609 } 1610 } 1611 1612 /*** 1613 * See java.sql.PreparedStatement#setUnicodeStream(int,InputStream,int). 1614 * @see java.sql.PreparedStatement#setUnicodeStream(int,java.io.InputStream,int) 1615 * @param index (Taken from Sun's Javadoc) the first parameter 1616 * is 1, the second is 2, ... 1617 * @param inputStream (Taken from Sun's Javadoc) the Java input stream 1618 * that contains the Unicode parameter value. 1619 * @param length (Taken from Sun's Javadoc) the number of bytes 1620 * in the stream. 1621 * @exception SQLException if an error occurs. 1622 */ 1623 public void setUnicodeStream( 1624 int index, 1625 InputStream inputStream, 1626 int length) 1627 throws SQLException 1628 { 1629 PreparedStatement t_PreparedStatement = 1630 getPreparedStatement(); 1631 1632 if (t_PreparedStatement != null) 1633 { 1634 t_PreparedStatement.setUnicodeStream(index, inputStream, length); 1635 } 1636 } 1637 1638 // End of java.sql.PreparedStatement // 1639 1640 /*** 1641 * Specifies the value of a time parameter, associated with a 1642 * previously specified variable condition. 1643 * @param condition the variable condition. 1644 * @param value the time value. 1645 * @see java.sql.PreparedStatement#setTime(int,java.sql.Time) 1646 * @exception SQLException if an error occurs. 1647 */ 1648 public void setTime(VariableCondition condition, Time value) 1649 throws SQLException 1650 { 1651 int t_iIndex = getIndex(getVariableConditions(), condition); 1652 1653 if (t_iIndex > 0) 1654 { 1655 PreparedStatement t_PreparedStatement = 1656 getPreparedStatement(); 1657 1658 if (t_PreparedStatement != null) 1659 { 1660 t_PreparedStatement.setTime(t_iIndex, value); 1661 } 1662 } 1663 } 1664 1665 /*** 1666 * Specifies the value of a time parameter, associated with a 1667 * previously specified variable condition. 1668 * @param condition the variable condition. 1669 * @param value the time value. 1670 * @param calendar (Taken from Sun's Javadoc) the Calendar object 1671 * the driver will use to construct the time. 1672 * @see java.sql.PreparedStatement#setTime(int,java.sql.Time) 1673 * @exception SQLException if an error occurs. 1674 */ 1675 public void setTime( 1676 VariableCondition condition, 1677 Time value, 1678 Calendar calendar) 1679 throws SQLException 1680 { 1681 int t_iIndex = getIndex(getVariableConditions(), condition); 1682 1683 if (t_iIndex > 0) 1684 { 1685 PreparedStatement t_PreparedStatement = 1686 getPreparedStatement(); 1687 1688 if (t_PreparedStatement != null) 1689 { 1690 t_PreparedStatement.setTime(t_iIndex, value, calendar); 1691 } 1692 } 1693 } 1694 1695 /*** 1696 * Specifies the value of a boolean parameter, associated with a 1697 * previously specified variable condition. 1698 * @param condition the variable condition. 1699 * @param value the boolean value. 1700 * @see java.sql.PreparedStatement#setBoolean(int,boolean) 1701 * @exception SQLException if an error occurs. 1702 */ 1703 public void setBoolean(VariableCondition condition, boolean value) 1704 throws SQLException 1705 { 1706 int t_iIndex = getIndex(getVariableConditions(), condition); 1707 1708 if (t_iIndex > 0) 1709 { 1710 PreparedStatement t_PreparedStatement = 1711 getPreparedStatement(); 1712 1713 if (t_PreparedStatement != null) 1714 { 1715 t_PreparedStatement.setBoolean(t_iIndex, value); 1716 } 1717 } 1718 } 1719 1720 /*** 1721 * Specifies the value of a byte parameter, associated with a 1722 * previously specified variable condition. 1723 * @param condition the variable condition. 1724 * @param value the byte value. 1725 * @see java.sql.PreparedStatement#setByte(int,byte) 1726 * @exception SQLException if an error occurs. 1727 */ 1728 public void setByte(VariableCondition condition, byte value) 1729 throws SQLException 1730 { 1731 int t_iIndex = getIndex(getVariableConditions(), condition); 1732 1733 if (t_iIndex > 0) 1734 { 1735 PreparedStatement t_PreparedStatement = 1736 getPreparedStatement(); 1737 1738 if (t_PreparedStatement != null) 1739 { 1740 t_PreparedStatement.setByte(t_iIndex, value); 1741 } 1742 } 1743 } 1744 1745 /*** 1746 * Specifies the value of a short parameter, associated with a 1747 * previously specified variable condition. 1748 * @param condition the variable condition. 1749 * @param value the short value. 1750 * @see java.sql.PreparedStatement#setShort(int,short) 1751 * @exception SQLException if an error occurs. 1752 */ 1753 public void setShort(VariableCondition condition, short value) 1754 throws SQLException 1755 { 1756 int t_iIndex = getIndex(getVariableConditions(), condition); 1757 1758 if (t_iIndex > 0) 1759 { 1760 PreparedStatement t_PreparedStatement = 1761 getPreparedStatement(); 1762 1763 if (t_PreparedStatement != null) 1764 { 1765 t_PreparedStatement.setShort(t_iIndex, value); 1766 } 1767 } 1768 } 1769 1770 /*** 1771 * Specifies the value of an int parameter, associated with a 1772 * previously specified variable condition. 1773 * @param condition the variable condition. 1774 * @param value the int value. 1775 * @see java.sql.PreparedStatement#setInt(int,int) 1776 * @exception SQLException if an error occurs. 1777 */ 1778 public void setInt(VariableCondition condition, int value) 1779 throws SQLException 1780 { 1781 int t_iIndex = getIndex(getVariableConditions(), condition); 1782 1783 if (t_iIndex > 0) 1784 { 1785 PreparedStatement t_PreparedStatement = 1786 getPreparedStatement(); 1787 1788 if (t_PreparedStatement != null) 1789 { 1790 t_PreparedStatement.setInt(t_iIndex, value); 1791 } 1792 } 1793 } 1794 1795 /*** 1796 * Specifies the value of a long parameter, associated with a 1797 * previously specified variable condition. 1798 * @param condition the variable condition. 1799 * @param value the long value. 1800 * @see java.sql.PreparedStatement#setLong(int,long) 1801 * @exception SQLException if an error occurs. 1802 */ 1803 public void setLong(VariableCondition condition, long value) 1804 throws SQLException 1805 { 1806 int t_iIndex = getIndex(getVariableConditions(), condition); 1807 1808 if (t_iIndex > 0) 1809 { 1810 PreparedStatement t_PreparedStatement = 1811 getPreparedStatement(); 1812 1813 if (t_PreparedStatement != null) 1814 { 1815 t_PreparedStatement.setLong(t_iIndex, value); 1816 } 1817 } 1818 } 1819 1820 /*** 1821 * Specifies the value of a float parameter, associated with a 1822 * previously specified variable condition. 1823 * @param condition the variable condition. 1824 * @param value the float value. 1825 * @see java.sql.PreparedStatement#setFloat(int,float) 1826 * @exception SQLException if an error occurs. 1827 */ 1828 public void setFloat(VariableCondition condition, float value) 1829 throws SQLException 1830 { 1831 int t_iIndex = getIndex(getVariableConditions(), condition); 1832 1833 if (t_iIndex > 0) 1834 { 1835 PreparedStatement t_PreparedStatement = 1836 getPreparedStatement(); 1837 1838 if (t_PreparedStatement != null) 1839 { 1840 t_PreparedStatement.setFloat(t_iIndex, value); 1841 } 1842 } 1843 } 1844 1845 /*** 1846 * Specifies the value of a double parameter, associated with a 1847 * previously specified variable condition. 1848 * @param condition the variable condition. 1849 * @param value the double value. 1850 * @see java.sql.PreparedStatement#setDouble(int,double) 1851 * @exception SQLException if an error occurs. 1852 */ 1853 public void setDouble(VariableCondition condition, double value) 1854 throws SQLException 1855 { 1856 int t_iIndex = getIndex(getVariableConditions(), condition); 1857 1858 if (t_iIndex > 0) 1859 { 1860 PreparedStatement t_PreparedStatement = 1861 getPreparedStatement(); 1862 1863 if (t_PreparedStatement != null) 1864 { 1865 t_PreparedStatement.setDouble(t_iIndex, value); 1866 } 1867 } 1868 } 1869 1870 /*** 1871 * Specifies as <code>null</code> the value of a parameter, 1872 * associated with a previously specified variable condition. 1873 * @param condition the variable condition. 1874 * @param sqlType (Taken from Sun's Javadoc) the SQL type 1875 * code defined in java.sql.Types. 1876 * @see java.sql.PreparedStatement#setNull(int,int) 1877 * @exception SQLException if an error occurs. 1878 */ 1879 public void setNull(VariableCondition condition, int sqlType) 1880 throws SQLException 1881 { 1882 int t_iIndex = getIndex(getVariableConditions(), condition); 1883 1884 if (t_iIndex > 0) 1885 { 1886 PreparedStatement t_PreparedStatement = 1887 getPreparedStatement(); 1888 1889 if (t_PreparedStatement != null) 1890 { 1891 t_PreparedStatement.setNull(t_iIndex, sqlType); 1892 } 1893 } 1894 } 1895 1896 /*** 1897 * Specifies as <code>null</code> the value of a parameter, 1898 * associated with a previously specified variable condition. 1899 * @param condition the variable condition. 1900 * @param sqlType (Taken from Sun's Javadoc) the SQL type 1901 * code defined in java.sql.Types. 1902 * @param typeName (Taken from Sun's Javadoc) the fully-qualified 1903 * name of an SQL user-defined type; ignored if the 1904 * parameter is not a user-defined type or REF. 1905 * @see java.sql.PreparedStatement#setNull(int,int,String) 1906 * @exception SQLException if an error occurs. 1907 */ 1908 public void setNull( 1909 VariableCondition condition, 1910 int sqlType, 1911 String typeName) 1912 throws SQLException 1913 { 1914 int t_iIndex = getIndex(getVariableConditions(), condition); 1915 1916 if (t_iIndex > 0) 1917 { 1918 PreparedStatement t_PreparedStatement = 1919 getPreparedStatement(); 1920 1921 if (t_PreparedStatement != null) 1922 { 1923 t_PreparedStatement.setNull(t_iIndex, sqlType, typeName); 1924 } 1925 } 1926 } 1927 1928 /*** 1929 * Specifies the value of a String parameter, 1930 * associated with a previously specified variable condition. 1931 * @param condition the variable condition. 1932 * @param value the String value. 1933 * @see java.sql.PreparedStatement#setString(int,int) 1934 * @exception SQLException if an error occurs. 1935 */ 1936 public void setString(VariableCondition condition, String value) 1937 throws SQLException 1938 { 1939 int t_iIndex = getIndex(getVariableConditions(), condition); 1940 1941 if (t_iIndex > 0) 1942 { 1943 PreparedStatement t_PreparedStatement = 1944 getPreparedStatement(); 1945 1946 if (t_PreparedStatement != null) 1947 { 1948 t_PreparedStatement.setString(t_iIndex, value); 1949 } 1950 } 1951 } 1952 1953 /*** 1954 * Specifies the value of an Array parameter, 1955 * associated with a previously specified variable condition. 1956 * @param condition the variable condition. 1957 * @param value the Array value. 1958 * @see java.sql.PreparedStatement#setArray(int,java.sql.Array) 1959 * @exception SQLException if an error occurs. 1960 */ 1961 public void setArray(VariableCondition condition, Array value) 1962 throws SQLException 1963 { 1964 int t_iIndex = getIndex(getVariableConditions(), condition); 1965 1966 if (t_iIndex > 0) 1967 { 1968 PreparedStatement t_PreparedStatement = 1969 getPreparedStatement(); 1970 1971 if (t_PreparedStatement != null) 1972 { 1973 t_PreparedStatement.setArray(t_iIndex, value); 1974 } 1975 } 1976 } 1977 1978 /*** 1979 * Specifies the value of a parameter formatted as an ASCII stream, 1980 * associated with a previously specified variable condition. 1981 * @param condition the variable condition. 1982 * @param inputStream (Taken from Sun's Javadoc) the Java input stream 1983 * that contains the ASCII parameter value. 1984 * @param length (Taken from Sun's Javadoc) the number of bytes 1985 * in the stream. 1986 * @see java.sql.PreparedStatement#setAsciiStream(int,java.io.InputStream,int) 1987 * @exception SQLException if an error occurs. 1988 */ 1989 public void setAsciiStream( 1990 VariableCondition condition, 1991 InputStream inputStream, 1992 int length) 1993 throws SQLException 1994 { 1995 int t_iIndex = getIndex(getVariableConditions(), condition); 1996 1997 if (t_iIndex > 0) 1998 { 1999 PreparedStatement t_PreparedStatement = 2000 getPreparedStatement(); 2001 2002 if (t_PreparedStatement != null) 2003 { 2004 t_PreparedStatement 2005 .setAsciiStream(t_iIndex, inputStream, length); 2006 } 2007 } 2008 } 2009 2010 /*** 2011 * Specifies the value of a BigDecimal parameter, 2012 * associated with a previously specified variable condition. 2013 * @param condition the variable condition. 2014 * @param value the big decimal value. 2015 * @see java.sql.PreparedStatement#setBigDecimal(int,java.math.BigDecimal) 2016 * @exception SQLException if an error occurs. 2017 */ 2018 public void setBigDecimal( 2019 VariableCondition condition, 2020 BigDecimal value) 2021 throws SQLException 2022 { 2023 int t_iIndex = getIndex(getVariableConditions(), condition); 2024 2025 if (t_iIndex > 0) 2026 { 2027 PreparedStatement t_PreparedStatement = 2028 getPreparedStatement(); 2029 2030 if (t_PreparedStatement != null) 2031 { 2032 t_PreparedStatement.setBigDecimal(t_iIndex, value); 2033 } 2034 } 2035 } 2036 2037 /*** 2038 * Specifies the value of a parameter formatted as a binary stream, 2039 * associated with a previously specified variable condition. 2040 * @param condition the variable condition. 2041 * @param inputStream (Taken from Sun's Javadoc) the Java input stream 2042 * that contains the binary parameter value. 2043 * @param length (Taken from Sun's Javadoc) the number of bytes 2044 * in the stream. 2045 * @see java.sql.PreparedStatement#setBinaryStream(int,java.io.InputStream,int) 2046 * @exception SQLException if an error occurs. 2047 */ 2048 public void setBinaryStream( 2049 VariableCondition condition, 2050 InputStream inputStream, 2051 int length) 2052 throws SQLException 2053 { 2054 int t_iIndex = getIndex(getVariableConditions(), condition); 2055 2056 if (t_iIndex > 0) 2057 { 2058 PreparedStatement t_PreparedStatement = 2059 getPreparedStatement(); 2060 2061 if (t_PreparedStatement != null) 2062 { 2063 t_PreparedStatement 2064 .setBinaryStream(t_iIndex, inputStream, length); 2065 } 2066 } 2067 } 2068 2069 /*** 2070 * Specifies the value of a blob parameter, 2071 * associated with a previously specified variable condition. 2072 * @param condition the variable condition. 2073 * @param value the blob value. 2074 * @see java.sql.PreparedStatement#setBlob(int,java.sql.Blob) 2075 * @exception SQLException if an error occurs. 2076 */ 2077 public void setBlob(VariableCondition condition, Blob value) 2078 throws SQLException 2079 { 2080 int t_iIndex = getIndex(getVariableConditions(), condition); 2081 2082 if (t_iIndex > 0) 2083 { 2084 PreparedStatement t_PreparedStatement = 2085 getPreparedStatement(); 2086 2087 if (t_PreparedStatement != null) 2088 { 2089 t_PreparedStatement.setBlob(t_iIndex, value); 2090 } 2091 } 2092 } 2093 2094 /*** 2095 * Specifies the value of a byte array parameter, 2096 * associated with a previously specified variable condition. 2097 * @param condition the variable condition. 2098 * @param value the byte array value. 2099 * @see java.sql.PreparedStatement#setBigDecimal(int,byte[]) 2100 * @exception SQLException if an error occurs. 2101 */ 2102 public void setBytes(VariableCondition condition, byte[] value) 2103 throws SQLException 2104 { 2105 int t_iIndex = getIndex(getVariableConditions(), condition); 2106 2107 if (t_iIndex > 0) 2108 { 2109 PreparedStatement t_PreparedStatement = 2110 getPreparedStatement(); 2111 2112 if (t_PreparedStatement != null) 2113 { 2114 t_PreparedStatement.setBytes(t_iIndex, value); 2115 } 2116 } 2117 } 2118 2119 /*** 2120 * Specifies the value of a parameter formatted as a binary stream, 2121 * associated with a previously specified variable condition. 2122 * @param condition the variable condition. 2123 * @param reader (Taken from Sun's Javadoc) the java.io.Reader object 2124 * that contains the Unicode data. 2125 * @param length (Taken from Sun's Javadoc) the number of bytes 2126 * in the stream. 2127 * @see java.sql.PreparedStatement#setCharacterStream(int,java.io.Reader,int) 2128 * @exception SQLException if an error occurs. 2129 */ 2130 public void setCharacterStream( 2131 VariableCondition condition, 2132 Reader reader, 2133 int length) 2134 throws SQLException 2135 { 2136 int t_iIndex = getIndex(getVariableConditions(), condition); 2137 2138 if (t_iIndex > 0) 2139 { 2140 PreparedStatement t_PreparedStatement = 2141 getPreparedStatement(); 2142 2143 if (t_PreparedStatement != null) 2144 { 2145 t_PreparedStatement 2146 .setCharacterStream(t_iIndex, reader, length); 2147 } 2148 } 2149 } 2150 2151 /*** 2152 * Specifies the value of a clob parameter, 2153 * associated with a previously specified variable condition. 2154 * @param condition the variable condition. 2155 * @param value the clob value. 2156 * @see java.sql.PreparedStatement#setClob(int,java.sql.Clob) 2157 * @exception SQLException if an error occurs. 2158 */ 2159 public void setClob(VariableCondition condition, Clob value) 2160 throws SQLException 2161 { 2162 int t_iIndex = getIndex(getVariableConditions(), condition); 2163 2164 if (t_iIndex > 0) 2165 { 2166 PreparedStatement t_PreparedStatement = 2167 getPreparedStatement(); 2168 2169 if (t_PreparedStatement != null) 2170 { 2171 t_PreparedStatement.setClob(t_iIndex, value); 2172 } 2173 } 2174 } 2175 2176 /*** 2177 * Specifies the value of a date parameter, associated with a 2178 * previously specified variable condition. 2179 * @param condition the variable condition. 2180 * @param value the date value. 2181 * @see java.sql.PreparedStatement#setDate(int,java.sql.Date) 2182 * @exception SQLException if an error occurs. 2183 */ 2184 public void setDate(VariableCondition condition, Date value) 2185 throws SQLException 2186 { 2187 int t_iIndex = getIndex(getVariableConditions(), condition); 2188 2189 if (t_iIndex > 0) 2190 { 2191 PreparedStatement t_PreparedStatement = 2192 getPreparedStatement(); 2193 2194 if (t_PreparedStatement != null) 2195 { 2196 t_PreparedStatement.setDate(t_iIndex, value); 2197 } 2198 } 2199 } 2200 2201 /*** 2202 * Specifies the value of a date parameter, associated with a 2203 * previously specified variable condition. 2204 * @param condition the variable condition. 2205 * @param value the date value. 2206 * @param calendar (Taken from Sun's Javadoc) the Calendar object 2207 * the driver will use to construct the date. 2208 * @see java.sql.PreparedStatement#setDate(int,java.sql.Date) 2209 * @exception SQLException if an error occurs. 2210 */ 2211 public void setDate( 2212 VariableCondition condition, 2213 Date value, 2214 Calendar calendar) 2215 throws SQLException 2216 { 2217 int t_iIndex = getIndex(getVariableConditions(), condition); 2218 2219 if (t_iIndex > 0) 2220 { 2221 PreparedStatement t_PreparedStatement = 2222 getPreparedStatement(); 2223 2224 if (t_PreparedStatement != null) 2225 { 2226 t_PreparedStatement.setDate(t_iIndex, value, calendar); 2227 } 2228 } 2229 } 2230 2231 /*** 2232 * Specifies the value of an object parameter, 2233 * associated with a previously specified variable condition. 2234 * @param condition the variable condition. 2235 * @param value the object value. 2236 * @param sqlType (Taken from Sun's Javadoc) the SQL type 2237 * (as defined in java.sql.Types) to be sent to the database. 2238 * The scale argument may further qualify this type. 2239 * @param scale (Taken from Sun's Javadoc) for 2240 * java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types, 2241 * this is the number of digits after the decimal point. For all 2242 * other types, this value will be ignored. 2243 * @see java.sql.PreparedStatement#setObject(int,Object,int,int) 2244 * @exception SQLException if an error occurs. 2245 */ 2246 public void setObject( 2247 VariableCondition condition, 2248 Object value, 2249 int sqlType, 2250 int scale) 2251 throws SQLException 2252 { 2253 int t_iIndex = getIndex(getVariableConditions(), condition); 2254 2255 if (t_iIndex > 0) 2256 { 2257 PreparedStatement t_PreparedStatement = 2258 getPreparedStatement(); 2259 2260 if (t_PreparedStatement != null) 2261 { 2262 t_PreparedStatement 2263 .setObject(t_iIndex, value, sqlType, scale); 2264 } 2265 } 2266 } 2267 2268 /*** 2269 * Specifies the value of an object parameter, 2270 * associated with a previously specified variable condition. 2271 * @param condition the variable condition. 2272 * @param value the object value. 2273 * @param sqlType (Taken from Sun's Javadoc) the SQL type 2274 * (as defined in java.sql.Types) to be sent to the database. 2275 * @see java.sql.PreparedStatement#setObject(int,Object,int) 2276 * @exception SQLException if an error occurs. 2277 */ 2278 public void setObject( 2279 VariableCondition condition, 2280 Object value, 2281 int sqlType) 2282 throws SQLException 2283 { 2284 int t_iIndex = getIndex(getVariableConditions(), condition); 2285 2286 if (t_iIndex > 0) 2287 { 2288 PreparedStatement t_PreparedStatement = 2289 getPreparedStatement(); 2290 2291 if (t_PreparedStatement != null) 2292 { 2293 t_PreparedStatement.setObject(t_iIndex, value, sqlType); 2294 } 2295 } 2296 } 2297 2298 /*** 2299 * Specifies the value of an object parameter, 2300 * associated with a previously specified variable condition. 2301 * @param condition the variable condition. 2302 * @param value the object value. 2303 * @see java.sql.PreparedStatement#setObject(int,Object) 2304 * @exception SQLException if an error occurs. 2305 */ 2306 public void setObject(VariableCondition condition, Object value) 2307 throws SQLException 2308 { 2309 int t_iIndex = getIndex(getVariableConditions(), condition); 2310 2311 if (t_iIndex > 0) 2312 { 2313 PreparedStatement t_PreparedStatement = 2314 getPreparedStatement(); 2315 2316 if (t_PreparedStatement != null) 2317 { 2318 t_PreparedStatement.setObject(t_iIndex, value); 2319 } 2320 } 2321 } 2322 2323 /*** 2324 * Specifies the value of a ref parameter, 2325 * associated with a previously specified variable condition. 2326 * @param condition the variable condition. 2327 * @param value the ref value. 2328 * @see java.sql.PreparedStatement#setRef(int,java.sql.Ref) 2329 * @exception SQLException if an error occurs. 2330 */ 2331 public void setRef(VariableCondition condition, Ref value) 2332 throws SQLException 2333 { 2334 int t_iIndex = getIndex(getVariableConditions(), condition); 2335 2336 if (t_iIndex > 0) 2337 { 2338 PreparedStatement t_PreparedStatement = 2339 getPreparedStatement(); 2340 2341 if (t_PreparedStatement != null) 2342 { 2343 t_PreparedStatement.setRef(t_iIndex, value); 2344 } 2345 } 2346 } 2347 2348 /*** 2349 * Specifies the value of a timestamp parameter, associated with a 2350 * previously specified variable condition. 2351 * @param condition the variable condition. 2352 * @param value the timestamp value. 2353 * @see java.sql.PreparedStatement#setTimestamp(int,java.sql.Timestamp) 2354 * @exception SQLException if an error occurs. 2355 */ 2356 public void setTimestamp(VariableCondition condition, Timestamp value) 2357 throws SQLException 2358 { 2359 int t_iIndex = getIndex(getVariableConditions(), condition); 2360 2361 if (t_iIndex > 0) 2362 { 2363 PreparedStatement t_PreparedStatement = 2364 getPreparedStatement(); 2365 2366 if (t_PreparedStatement != null) 2367 { 2368 t_PreparedStatement.setTimestamp(t_iIndex, value); 2369 } 2370 } 2371 } 2372 2373 /*** 2374 * Specifies the value of a timestamp parameter, associated with a 2375 * previously specified variable condition. 2376 * @param condition the variable condition. 2377 * @param value the timestamp value. 2378 * @param calendar (Taken from Sun's Javadoc) the Calendar object 2379 * the driver will use to construct the timestamp. 2380 * @see java.sql.PreparedStatement#setTimestamp(int,java.sql.Timestamp) 2381 * @exception SQLException if an error occurs. 2382 */ 2383 public void setTimestamp( 2384 VariableCondition condition, 2385 Timestamp value, 2386 Calendar calendar) 2387 throws SQLException 2388 { 2389 int t_iIndex = getIndex(getVariableConditions(), condition); 2390 2391 if (t_iIndex > 0) 2392 { 2393 PreparedStatement t_PreparedStatement = 2394 getPreparedStatement(); 2395 2396 if (t_PreparedStatement != null) 2397 { 2398 t_PreparedStatement 2399 .setTimestamp(t_iIndex, value, calendar); 2400 } 2401 } 2402 } 2403 /*** 2404 * Specifies the value of a parameter formatted as an Unicode stream, 2405 * associated with a previously specified variable condition. 2406 * @param condition the variable condition. 2407 * @param inputStream (Taken from Sun's Javadoc) the Java input stream 2408 * that contains the Unicode parameter value. 2409 * @param length (Taken from Sun's Javadoc) the number of bytes 2410 * in the stream. 2411 * @see java.sql.PreparedStatement#setUnicodeStream(int,java.io.InputStream,int) 2412 * @exception SQLException if an error occurs. 2413 */ 2414 public void setUnicodeStream( 2415 VariableCondition condition, 2416 InputStream inputStream, 2417 int length) 2418 throws SQLException 2419 { 2420 int t_iIndex = getIndex(getVariableConditions(), condition); 2421 2422 if (t_iIndex > 0) 2423 { 2424 PreparedStatement t_PreparedStatement = 2425 getPreparedStatement(); 2426 2427 if (t_PreparedStatement != null) 2428 { 2429 t_PreparedStatement 2430 .setUnicodeStream(t_iIndex, inputStream, length); 2431 } 2432 } 2433 } 2434 2435 // New from java.sql.Statement 1.4 // 2436 2437 /*** 2438 * See Statement#getMoreResults(int) 2439 * @see java.sql.Statement#getMoreResults(int) 2440 * @param current (Taken from Sun's Javadoc) one of the following 2441 * Statement constants indicating what should happen to current ResultSet 2442 * objects obtained using the method getResultSetCLOSE_CURRENT_RESULT, 2443 * KEEP_CURRENT_RESULT, or CLOSE_ALL_RESULTS. 2444 * @return (Taken from Sun's Javadoc) <code>true</code> if the next result 2445 * is a ResultSet object; <code>false</code> if it is an update count or 2446 * there are no more results. 2447 * @exception SQLException if an error occurs. 2448 */ 2449 public boolean getMoreResults(int current) 2450 throws SQLException 2451 { 2452 boolean result = false; 2453 2454 PreparedStatement t_PreparedStatement = getPreparedStatement(); 2455 2456 if (t_PreparedStatement != null) 2457 { 2458 result = t_PreparedStatement.getMoreResults(current); 2459 } 2460 2461 return result; 2462 } 2463 2464 /*** 2465 * See Statement#getGeneratedKeys() 2466 * @see java.sql.Statement#getGeneratedKeys() 2467 * @return (Taken from Sun's Javadoc) a ResultSet object containing the 2468 * auto-generated key(s) generated by the execution of this Statement 2469 * object. 2470 * @exception SQLException if an error occurs. 2471 */ 2472 public abstract ResultSet getGeneratedKeys() 2473 throws SQLException; 2474 2475 /*** 2476 * See Statement#executeUpdate(String,int) 2477 * @see java.sql.Statement#executeUpdate(java.lang.String,int) 2478 * @param sql (Taken from Sun's Javadoc) must be an SQL INSERT, UPDATE 2479 * or DELETE statement or an SQL statement that returns nothing. 2480 * @param autogeneratedKeys (Taken from Sun's Javadoc) a flag indicating 2481 * whether auto-generated keys should be made available for retrieval; 2482 * one of the following constants: Statement.RETURN_GENERATED_KEYS 2483 * Statement.NO_GENERATED_KEYS. 2484 * @return (Taken from Sun's Javadoc) either the row count for INSERT, 2485 * UPDATE or DELETE statements, or 0 for SQL statements that return 2486 * nothing. 2487 * @exception SQLException if an error occurs. 2488 */ 2489 public int executeUpdate(String sql, int autogeneratedKeys) 2490 throws SQLException 2491 { 2492 int result = 0; 2493 2494 Statement t_Statement = getPreparedStatement(); 2495 2496 if (t_Statement != null) 2497 { 2498 result = t_Statement.executeUpdate(sql, autogeneratedKeys); 2499 } 2500 2501 return result; 2502 } 2503 2504 /*** 2505 * See Statement#executeUpdate(String,int[]) 2506 * @see java.sql.Statement#executeUpdate(java.lang.String,int[]) 2507 * @param sql (Taken from Sun's Javadoc) must be an SQL INSERT, UPDATE 2508 * or DELETE statement or an SQL statement that returns nothing. 2509 * @param columnIndexes (Taken from Sun's Javadoc) an array of column 2510 * indexes indicating the columns that should be returned from the 2511 * inserted row. 2512 * @return (Taken from Sun's Javadoc) either the row count for INSERT, 2513 * UPDATE or DELETE statements, or 0 for SQL statements that return 2514 * nothing. 2515 * @exception SQLException if an error occurs. 2516 */ 2517 public int executeUpdate(String sql, int[] columnIndexes) 2518 throws SQLException 2519 { 2520 int result = 0; 2521 2522 Statement t_Statement = getPreparedStatement(); 2523 2524 if (t_Statement != null) 2525 { 2526 result = t_Statement.executeUpdate(sql, columnIndexes); 2527 } 2528 2529 return result; 2530 } 2531 2532 /*** 2533 * See Statement#executeUpdate(String,String[]) 2534 * @see java.sql.Statement#executeUpdate(java.lang.String,String[]) 2535 * @param sql (Taken from Sun's Javadoc) must be an SQL INSERT, UPDATE 2536 * or DELETE statement or an SQL statement that returns nothing. 2537 * @param columnNames (Taken from Sun's Javadoc) an array of column 2538 * names indicating the columns that should be returned from the 2539 * inserted row. 2540 * @return (Taken from Sun's Javadoc) either the row count for INSERT, 2541 * UPDATE or DELETE statements, or 0 for SQL statements that return 2542 * nothing. 2543 * @exception SQLException if an error occurs. 2544 */ 2545 public int executeUpdate(String sql, String[] columnNames) 2546 throws SQLException 2547 { 2548 int result = 0; 2549 2550 Statement t_Statement = getPreparedStatement(); 2551 2552 if (t_Statement != null) 2553 { 2554 result = t_Statement.executeUpdate(sql, columnNames); 2555 } 2556 2557 return result; 2558 } 2559 2560 /*** 2561 * See Statement#execute(String,int) 2562 * @see java.sql.Statement#execute(java.lang.String,int) 2563 * @param sql (Taken from Sun's Javadoc) must be an SQL INSERT, UPDATE 2564 * or DELETE statement or an SQL statement that returns nothing. 2565 * @param autogeneratedKeys (Taken from Sun's Javadoc) a flag indicating 2566 * whether auto-generated keys should be made available for retrieval; 2567 * one of the following constants: Statement.RETURN_GENERATED_KEYS 2568 * Statement.NO_GENERATED_KEYS. 2569 * @return (Taken from Sun's Javadoc) true if the first result is a 2570 * ResultSet object; false if it is an update count or there are no 2571 * results. 2572 * @exception SQLException if an error occurs. 2573 */ 2574 public boolean execute(String sql, int autogeneratedKeys) 2575 throws SQLException 2576 { 2577 boolean result = false; 2578 2579 Statement t_Statement = getPreparedStatement(); 2580 2581 if (t_Statement != null) 2582 { 2583 result = t_Statement.execute(sql, autogeneratedKeys); 2584 } 2585 2586 return result; 2587 } 2588 2589 /*** 2590 * See Statement#execute(String,int[]) 2591 * @see java.sql.Statement#execute(java.lang.String,int[]) 2592 * @param sql (Taken from Sun's Javadoc) must be an SQL INSERT, UPDATE 2593 * or DELETE statement or an SQL statement that returns nothing. 2594 * @param columnIndexes (Taken from Sun's Javadoc) an array of column 2595 * indexes indicating the columns that should be returned from the 2596 * inserted row. 2597 * @return (Taken from Sun's Javadoc) true if the first result is a 2598 * ResultSet object; false if it is an update count or there are no 2599 * results. 2600 * @exception SQLException if an error occurs. 2601 */ 2602 public boolean execute(String sql, int[] columnIndexes) 2603 throws SQLException 2604 { 2605 boolean result = false; 2606 2607 Statement t_Statement = getPreparedStatement(); 2608 2609 if (t_Statement != null) 2610 { 2611 result = t_Statement.execute(sql, columnIndexes); 2612 } 2613 2614 return result; 2615 } 2616 2617 /*** 2618 * See Statement#execute(String,String[]) 2619 * @see java.sql.Statement#execute(java.lang.String,java.lang.String[]) 2620 * @param sql (Taken from Sun's Javadoc) must be an SQL INSERT, UPDATE 2621 * or DELETE statement or an SQL statement that returns nothing. 2622 * @param columnNames (Taken from Sun's Javadoc) an array of column 2623 * names indicating the columns that should be returned from the 2624 * inserted row. 2625 * @return (Taken from Sun's Javadoc) true if the first result is a 2626 * ResultSet object; false if it is an update count or there are no 2627 * results. 2628 * @exception SQLException if an error occurs. 2629 */ 2630 public boolean execute(String sql, String[] columnNames) 2631 throws SQLException 2632 { 2633 boolean result = false; 2634 2635 Statement t_Statement = getPreparedStatement(); 2636 2637 if (t_Statement != null) 2638 { 2639 result = t_Statement.execute(sql, columnNames); 2640 } 2641 2642 return result; 2643 } 2644 2645 /*** 2646 * See Statement#getResultSetHoldability() 2647 * @see java.sql.Statement#getResultSetHoldability() 2648 * @return (Taken from Sun's Javadoc) either 2649 * ResultSet.HOLD_CURSORS_OVER_COMMIT or 2650 * ResultSet.CLOSE_CURSORS_AT_COMMIT. 2651 * @exception SQLException if an error occurs. 2652 */ 2653 public int getResultSetHoldability() 2654 throws SQLException 2655 { 2656 int result = 0; 2657 2658 Statement t_Statement = getPreparedStatement(); 2659 2660 if (t_Statement != null) 2661 { 2662 result = t_Statement.getResultSetHoldability(); 2663 } 2664 2665 return result; 2666 } 2667 2668 // New from java.sql.PreparedStatement 1.4 // 2669 2670 /*** 2671 * See PreparedStatement#setURL(int,URL) 2672 * @see java.sql.PreparedStatement#setURL(int,java.net.URL) 2673 * @param parameterIndex (Taken from Sun's Javadoc) the first parameter 2674 * is 1, the second is 2, ... 2675 * @param url (Taken from Sun's Javadoc) the java.net.URL object to be set. 2676 * @exception SQLException if an error occurs. 2677 */ 2678 public void setURL(int parameterIndex, URL url) 2679 throws SQLException 2680 { 2681 PreparedStatement t_PreparedStatement = getPreparedStatement(); 2682 2683 if (t_PreparedStatement != null) 2684 { 2685 t_PreparedStatement.setURL(parameterIndex, url); 2686 } 2687 } 2688 2689 /*** 2690 * See PreparedStatement#getParameterMetaData() 2691 * @see java.sql.PreparedStatement#getParameterMetaData() 2692 * @return (Taken from Sun's Javadoc) a ParameterMetaData object that 2693 * contains information about the number, types and properties of this 2694 * PreparedStatement object's parameters. 2695 * @exception SQLException if an error occurs. 2696 */ 2697 public ParameterMetaData getParameterMetaData() 2698 throws SQLException 2699 { 2700 ParameterMetaData result = null; 2701 2702 PreparedStatement t_PreparedStatement = getPreparedStatement(); 2703 2704 if (t_PreparedStatement != null) 2705 { 2706 result = t_PreparedStatement.getParameterMetaData(); 2707 } 2708 2709 return result; 2710 } 2711 }

This page was automatically generated by Maven