1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 package javax.sql; 19 20 import java.io.InputStream; 21 import java.io.Reader; 22 import java.math.BigDecimal; 23 import java.net.URL; 24 import java.sql.Array; 25 import java.sql.Blob; 26 import java.sql.Clob; 27 import java.sql.Date; 28 import java.sql.NClob; 29 import java.sql.Ref; 30 import java.sql.ResultSet; 31 import java.sql.RowId; 32 import java.sql.SQLException; 33 import java.sql.SQLXML; 34 import java.sql.Time; 35 import java.sql.Timestamp; 36 import java.util.Calendar; 37 import java.util.Map; 38 39 /** 40 * An interface which provides means to access data which 41 * persists on a database. It extends the functionality of 42 * {@link java.sql.ResultSet ResultSet} into a form that it can be used as a 43 * JavaBean component, suited for a visual programming environment. 44 * <p> 45 * {@code RowSet} provides getters and setters for properties relating to the 46 * general database environment together with the getters and setters for 47 * distinct data values which constitute the row set. The {@code RowSet} class 48 * supports JavaBean events so that other components in an application can be 49 * informed when changes happen such as changes in data values. 50 * <p> 51 * {@code RowSet} is a facility implemented on top of the remainder of the JDBC 52 * API. It may be <i>connected</i>, maintaining a connection to the database 53 * throughout its lifecycle. The changes made on a <i>disconnected</i> {@code 54 * RowSet} on the other hand can be persisted only establishing a new connection 55 * with the database each time. 56 * <p> 57 * Disconnected {@code RowSets} make use of {@code RowSetReaders} to populate 58 * the {@code RowSet} with data, possibly from a non-relational database source. 59 * They may also use {@code RowSetWriters} to send data back to the underlying 60 * data store. There is considerable freedom in the way that {@code 61 * RowSetReaders} and {@code RowSetWriters} may be implemented to retrieve and 62 * store data. 63 * 64 * @see RowSetReader 65 * @see RowSetWriter 66 */ 67 public interface RowSet extends ResultSet { 68 69 /** 70 * Registers the supplied {@link RowSetListener} with this {@code RowSet}. 71 * Once registered, the {@link RowSetListener} is notified of events 72 * generated by the {@code RowSet}. 73 * 74 * @param theListener 75 * an object which implements the {@code rowSetListener} 76 * interface. 77 */ 78 public void addRowSetListener(RowSetListener theListener); 79 80 /** 81 * Clears the parameters previously set for this {@code RowSet}. 82 * <p> 83 * The {@code RowSet} object retains its value until either a new value for 84 * a parameter is set or its value is actively reset. {@code 85 * clearParameters} provides a facility to clear the values for all 86 * parameters with one method call. 87 * 88 * @throws SQLException 89 * if a problem occurs accessing the database. 90 */ 91 public void clearParameters() throws SQLException; 92 93 /** 94 * Fetches data for this {@code RowSet} from the database. If successful, 95 * any existing data for the {@code RowSet} is discarded and its metadata is 96 * overwritten. 97 * <p> 98 * Data is retrieved connecting to the database and executing an 99 * according SQL statement. This requires some or all of the following 100 * properties to be set: URL, database name, user name, password, 101 * transaction isolation, type map; plus some or all of the properties: 102 * command, read only, maximum field size, maximum rows, escape processing, 103 * and query timeout. 104 * <p> 105 * The {@code RowSet} may use a {@code RowSetReader} to access the database 106 * it will then invoke the {@link RowSetReader#readData} method on the 107 * reader to fetch the data. When the new data is fetched all the listeners 108 * are notified to take appropriate measures. 109 * 110 * @throws SQLException 111 * if a problem occurs accessing the database or if the 112 * properties needed to access the database have not been set. 113 * @see RowSetMetaData 114 * @see RowSetReader 115 */ 116 public void execute() throws SQLException; 117 118 /** 119 * Gets the {@code RowSet}'s command property. 120 * 121 * @return a string containing the {@code RowSet}'s command property. A 122 * command is a SQL statement which is executed to fetch required 123 * data into the {@code RowSet}. 124 */ 125 public String getCommand(); 126 127 /** 128 * Gets the ODBC Data Source Name property associated with this {@code 129 * RowSet}. The database name can be used to find a {@link DataSource} 130 * which has been registered with a naming service - the {@link DataSource} 131 * can then be used to create a connection to the database. 132 * 133 * @return the name of the database. 134 */ 135 public String getDataSourceName(); 136 137 /** 138 * Reports if escape processing is enabled for this {@code RowSet}. If 139 * escape processing is on, the driver performs a substitution of the escape 140 * syntax with the applicable code before sending an SQL command to the 141 * database. The default value for escape processing is {@code true}. 142 * 143 * @return {@code true} if escape processing is enabled, {@code 144 * false} otherwise. 145 * @throws SQLException 146 * if a problem occurs accessing the database. 147 */ 148 public boolean getEscapeProcessing() throws SQLException; 149 150 /** 151 * Gets the maximum number of bytes that can be returned for column values 152 * which are of type {@code BINARY}, {@code VARBINARY}, {@code 153 * LONGVARBINARYBINARY}, {@code CHAR}, {@code VARCHAR}, or {@code 154 * LONGVARCHAR}. Excess data is silently discarded if the number is 155 * exceeded. 156 * 157 * @return the current maximum size in bytes. 0 implies no size limit. 158 * @throws SQLException 159 * if a problem occurs accessing the database. 160 */ 161 public int getMaxFieldSize() throws SQLException; 162 163 /** 164 * Gets the maximum number of rows for this {@code RowSet}. Excess rows are 165 * discarded silently if the limit is exceeded. 166 * 167 * @return the previous maximum number of rows. 0 implies no row limit. 168 * @throws SQLException 169 * if a problem occurs accessing the database. 170 */ 171 public int getMaxRows() throws SQLException; 172 173 /** 174 * Gets the value of the password property for this {@code RowSet}. This 175 * property is used when a connection to the database is established. 176 * Therefore it should be set prior to invoking the {@link #execute} method. 177 * 178 * @return the value of the password property. 179 */ 180 public String getPassword(); 181 182 /** 183 * Gets the timeout for the driver when a query operation is executed. If a 184 * query takes longer than the timeout then a {@code SQLException} is 185 * thrown. 186 * 187 * @return the timeout value in seconds. 188 * @throws SQLException 189 * if an error occurs accessing the database. 190 */ 191 public int getQueryTimeout() throws SQLException; 192 193 /** 194 * Gets the transaction isolation level property set for this 195 * {@code RowSet}. The transaction isolation level defines the 196 * policy implemented on the database for maintaining the data 197 * values consistent. 198 * 199 * @return the current transaction isolation level. Must be one of: 200 * <ul> 201 * <li>{@code Connection.TRANSACTION_READ_UNCOMMITTED}</li> 202 * <li>{@code Connection.TRANSACTION_READ_COMMITTED}</li> 203 * <li>{@code Connection.TRANSACTION_REPEATABLE_READ}</li> 204 * <li>{@code Connection.TRANSACTION_SERIALIZABLE}</li> 205 * </ul> 206 * @see java.sql.Connection 207 */ 208 public int getTransactionIsolation(); 209 210 /** 211 * Gets the custom mapping of SQL User-Defined Types (UDTs) and Java classes 212 * for this {@code RowSet}, if applicable. 213 * 214 * @return the custom mappings of SQL types to Java classes. 215 * @throws SQLException 216 * if an error occurs accessing the database. 217 */ 218 public Map<String, Class<?>> getTypeMap() throws SQLException; 219 220 /** 221 * Gets the URL property value for this {@code RowSet}. If there is no 222 * {@code DataSource} object specified, the {@code RowSet} uses the URL to 223 * establish a connection to the database. The default value for the URL is 224 * {@code null}. 225 * 226 * @return a String holding the value of the URL property. 227 * @throws SQLException 228 * if an error occurs accessing the database. 229 */ 230 public String getUrl() throws SQLException; 231 232 /** 233 * Gets the value of the {@code username} property for this {@code RowSet}. 234 * The {@code username} is used when establishing a connection to the 235 * database and should be set before the {@code execute} method is invoked. 236 * 237 * @return a {@code String} holding the value of the {@code username} 238 * property. 239 */ 240 public String getUsername(); 241 242 /** 243 * Indicates if this {@code RowSet} is read-only. 244 * 245 * @return {@code true} if this {@code RowSet} is read-only, {@code false} 246 * if it is updatable. 247 */ 248 public boolean isReadOnly(); 249 250 /** 251 * Removes a specified {@link RowSetListener} object from the set of 252 * listeners which will be notified of events by this {@code RowSet}. 253 * 254 * @param theListener 255 * the {@link RowSetListener} to remove from the set of listeners 256 * for this {@code RowSet}. 257 */ 258 public void removeRowSetListener(RowSetListener theListener); 259 260 /** 261 * Sets the specified {@code ARRAY} parameter in the {@code RowSet} command 262 * with the supplied {@code java.sql.Array} value. 263 * 264 * @param parameterIndex 265 * the index of the parameter to set; the first parameter's index 266 * is 1. 267 * @param theArray 268 * the {@code Array} data value to which the parameter is set. 269 * @throws SQLException 270 * if an error occurs accessing the database. 271 */ 272 public void setArray(int parameterIndex, Array theArray) 273 throws SQLException; 274 275 /** 276 * Sets the value of the specified parameter in the {@code RowSet} command 277 * with the ASCII data in the supplied {@code java.io.InputStream} value. 278 * Data is read from the {@code InputStream} until end-of-file is reached. 279 * 280 * @param parameterIndex 281 * the index of the parameter to set; the first parameter's index 282 * is 1. 283 * @param theInputStream 284 * the ASCII data value to which the parameter is set. 285 * @param length 286 * the length of the data in bytes. 287 * @throws SQLException 288 * if an error occurs accessing the database. 289 */ 290 public void setAsciiStream(int parameterIndex, InputStream theInputStream, 291 int length) throws SQLException; 292 293 /** 294 * Sets the value of the specified parameter in the RowSet command with the 295 * ASCII data in the supplied java.io.InputStream value. Data is read from 296 * the InputStream until end-of-file is reached. 297 * 298 * @param parameterIndex 299 * index of the parameter to set, where the first parameter has 300 * index = 1. 301 * @param theInputStream 302 * an InputStream containing the ASCII data to set into the 303 * parameter value 304 * @throws SQLException 305 * if an error occurs accessing the database. 306 */ 307 308 public void setAsciiStream(int parameterIndex, InputStream theInputStream) 309 throws SQLException; 310 311 /** 312 * Sets the value of the specified parameter in the RowSet command with the 313 * ASCII data in the supplied java.io.InputStream value. Data is read from 314 * the InputStream until end-of-file is reached. 315 * 316 * @param parameterName 317 * the name for parameter 318 * @param theInputStream 319 * an InputStream containing the ASCII data to set into the 320 * parameter value 321 * @throws SQLException 322 * if an error occurs accessing the database. 323 */ 324 325 public void setAsciiStream(String parameterName, InputStream theInputStream) 326 throws SQLException; 327 328 /** 329 * Sets the value of the specified parameter in the RowSet command with the 330 * ASCII data in the supplied java.io.InputStream value. Data is read from 331 * the InputStream until end-of-file is reached. 332 * 333 * @param parameterName 334 * the name for parameter 335 * @param theInputStream 336 * an InputStream containing the ASCII data to set into the 337 * parameter value 338 * @param length 339 * the length of the data in bytes 340 * @throws SQLException 341 * if an error occurs accessing the database. 342 */ 343 public void setAsciiStream(String parameterName, 344 InputStream theInputStream, int length) throws SQLException; 345 346 /** 347 * Sets the value of the specified SQL {@code NUMERIC} parameter in the 348 * {@code RowSet} command with the data in the supplied {@code 349 * java.math.BigDecimal} value. 350 * 351 * @param parameterIndex 352 * the index of the parameter to set; the first parameter's index 353 * is 1. 354 * @param theBigDecimal 355 * the big decimal value to which the parameter is set. 356 * @throws SQLException 357 * if an error occurs accessing the database. 358 */ 359 public void setBigDecimal(int parameterIndex, BigDecimal theBigDecimal) 360 throws SQLException; 361 362 /** 363 * Sets the value of the specified SQL NUMERIC parameter in the RowSet 364 * command with the data in the supplied java.math.BigDecimal value. 365 * 366 * @param parameterName 367 * the name for parameter 368 * @param theBigDecimal 369 * the BigDecimal containing the value 370 * @throws SQLException 371 * if an error occurs accessing the database. 372 */ 373 public void setBigDecimal(String parameterName, BigDecimal theBigDecimal) 374 throws SQLException; 375 376 /** 377 * Sets the value of the specified parameter in the {@code RowSet} command 378 * to the binary data in the supplied input stream. Data is read from the 379 * input stream until end-of-file is reached. 380 * 381 * @param parameterIndex 382 * the index of the parameter to set; the first parameter's index 383 * is 1. 384 * @param theInputStream 385 * the binary data stream to which the parameter is set. 386 * @param length 387 * the length of the data in bytes. 388 * @throws SQLException 389 * if an error occurs accessing the database. 390 */ 391 public void setBinaryStream(int parameterIndex, InputStream theInputStream, 392 int length) throws SQLException; 393 394 /** 395 * Sets the value of the specified parameter in the RowSet command with the 396 * binary data in the supplied java.io.InputStream value. Data is read from 397 * the InputStream until end-of-file is reached. 398 * 399 * @param parameterIndex 400 * index of the parameter to set, where the first parameter has 401 * index = 1. 402 * @param theInputStream 403 * an InputStream containing the binary data to set into the 404 * parameter value 405 * @throws SQLException 406 * if an error occurs accessing the database. 407 */ 408 public void setBinaryStream(int parameterIndex, InputStream theInputStream) 409 throws SQLException; 410 411 /** 412 * Sets the value of the specified parameter in the RowSet command with the 413 * binary data in the supplied java.io.InputStream value. Data is read from 414 * the InputStream until end-of-file is reached. 415 * 416 * @param parameterName 417 * the name for parameter 418 * @param theInputStream 419 * an InputStream containing the binary data to set into the 420 * parameter value 421 * @throws SQLException 422 * if an error occurs accessing the database. 423 */ 424 public void setBinaryStream(String parameterName, InputStream theInputStream) 425 throws SQLException; 426 427 /** 428 * Sets the value of the specified parameter in the RowSet command with the 429 * binary data in the supplied java.io.InputStream value. Data is read from 430 * the InputStream until end-of-file is reached. 431 * 432 * @param parameterName 433 * the name for parameter 434 * @param theInputStream 435 * an InputStream containing the binary data to set into the 436 * parameter value 437 * @param length 438 * the length of the data in bytes 439 * @throws SQLException 440 * if an error occurs accessing the database. 441 */ 442 public void setBinaryStream(String parameterName, 443 InputStream theInputStream, int length) throws SQLException; 444 445 /** 446 * Sets the value of the specified parameter in the {@code RowSet} command 447 * to the supplied {@code Blob} value. 448 * 449 * @param parameterIndex 450 * the index of the parameter to set; the first parameter's index 451 * is 1. 452 * @param theBlob 453 * the {@code Blob} value to which the parameter is set. 454 * @throws SQLException 455 * if an error occurs accessing the database. 456 */ 457 public void setBlob(int parameterIndex, Blob theBlob) throws SQLException; 458 459 /** 460 * Sets the value of the specified parameter in the RowSet command with the 461 * value of a supplied java.io.InputStream. Data is read from the 462 * InputStream until end-of-file is reached. 463 * 464 * @param parameterIndex 465 * index of the parameter to set, where the first parameter has 466 * index = 1. 467 * @param theInputStream 468 * an InputStream containing the binary data to set into the 469 * parameter value 470 * @throws SQLException 471 * if an error occurs accessing the database. 472 */ 473 public void setBlob(int parameterIndex, InputStream theInputStream) 474 throws SQLException; 475 476 /** 477 * Sets the value of the specified parameter in the RowSet command with the 478 * value of a supplied java.io.InputStream. Data is read from the 479 * InputStream until end-of-file is reached. 480 * 481 * @param parameterIndex 482 * index of the parameter to set, where the first parameter has 483 * index = 1. 484 * @param theInputStream 485 * an InputStream containing the binary data to set into the 486 * parameter value 487 * @param length 488 * the length of the data in bytes 489 * @throws SQLException 490 * if an error occurs accessing the database. 491 */ 492 public void setBlob(int parameterIndex, InputStream theInputStream, 493 long length) throws SQLException; 494 495 /** 496 * Sets the value of the specified parameter in the RowSet command with the 497 * value of a supplied java.io.InputStream. Data is read from the 498 * InputStream until end-of-file is reached. 499 * 500 * @param parameterName 501 * the name for parameter 502 * @param theInputStream 503 * an InputStream containing the binary data to set into the 504 * parameter value 505 * @throws SQLException 506 * if an error occurs accessing the database. 507 */ 508 public void setBlob(String parameterName, InputStream theInputStream) 509 throws SQLException; 510 511 /** 512 * Sets the value of the specified parameter in the RowSet command with the 513 * value of a supplied java.io.InputStream. Data is read from the 514 * InputStream until end-of-file is reached. 515 * 516 * @param parameterName 517 * the name for parameter 518 * @param theInputStream 519 * an InputStream containing the binary data to set into the 520 * parameter value 521 * @param length 522 * the length of the data in bytes 523 * @throws SQLException 524 * if an error occurs accessing the database. 525 */ 526 public void setBlob(String parameterName, InputStream theInputStream, 527 long length) throws SQLException; 528 529 /** 530 * Sets the value of the specified parameter in the RowSet command with the 531 * value of a supplied java.sql.Blob. 532 * 533 * @param parameterName 534 * the name for parameter 535 * @param theBlob 536 * the Blob value to set 537 * @throws SQLException 538 * if an error occurs accessing the database. 539 */ 540 public void setBlob(String parameterName, Blob theBlob) throws SQLException; 541 542 /** 543 * Sets the value of the specified parameter in the {@code RowSet} command 544 * to the supplied boolean. 545 * 546 * @param parameterIndex 547 * the index of the parameter to set; the first parameter's index 548 * is 1. 549 * @param theBoolean 550 * the {@code boolean} value to which the parameter is set. 551 * @throws SQLException 552 * if an error occurs accessing the database. 553 */ 554 public void setBoolean(int parameterIndex, boolean theBoolean) 555 throws SQLException; 556 557 /** 558 * Sets the value of the specified parameter in the RowSet command to the 559 * supplied boolean. 560 * 561 * @param parameterName 562 * name for parameter 563 * @param theBoolean 564 * the boolean value to set 565 * @throws SQLException 566 * if an error occurs accessing the database. 567 */ 568 public void setBoolean(String parameterName, boolean theBoolean) 569 throws SQLException; 570 571 /** 572 * Sets the value of the specified parameter in the {@code RowSet} command 573 * to the supplied byte value. 574 * 575 * @param parameterIndex 576 * the index of the parameter to set; the first parameter's index 577 * is 1. 578 * @param theByte 579 * the {@code byte} value to which the parameter is set. 580 * @throws SQLException 581 * if an error occurs accessing the database. 582 */ 583 public void setByte(int parameterIndex, byte theByte) throws SQLException; 584 585 /** 586 * Sets the value of the specified parameter in the RowSet command to the 587 * supplied byte value. 588 * 589 * @param parameterName 590 * name for parameter 591 * @param theByte 592 * the byte value to set 593 * @throws SQLException 594 * if an error occurs accessing the database. 595 */ 596 public void setByte(String parameterName, byte theByte) throws SQLException; 597 598 /** 599 * Sets the value of the specified parameter in the {@code RowSet} command 600 * to the supplied byte array value. 601 * 602 * @param parameterIndex 603 * the index of the parameter to set; the first parameter's index 604 * is 1. 605 * @param theByteArray 606 * the {@code Array} of {@code bytes} to which the parameter is set. 607 * @throws SQLException 608 * if an error occurs accessing the database. 609 */ 610 public void setBytes(int parameterIndex, byte[] theByteArray) 611 throws SQLException; 612 613 /** 614 * Sets the value of the specified parameter in the RowSet command to the 615 * supplied byte array value. 616 * 617 * @param parameterName 618 * name for parameter 619 * @param theByteArray 620 * the array of bytes to set into the parameter. 621 * @throws SQLException 622 * if an error occurs accessing the database. 623 */ 624 public void setBytes(String parameterName, byte[] theByteArray) 625 throws SQLException; 626 627 /** 628 * Sets the value of the specified parameter in the {@code RowSet} command 629 * to the sequence of Unicode characters carried by the supplied {@code 630 * java.io.Reader}. 631 * 632 * @param parameterIndex 633 * the index of the parameter to set; the first parameter's index 634 * is 1. 635 * @param theReader 636 * the {@code Reader} which contains the Unicode data to set the 637 * parameter. 638 * @param length 639 * the length of the data in the {@code Reader} in characters. 640 * @throws SQLException 641 * if an error occurs accessing the database. 642 */ 643 public void setCharacterStream(int parameterIndex, Reader theReader, 644 int length) throws SQLException; 645 646 /** 647 * Sets the value of the specified parameter in the RowSet command to the 648 * sequence of Unicode characters carried by the supplied java.io.Reader. 649 * 650 * @param parameterIndex 651 * index of the parameter to set, where the first parameter has 652 * index = 1. 653 * @param theReader 654 * the Reader which contains the Unicode data to set into the 655 * parameter 656 * @throws SQLException 657 * if an error occurs accessing the database. 658 */ 659 public void setCharacterStream(int parameterIndex, Reader theReader) 660 throws SQLException; 661 662 /** 663 * Sets the value of the specified parameter in the RowSet command to the 664 * sequence of Unicode characters carried by the supplied java.io.Reader. 665 * 666 * @param parameterName 667 * name for parameter 668 * @param theReader 669 * the Reader which contains the Unicode data to set into the 670 * parameter 671 * @throws SQLException 672 * if an error occurs accessing the database. 673 */ 674 public void setCharacterStream(String parameterName, Reader theReader) 675 throws SQLException; 676 677 /** 678 * Sets the value of the specified parameter in the RowSet command to the 679 * sequence of Unicode characters carried by the supplied java.io.Reader. 680 * 681 * @param parameterName 682 * name for parameter 683 * @param theReader 684 * the Reader which contains the Unicode data to set into the 685 * parameter 686 * @param length 687 * the length of the data in the Reader in characters 688 * @throws SQLException 689 * if an error occurs accessing the database. 690 */ 691 public void setCharacterStream(String parameterName, Reader theReader, 692 int length) throws SQLException; 693 694 /** 695 * Sets the value of the specified parameter in the {@code RowSet} command 696 * with the value of a supplied {@code java.sql.Clob}. 697 * 698 * @param parameterIndex 699 * the index of the parameter to set; the first parameter's index 700 * is 1. 701 * @param theClob 702 * the {@code Clob} value to which the parameter is set. 703 * @throws SQLException 704 * if an error occurs accessing the database. 705 */ 706 public void setClob(int parameterIndex, Clob theClob) throws SQLException; 707 708 /** 709 * Sets the value of the specified parameter in the RowSet command with the 710 * value of a supplied java.io.Reader. 711 * 712 * @param parameterIndex 713 * index of the parameter to set, where the first parameter has 714 * index = 1. 715 * @param theReader 716 * the Reader which contains the Unicode data to set into the 717 * parameter 718 * @throws SQLException 719 * if an error occurs accessing the database. 720 */ 721 public void setClob(int parameterIndex, Reader theReader) 722 throws SQLException; 723 724 /** 725 * Sets the value of the specified parameter in the RowSet command with the 726 * value of a supplied java.io.Reader. 727 * 728 * @param parameterIndex 729 * index of the parameter to set, where the first parameter has 730 * index = 1. 731 * @param theReader 732 * the Reader which contains the Unicode data to set into the 733 * parameter 734 * @param length 735 * the length of the data in the Reader in characters 736 * @throws SQLException 737 * if an error occurs accessing the database. 738 */ 739 public void setClob(int parameterIndex, Reader theReader, long length) 740 throws SQLException; 741 742 /** 743 * Sets the value of the specified parameter in the RowSet command with the 744 * value of a supplied java.sql.Clob. 745 * 746 * @param parameterName 747 * name for parameter 748 * @param theClob 749 * the specific Clob object 750 * @throws SQLException 751 * if an error occurs accessing the database. 752 */ 753 public void setClob(String parameterName, Clob theClob) throws SQLException; 754 755 /** 756 * Sets the value of the specified parameter in the RowSet command with the 757 * value of a supplied java.io.Reader. 758 * 759 * @param parameterName 760 * name for parameter 761 * @param theReader 762 * the Reader which contains the Unicode data to set into the 763 * parameter 764 * @throws SQLException 765 * if an error occurs accessing the database. 766 */ 767 public void setClob(String parameterName, Reader theReader) 768 throws SQLException; 769 770 /** 771 * Sets the value of the specified parameter in the RowSet command with the 772 * value of a supplied java.io.Reader. 773 * 774 * @param parameterName 775 * name for parameter 776 * @param theReader 777 * the Reader which contains the Unicode data to set into the 778 * parameter 779 * @param length 780 * the length of the data in the Reader in characters 781 * @throws SQLException 782 * if an error occurs accessing the database. 783 */ 784 public void setClob(String parameterName, Reader theReader, long length) 785 throws SQLException; 786 787 /** 788 * Sets the Command property for this {@code RowSet} - the command is an SQL 789 * query which runs when the {@code execute} method is invoked. This 790 * property is optional for databases that do not support commands. 791 * 792 * @param cmd 793 * the SQL query. Can be {@code null}. 794 * @throws SQLException 795 * if an error occurs accessing the database. 796 */ 797 public void setCommand(String cmd) throws SQLException; 798 799 /** 800 * Sets the concurrency property of this {@code RowSet}. The default value 801 * is {@code ResultSet.CONCUR_READ_ONLY}. 802 * 803 * @param concurrency 804 * the concurrency value. One of: 805 * <ul> 806 * <li>{@code ResultSet.CONCUR_READ_ONLY}</li> 807 * <li>{@code ResultSet.CONCUR_UPDATABLE}</li> 808 * </ul> 809 * @throws SQLException 810 * if an error occurs accessing the database. 811 * @see java.sql.ResultSet 812 */ 813 public void setConcurrency(int concurrency) throws SQLException; 814 815 /** 816 * Sets the database name property for the {@code RowSet}. 817 * <p> 818 * The database name can be used to find a {@link DataSource} which has been 819 * registered with a naming service - the {@link DataSource} can then be 820 * used to create a connection to the database. 821 * 822 * @param name 823 * the database name. 824 * @throws SQLException 825 * if an error occurs accessing the database. 826 */ 827 public void setDataSourceName(String name) throws SQLException; 828 829 /** 830 * Sets the value of the specified parameter in the {@code RowSet} command 831 * with the value of a supplied {@code java.sql.Date}. 832 * 833 * @param parameterIndex 834 * the index of the parameter to set; the first parameter's index 835 * is 1. 836 * @param theDate 837 * the date value to which the parameter is set. 838 * @throws SQLException 839 * if an error occurs accessing the database. 840 */ 841 public void setDate(int parameterIndex, Date theDate) throws SQLException; 842 843 /** 844 * Sets the value of the specified parameter in the {@code RowSet} command 845 * with the value of a supplied {@code java.sql.Date}, where the conversion 846 * of the date to an SQL {@code DATE} value is calculated using a supplied 847 * {@code Calendar}. 848 * 849 * @param parameterIndex 850 * the index of the parameter to set; the first parameter's index 851 * is 1. 852 * @param theDate 853 * the date to which the parameter is set. 854 * @param theCalendar 855 * the {@code Calendar} to use in converting the Date to an SQL 856 * {@code DATE} value. 857 * @throws SQLException 858 * if an error occurs accessing the database. 859 */ 860 public void setDate(int parameterIndex, Date theDate, Calendar theCalendar) 861 throws SQLException; 862 863 /** 864 * Sets the value of the specified parameter in the RowSet command with the 865 * value of a supplied java.sql.Date, where the conversion of the Date to an 866 * SQL DATE value is calculated using a supplied Calendar. 867 * 868 * @param parameterName 869 * name for parameter 870 * @param theDate 871 * the Date to use 872 * @throws SQLException 873 * if an error occurs accessing the database. 874 */ 875 public void setDate(String parameterName, Date theDate) throws SQLException; 876 877 /** 878 * Sets the value of the specified parameter in the RowSet command with the 879 * value of a supplied java.sql.Date, where the conversion of the Date to an 880 * SQL DATE value is calculated using a supplied Calendar. 881 * 882 * @param parameterName 883 * name for parameter 884 * @param theDate 885 * the Date to use 886 * @param theCalendar 887 * the Calendar to use in converting the Date to an SQL DATE 888 * value 889 * @throws SQLException 890 * if an error occurs accessing the database. 891 */ 892 public void setDate(String parameterName, Date theDate, Calendar theCalendar) 893 throws SQLException; 894 895 /** 896 * Sets the value of the specified parameter in the {@code RowSet} command 897 * with the supplied {@code double}. 898 * 899 * @param parameterIndex 900 * the index of the parameter to set; the first parameter's index 901 * is 1. 902 * @param theDouble 903 * the {@code double} value to which the parameter is set. 904 * @throws SQLException 905 * if an error occurs accessing the database. 906 */ 907 public void setDouble(int parameterIndex, double theDouble) 908 throws SQLException; 909 910 /** 911 * Sets the value of the specified parameter in the RowSet command with the 912 * supplied double. 913 * 914 * @param parameterName 915 * name for parameter 916 * @param theDouble 917 * the double value to set 918 * @throws SQLException 919 * if an error occurs accessing the database. 920 */ 921 public void setDouble(String parameterName, double theDouble) 922 throws SQLException; 923 924 /** 925 * Sets the escape processing status for this {@code RowSet}. If escape 926 * processing is on, the driver performs a substitution of the escape syntax 927 * with the applicable code before sending an SQL command to the database. 928 * The default value for escape processing is {@code true}. 929 * 930 * @param enable 931 * {@code true} to enable escape processing, {@code false} to 932 * turn it off. 933 * @throws SQLException 934 * if an error occurs accessing the database. 935 */ 936 public void setEscapeProcessing(boolean enable) throws SQLException; 937 938 /** 939 * Sets the value of the specified parameter in the {@code RowSet} command 940 * with the supplied {@code float}. 941 * 942 * @param parameterIndex 943 * the index of the parameter to set; the first parameter's index 944 * is 1. 945 * @param theFloat 946 * the {@code float} value to which the parameter is set. 947 * @throws SQLException 948 * if an error occurs accessing the database. 949 */ 950 public void setFloat(int parameterIndex, float theFloat) 951 throws SQLException; 952 953 /** 954 * Sets the value of the specified parameter in the RowSet command with the 955 * supplied float. 956 * 957 * @param parameterName 958 * name for parameter 959 * @param theFloat 960 * the float value to set 961 * @throws SQLException 962 * if an error occurs accessing the database. 963 */ 964 public void setFloat(String parameterName, float theFloat) 965 throws SQLException; 966 967 /** 968 * Sets the value of the specified parameter in the {@code RowSet} command 969 * with the supplied {@code integer}. 970 * 971 * @param parameterIndex 972 * the index of the parameter to set; the first parameter's index 973 * is 1. 974 * @param theInteger 975 * the {@code integer} value to which the parameter is set. 976 * @throws SQLException 977 * if an error occurs accessing the database. 978 */ 979 public void setInt(int parameterIndex, int theInteger) throws SQLException; 980 981 /** 982 * Sets the value of the specified parameter in the RowSet command with the 983 * supplied integer. 984 * 985 * @param parameterName 986 * name for parameter 987 * @param theInteger 988 * the integer value to set 989 * @throws SQLException 990 * if an error occurs accessing the database. 991 */ 992 public void setInt(String parameterName, int theInteger) 993 throws SQLException; 994 995 /** 996 * Sets the value of the specified parameter in the {@code RowSet} command 997 * with the supplied {@code long}. 998 * 999 * @param parameterIndex 1000 * the index of the parameter to set; the first parameter's index 1001 * is 1. 1002 * @param theLong 1003 * the {@code long} value value to which the parameter is set. 1004 * @throws SQLException 1005 * if an error occurs accessing the database. 1006 */ 1007 public void setLong(int parameterIndex, long theLong) throws SQLException; 1008 1009 /** 1010 * Sets the value of the specified parameter in the RowSet command with the 1011 * supplied long. 1012 * 1013 * @param parameterName 1014 * name for parameter 1015 * @param theLong 1016 * the long value to set 1017 * @throws SQLException 1018 * if an error occurs accessing the database. 1019 */ 1020 public void setLong(String parameterName, long theLong) throws SQLException; 1021 1022 /** 1023 * Sets the maximum number of bytes which can be returned for a column value 1024 * where the column type is one of {@code BINARY}, {@code VARBINARY}, 1025 * {@code LONGVARBINARYBINARY}, {@code CHAR}, {@code VARCHAR}, or {@code 1026 * LONGVARCHAR}. Data which exceeds this limit is silently discarded. For 1027 * portability, a value greater than 256 is recommended. 1028 * 1029 * @param max 1030 * the maximum size of the returned column value in bytes. 0 1031 * implies no size limit. 1032 * @throws SQLException 1033 * if an error occurs accessing the database. 1034 */ 1035 public void setMaxFieldSize(int max) throws SQLException; 1036 1037 /** 1038 * Sets the maximum number of rows which can be held by the {@code RowSet}. 1039 * Any additional rows are silently discarded. 1040 * 1041 * @param max 1042 * the maximum number of rows which can be held in the {@code 1043 * RowSet}. 0 means no limit. 1044 * @throws SQLException 1045 * if an error occurs accessing the database. 1046 */ 1047 public void setMaxRows(int max) throws SQLException; 1048 1049 /** 1050 * Sets the value of the specified parameter in the RowSet command with the 1051 * value of a supplied java.io.Reader. 1052 * 1053 * @param parameterIndex 1054 * index of the parameter to set, where the first parameter has 1055 * index = 1. 1056 * @param theReader 1057 * the Reader which contains the Unicode data to set into the 1058 * parameter 1059 * @throws SQLException 1060 * if an error occurs accessing the database. 1061 */ 1062 public void setNCharacterStream(int parameterIndex, Reader theReader) 1063 throws SQLException; 1064 1065 /** 1066 * Sets the value of the specified parameter in the RowSet command with the 1067 * value of a supplied java.io.Reader. 1068 * 1069 * @param parameterIndex 1070 * index of the parameter to set, where the first parameter has 1071 * index = 1. 1072 * @param theReader 1073 * the Reader which contains the Unicode data to set into the 1074 * parameter 1075 * @param length 1076 * the length of the data in the Reader in characters 1077 * @throws SQLException 1078 * if an error occurs accessing the database. 1079 */ 1080 public void setNCharacterStream(int parameterIndex, Reader theReader, 1081 long length) throws SQLException; 1082 1083 /** 1084 * Sets the value of the specified parameter in the RowSet command with the 1085 * value of a supplied java.io.Reader. 1086 * 1087 * @param parameterName 1088 * name for parameter 1089 * @param theReader 1090 * the Reader which contains the Unicode data to set into the 1091 * parameter 1092 * @throws SQLException 1093 * if an error occurs accessing the database. 1094 */ 1095 public void setNCharacterStream(String parameterName, Reader theReader) 1096 throws SQLException; 1097 1098 /** 1099 * Sets the value of the specified parameter in the RowSet command with the 1100 * value of a supplied java.io.Reader. 1101 * 1102 * @param parameterName 1103 * name for parameter 1104 * @param theReader 1105 * the Reader which contains the Unicode data to set into the 1106 * parameter 1107 * @param length 1108 * the length of the data in the Reader in characters 1109 * @throws SQLException 1110 * if an error occurs accessing the database. 1111 */ 1112 public void setNCharacterStream(String parameterName, Reader theReader, 1113 long length) throws SQLException; 1114 1115 /** 1116 * Sets the value of the specified parameter in the RowSet command with the 1117 * value of a supplied java.sql.NClob. 1118 * 1119 * @param parameterIndex 1120 * index of the parameter to set, where the first parameter has 1121 * index = 1. 1122 * @param theNClob 1123 * the NClob value to set 1124 * @throws SQLException 1125 * if an error occurs accessing the database. 1126 */ 1127 public void setNClob(int parameterIndex, NClob theNClob) 1128 throws SQLException; 1129 1130 /** 1131 * Sets the value of the specified parameter in the RowSet command with the 1132 * value of a supplied java.io.Reader. 1133 * 1134 * @param parameterIndex 1135 * index of the parameter to set, where the first parameter has 1136 * index = 1. 1137 * @param theReader 1138 * the Reader which contains the Unicode data to set into the 1139 * parameter 1140 * @throws SQLException 1141 * if an error occurs accessing the database. 1142 */ 1143 public void setNClob(int parameterIndex, Reader theReader) 1144 throws SQLException; 1145 1146 /** 1147 * Sets the value of the specified parameter in the RowSet command with the 1148 * value of a supplied java.io.Reader. 1149 * 1150 * @param parameterIndex 1151 * index of the parameter to set, where the first parameter has 1152 * index = 1. 1153 * @param theReader 1154 * the Reader which contains the Unicode data to set into the 1155 * parameter 1156 * @param length 1157 * the length of the data in the Reader in characters 1158 * @throws SQLException 1159 * if an error occurs accessing the database. 1160 */ 1161 public void setNClob(int parameterIndex, Reader theReader, long length) 1162 throws SQLException; 1163 1164 /** 1165 * Sets the value of the specified parameter in the RowSet command with the 1166 * value of a supplied java.sql.NClob. 1167 * 1168 * @param parameterName 1169 * name for parameter 1170 * @param theNClob 1171 * the NClob value to set 1172 * @throws SQLException 1173 * if an error occurs accessing the database. 1174 */ 1175 public void setNClob(String parameterName, NClob theNClob) 1176 throws SQLException; 1177 1178 /** 1179 * Sets the value of the specified parameter in the RowSet command with the 1180 * value of a supplied java.io.Reader. 1181 * 1182 * @param parameterName 1183 * name for parameter 1184 * @param theReader 1185 * the Reader which contains the Unicode data to set into the 1186 * parameter 1187 * @throws SQLException 1188 * if an error occurs accessing the database. 1189 */ 1190 public void setNClob(String parameterName, Reader theReader) 1191 throws SQLException; 1192 1193 /** 1194 * Sets the value of the specified parameter in the RowSet command with the 1195 * value of a supplied java.io.Reader. 1196 * 1197 * @param parameterName 1198 * name for parameter 1199 * @param theReader 1200 * the Reader which contains the Unicode data to set into the 1201 * parameter 1202 * @param length 1203 * the length of the data in the Reader in characters 1204 * @throws SQLException 1205 * if an error occurs accessing the database. 1206 */ 1207 public void setNClob(String parameterName, Reader theReader, long length) 1208 throws SQLException; 1209 1210 /** 1211 * Sets the value of the specified parameter in the RowSet command to the 1212 * supplied NString 1213 * 1214 * @param parameterIndex 1215 * index of the parameter to set, where the first parameter has 1216 * index = 1. 1217 * @param theNString 1218 * the NString value to set 1219 * @throws SQLException 1220 * if an error occurs accessing the database. 1221 */ 1222 public void setNString(int parameterIndex, String theNString) 1223 throws SQLException; 1224 1225 /** 1226 * Sets the value of the specified parameter in the RowSet command to the 1227 * supplied NString. 1228 * 1229 * @param parameterName 1230 * name for parameter 1231 * @param theNString 1232 * the NString value to set 1233 * @throws SQLException 1234 * if an error occurs accessing the database. 1235 */ 1236 public void setNString(String parameterName, String theNString) 1237 throws SQLException; 1238 1239 /** 1240 * Sets the value of the specified parameter in the {@code RowSet} command 1241 * to SQL {@code NULL}. 1242 * 1243 * @param parameterIndex 1244 * the index of the parameter to set; the first parameter's index 1245 * is 1. 1246 * @param sqlType 1247 * the type of the parameter, as defined by {@code 1248 * java.sql.Types}. 1249 * @throws SQLException 1250 * if an error occurs accessing the database. 1251 */ 1252 public void setNull(int parameterIndex, int sqlType) throws SQLException; 1253 1254 /** 1255 * Sets the value of the specified parameter in the {@code RowSet} command 1256 * to SQL {@code NULL}. This form of the {@code setNull} method should be 1257 * used for User Defined Types and {@code REF} parameters. 1258 * 1259 * @param parameterIndex 1260 * the index of the parameter to set; the first parameter's index 1261 * is 1. 1262 * @param sqlType 1263 * the type of the parameter, as defined by {@code 1264 * java.sql.Types}. 1265 * @param typeName 1266 * the fully qualified name of an SQL user defined type or the 1267 * name of the SQL structured type referenced by a {@code REF} 1268 * type. Ignored if the sqlType is not a UDT or REF type. 1269 * @throws SQLException 1270 * if an error occurs accessing the database. 1271 */ 1272 public void setNull(int parameterIndex, int sqlType, String typeName) 1273 throws SQLException; 1274 1275 /** 1276 * Sets the value of the specified parameter in the RowSet command to SQL 1277 * NULL. This form of the <code>setNull</code> method should be used for 1278 * User Defined Types and REF parameters. 1279 * 1280 * @param parameterName 1281 * name for parameter 1282 * @param sqlType 1283 * the type of the parameter, as defined by java.sql.Types. 1284 * @throws SQLException 1285 * if an error occurs accessing the database. 1286 */ 1287 public void setNull(String parameterName, int sqlType) throws SQLException; 1288 1289 /** 1290 * Sets the value of the specified parameter in the RowSet command to SQL 1291 * NULL. This form of the <code>setNull</code> method should be used for 1292 * User Defined Types and REF parameters. 1293 * 1294 * @param parameterName 1295 * name for parameter 1296 * @param sqlType 1297 * the type of the parameter, as defined by java.sql.Types. 1298 * @param typeName 1299 * the fully qualified name of an SQL User Defined Type or the 1300 * name of the SQL structured type referenced by a REF type. 1301 * Ignored if the sqlType is not a UDT or REF type. 1302 * @throws SQLException 1303 * if an error occurs accessing the database. 1304 */ 1305 public void setNull(String parameterName, int sqlType, String typeName) 1306 throws SQLException; 1307 1308 /** 1309 * Sets the value of the specified parameter in the {@code RowSet} command 1310 * to a supplied Java object. 1311 * <p> 1312 * The JDBC specification provides a standard mapping for Java objects to 1313 * SQL data types. Database specific types can be mapped by JDBC driver 1314 * specific Java types. 1315 * 1316 * @param parameterIndex 1317 * the index of the parameter to set; the first parameter's index 1318 * is 1. 1319 * @param theObject 1320 * the Java object containing the data value to which the 1321 * parameter is set. 1322 * @throws SQLException 1323 * if an error occurs accessing the database. 1324 */ 1325 public void setObject(int parameterIndex, Object theObject) 1326 throws SQLException; 1327 1328 /** 1329 * Sets the value of the specified parameter in the {@code RowSet} command 1330 * to a supplied Java object. 1331 * 1332 * @param parameterIndex 1333 * the index of the parameter to set; the first parameter's index 1334 * is 1. 1335 * @param theObject 1336 * the Java object containing the data value. 1337 * @param targetSqlType 1338 * the SQL type to send to the database, as defined in {@code 1339 * java.sql.Types}. 1340 * @throws SQLException 1341 * if an error occurs accessing the database. 1342 */ 1343 public void setObject(int parameterIndex, Object theObject, 1344 int targetSqlType) throws SQLException; 1345 1346 /** 1347 * Sets the value of the specified parameter in the {@code RowSet} command 1348 * to a supplied Java object. 1349 * 1350 * @param parameterIndex 1351 * the index of the parameter to set; the first parameter's index 1352 * is 1. 1353 * @param theObject 1354 * the Java object containing the data value. 1355 * @param targetSqlType 1356 * the SQL type to send to the database, as defined in {@code 1357 * java.sql.Types}. 1358 * @param scale 1359 * the number of digits after the decimal point, for {@code 1360 * java.sql.Types.DECIMAL} and {@code java.sql.Types.NUMERIC} 1361 * types. Ignored for all other types. 1362 * @throws SQLException 1363 * if an error occurs accessing the database. 1364 */ 1365 public void setObject(int parameterIndex, Object theObject, 1366 int targetSqlType, int scale) throws SQLException; 1367 1368 /** 1369 * Sets the value of the specified parameter in the RowSet command to a 1370 * supplied Java object. 1371 * 1372 * @param parameterName 1373 * name for parameter 1374 * @param theObject 1375 * the Java object containing the data value. 1376 * @throws SQLException 1377 * if an error occurs accessing the database. 1378 */ 1379 public void setObject(String parameterName, Object theObject) 1380 throws SQLException; 1381 1382 /** 1383 * Sets the value of the specified parameter in the RowSet command to a 1384 * supplied Java object. 1385 * 1386 * @param parameterName 1387 * name for parameter 1388 * @param theObject 1389 * the Java object containing the data value. 1390 * @param targetSqlType 1391 * the SQL type to send to the database, as defined in 1392 * java.sql.Types. 1393 * @throws SQLException 1394 * if an error occurs accessing the database. 1395 */ 1396 public void setObject(String parameterName, Object theObject, 1397 int targetSqlType) throws SQLException; 1398 1399 /** 1400 * Sets the value of the specified parameter in the RowSet command to a 1401 * supplied Java object. 1402 * 1403 * @param parameterName 1404 * name for parameter 1405 * @param theObject 1406 * the Java object containing the data value. 1407 * @param targetSqlType 1408 * the SQL type to send to the database, as defined in 1409 * java.sql.Types. 1410 * @param scale 1411 * the number of digits after the decimal point, for 1412 * java.sql.Types.DECIMAL and java.sql.Types.NUMERIC types. 1413 * Ignored for all other types. 1414 * @throws SQLException 1415 * if an error occurs accessing the database. 1416 */ 1417 public void setObject(String parameterName, Object theObject, 1418 int targetSqlType, int scale) throws SQLException; 1419 1420 /** 1421 * Sets the database Password for this {@code RowSet}. This property is used 1422 * when a connection to the database is established. Therefore it should be 1423 * set prior to invoking the {@link #execute} method. 1424 * 1425 * @param password 1426 * a {@code String} holding the password. 1427 * @throws SQLException 1428 * if an error occurs accessing the database. 1429 */ 1430 public void setPassword(String password) throws SQLException; 1431 1432 /** 1433 * Gets the timeout for the driver when a query operation is executed. If a 1434 * query takes longer than the timeout, a {@code SQLException} is thrown. 1435 * 1436 * @param seconds 1437 * the number of seconds for the timeout. 1438 * @throws SQLException 1439 * if an error occurs accessing the database. 1440 */ 1441 public void setQueryTimeout(int seconds) throws SQLException; 1442 1443 /** 1444 * Sets whether the {@code RowSet} is read-only or updatable. 1445 * 1446 * @param readOnly 1447 * {@code true} to set the {@code RowSet} to read-only state, 1448 * {@code false} to allow updates. 1449 * @throws SQLException 1450 * if an error occurs accessing the database. 1451 */ 1452 public void setReadOnly(boolean readOnly) throws SQLException; 1453 1454 /** 1455 * Sets the value of the specified parameter in the {@code RowSet} command 1456 * to a supplied {@code java.sql.Ref}. This is sent to the database as an 1457 * SQL {@code REF} value. 1458 * 1459 * @param parameterIndex 1460 * the index of the parameter to set; the first parameter's index 1461 * is 1. 1462 * @param theRef 1463 * the value to which the parameter is set. 1464 * @throws SQLException 1465 * if an error occurs accessing the database. 1466 * @see java.sql.Ref 1467 */ 1468 public void setRef(int parameterIndex, Ref theRef) throws SQLException; 1469 1470 /** 1471 * Sets the value of the specified parameter in the {@code RowSet} command 1472 * to a supplied {@code short integer}. 1473 * 1474 * @param parameterIndex 1475 * the index of the parameter to set; the first parameter's index 1476 * is 1. 1477 * @param theShort 1478 * the value to which the parameter is set. 1479 * @throws SQLException 1480 * if an error occurs accessing the database. 1481 */ 1482 public void setShort(int parameterIndex, short theShort) 1483 throws SQLException; 1484 1485 /** 1486 * Sets the value of the specified parameter in the RowSet command to a 1487 * supplied short integer. 1488 * 1489 * @param parameterName 1490 * name for parameter 1491 * @param theShort 1492 * the short value to set 1493 * @throws SQLException 1494 * if an error occurs accessing the database. 1495 */ 1496 public void setShort(String parameterName, short theShort) 1497 throws SQLException; 1498 1499 /** 1500 * Sets the value of the specified parameter in the {@code RowSet} command 1501 * to a supplied {@code String}. The string is placed into the database as a 1502 * {@code VARCHAR} or {@code LONGVARCHAR} SQL value, depending on the 1503 * database limits for the length of {@code VARCHAR} values. 1504 * 1505 * @param parameterIndex 1506 * the index of the parameter to set; the first parameter's index 1507 * is 1. 1508 * @param theString 1509 * the value to which the parameter is set. 1510 * @throws SQLException 1511 * if an error occurs accessing the database. 1512 */ 1513 public void setString(int parameterIndex, String theString) 1514 throws SQLException; 1515 1516 /** 1517 * Sets the value of the specified parameter in the RowSet command to a 1518 * supplied String. The String is placed into the database as a VARCHAR or 1519 * LONGVARCHAR SQL value, depending on the database limits for the length of 1520 * VARCHAR values. 1521 * 1522 * @param parameterName 1523 * name for parameter 1524 * @param theString 1525 * @throws SQLException 1526 * if an error occurs accessing the database. 1527 */ 1528 public void setString(String parameterName, String theString) 1529 throws SQLException; 1530 1531 /** 1532 * Sets the value of the specified parameter in the RowSet command to the 1533 * supplied RowId 1534 * 1535 * @param parameterIndex 1536 * index of the parameter to set, where the first parameter has 1537 * index = 1. 1538 * @param theRowId 1539 * the RowId value to set 1540 * @throws SQLException 1541 * if an error occurs accessing the database. 1542 */ 1543 public void setRowId(int parameterIndex, RowId theRowId) 1544 throws SQLException; 1545 1546 /** 1547 * Sets the value of the specified parameter in the RowSet command to the 1548 * supplied RowId. 1549 * 1550 * @param parameterName 1551 * name for parameter 1552 * @param theRowId 1553 * the RowId value to set 1554 * @throws SQLException 1555 * if an error occurs accessing the database. 1556 */ 1557 public void setRowId(String parameterName, RowId theRowId) 1558 throws SQLException; 1559 1560 /** 1561 * Sets the value of the specified parameter in the RowSet command to the 1562 * supplied SQLXML 1563 * 1564 * @param parameterIndex 1565 * index of the parameter to set, where the first parameter has 1566 * index = 1. 1567 * @param theSQLXML 1568 * the SQLXML value to set 1569 * @throws SQLException 1570 * if an error occurs accessing the database. 1571 */ 1572 public void setSQLXML(int parameterIndex, SQLXML theSQLXML) 1573 throws SQLException; 1574 1575 /** 1576 * Sets the value of the specified parameter in the RowSet command to the 1577 * supplied SQLXML. 1578 * 1579 * @param parameterName 1580 * name for parameter 1581 * @param theSQLXML 1582 * the SQLXML value to set 1583 * @throws SQLException 1584 * if an error occurs accessing the database. 1585 */ 1586 public void setSQLXML(String parameterName, SQLXML theSQLXML) 1587 throws SQLException; 1588 1589 /** 1590 * Sets the value of the specified parameter in the {@code RowSet} command 1591 * to a supplied {@code java.sql.Time}, converting it to an SQL {@code TIME} 1592 * value using the system default {@code Calendar}. 1593 * 1594 * @param parameterIndex 1595 * the index of the parameter to set; the first parameter's index 1596 * is 1. 1597 * @param theTime 1598 * the value to which the parameter is set. 1599 * @throws SQLException 1600 * if an error occurs accessing the database. 1601 * @see java.util.Calendar 1602 * @see java.sql.Time 1603 */ 1604 public void setTime(int parameterIndex, Time theTime) throws SQLException; 1605 1606 /** 1607 * Sets the value of the specified parameter in the {@code RowSet} command 1608 * to a supplied {@code java.sql.Time}, converting it to an SQL {@code TIME} 1609 * value using a supplied {@code Calendar}. 1610 * 1611 * @param parameterIndex 1612 * the index of the parameter to set; the first parameter's index 1613 * is 1. 1614 * @param theTime 1615 * the value to which the parameter is set. 1616 * @param theCalendar 1617 * the {@code Calendar} to use in the conversion operation. 1618 * @throws SQLException 1619 * if an error occurs accessing the database. 1620 * @see java.util.Calendar 1621 * @see java.sql.Time 1622 */ 1623 public void setTime(int parameterIndex, Time theTime, Calendar theCalendar) 1624 throws SQLException; 1625 1626 /** 1627 * Sets the value of the specified parameter in the RowSet command to a 1628 * supplied java.sql.Time, converting to an SQL TIME value using a supplied 1629 * Calendar. 1630 * 1631 * @param parameterName 1632 * name for parameter 1633 * @param theTime 1634 * the Time value to set 1635 * @throws SQLException 1636 * if an error occurs accessing the database. 1637 */ 1638 public void setTime(String parameterName, Time theTime) throws SQLException; 1639 1640 /** 1641 * Sets the value of the specified parameter in the RowSet command to a 1642 * supplied java.sql.Time, converting to an SQL TIME value using a supplied 1643 * Calendar. 1644 * 1645 * @param parameterName 1646 * name for parameter 1647 * @param theTime 1648 * the Time value to set 1649 * @param theCalendar 1650 * the Calendar to use in the conversion operation 1651 * @throws SQLException 1652 * if an error occurs accessing the database. 1653 */ 1654 public void setTime(String parameterName, Time theTime, Calendar theCalendar) 1655 throws SQLException; 1656 1657 /** 1658 * Sets the value of the specified parameter in the {@code RowSet} command 1659 * to a supplied {@code java.sql.Timestamp}, converting it to an SQL {@code 1660 * TIMESTAMP} value using the system default {@code Calendar}. 1661 * 1662 * @param parameterIndex 1663 * the index of the parameter to set; the first parameter's index 1664 * is 1. 1665 * @param theTimestamp 1666 * the value to which the parameter is set. 1667 * @throws SQLException 1668 * if an error occurs accessing the database. 1669 * @see java.util.Calendar 1670 * @see java.sql.Timestamp 1671 */ 1672 public void setTimestamp(int parameterIndex, Timestamp theTimestamp) 1673 throws SQLException; 1674 1675 /** 1676 * Sets the value of the specified parameter in the {@code RowSet} command 1677 * to a supplied {@code java.sql.Timestamp}, converting it to an SQL {@code 1678 * TIMESTAMP} value using a supplied {@code Calendar}. 1679 * 1680 * @param parameterIndex 1681 * the index of the parameter to set; the first parameter's index 1682 * is 1. 1683 * @param theTimestamp 1684 * the value to which the parameter is set. 1685 * @param theCalendar 1686 * the {@code Calendar} to use in the conversion operation 1687 * @throws SQLException 1688 * if an error occurs accessing the database. 1689 * @see java.util.Calendar 1690 * @see java.sql.Timestamp 1691 */ 1692 public void setTimestamp(int parameterIndex, Timestamp theTimestamp, 1693 Calendar theCalendar) throws SQLException; 1694 1695 /** 1696 * Sets the value of the specified parameter in the RowSet command to a 1697 * supplied java.sql.Timestamp converting to an SQL TIMESTAMP value 1698 * using the system default {@code Calendar}. 1699 * 1700 * @param parameterName 1701 * name for parameter 1702 * @param theTimestamp 1703 * the value to which the parameter is set 1704 * @throws SQLException 1705 * if an error occurs accessing the database. 1706 */ 1707 public void setTimestamp(String parameterName, Timestamp theTimestamp) 1708 throws SQLException; 1709 1710 /** 1711 * Sets the value of the specified parameter in the RowSet command to a 1712 * supplied java.sql.Timestamp converting to an SQL TIMESTAMP value using a 1713 * supplied Calendar. 1714 * 1715 * @param parameterName 1716 * name for parameter 1717 * @param theTimestamp 1718 * the value to which the parameter is set 1719 * @param theCalendar 1720 * the Calendar to use in the conversion operation 1721 * @throws SQLException 1722 * if an error occurs accessing the database. 1723 */ 1724 public void setTimestamp(String parameterName, Timestamp theTimestamp, 1725 Calendar theCalendar) throws SQLException; 1726 1727 /** 1728 * Sets the target instance's transaction isolation level to one of a 1729 * discrete set of possible values. The transaction isolation level defines 1730 * the policy implemented on the database for maintaining the data values 1731 * consistent. 1732 * <p> 1733 * Keep in mind that setting a transaction isolation level has no effect 1734 * unless your driver and DBMS support it. 1735 * 1736 * @param level 1737 * the transaction isolation level. One of: 1738 * <ul> 1739 * <li>{@code Connection.TRANSACTION_READ_UNCOMMITTED}</li> 1740 * <li>{@code Connection.TRANSACTION_READ_COMMITTED}</li> 1741 * <li>{@code Connection.TRANSACTION_REPEATABLE_READ}</li> 1742 * <li>{@code Connection.TRANSACTION_SERIALIZABLE}</li> 1743 * </ul> 1744 * @throws SQLException 1745 * if an error occurs accessing the database. 1746 * @see java.sql.Connection 1747 */ 1748 public void setTransactionIsolation(int level) throws SQLException; 1749 1750 /** 1751 * Sets the type of this {@code RowSet}. By default, the type is 1752 * non-scrollable. 1753 * 1754 * @param type 1755 * the type for the {@code RowSet}. One of: 1756 * <ul> 1757 * <li>{@code ResultSet.TYPE_FORWARD_ONLY}</li> 1758 * <li>{@code ResultSet.TYPE_SCROLL_INSENSITIVE}</li> 1759 * <li>{@code ResultSet.TYPE_SCROLL_SENSITIVE}</li> 1760 * </ul> 1761 * @throws SQLException 1762 * if an error occurs accessing the database. 1763 */ 1764 public void setType(int type) throws SQLException; 1765 1766 /** 1767 * Sets the mapping of SQL User Defined Types (UDTs) to Java classes. The 1768 * Java classes must all implement the {@link java.sql.SQLData SQLData} 1769 * interface. 1770 * 1771 * @param theTypeMap 1772 * the names of SQL UDTs and the Java classes to which they are 1773 * mapped. 1774 * @throws SQLException 1775 * if an error occurs accessing the database. 1776 */ 1777 public void setTypeMap(Map<String, Class<?>> theTypeMap) 1778 throws SQLException; 1779 1780 /** 1781 * Sets the URL used by this {@code RowSet} to access the database via a 1782 * {@code DriverManager}. The URL is optional - an alternative is to use a 1783 * database name to create a connection. 1784 * 1785 * @param theURL 1786 * the URL for the database. Can be {@code null}. 1787 * @throws SQLException 1788 * if an error occurs accessing the database. 1789 */ 1790 public void setUrl(String theURL) throws SQLException; 1791 1792 /** 1793 * Sets the URL used by this RowSet to access the database via a 1794 * <code>DriverManager</code>. The URL is optional - an alternative is to 1795 * use a Data Source Name to create a connection. 1796 * 1797 * @param parameterIndex 1798 * index of the parameter to set, where the first parameter has 1799 * index = 1. 1800 * @param theURL 1801 * a java.net.URL containing the URL for the database. 1802 * @throws SQLException 1803 * if an error occurs accessing the database. 1804 */ 1805 public void setURL(int parameterIndex, URL theURL) throws SQLException; 1806 1807 /** 1808 * Sets the {@code Username} property for the {@code RowSet}, used to 1809 * authenticate a connection to the database. 1810 * 1811 * @param theUsername 1812 * the new user name for this row set. 1813 * @throws SQLException 1814 * if an error occurs accessing the database. 1815 */ 1816 public void setUsername(String theUsername) throws SQLException; 1817 } 1818