Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/sql/rowset/BaseRowSet.java
38918 views
/*1* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.sql.rowset;2627import java.sql.*;28import javax.sql.*;29import java.util.*;30import java.io.*;31import java.math.*;32import java.io.Serializable;3334import javax.sql.rowset.serial.*;3536/**37* An abstract class providing a <code>RowSet</code> object with its basic functionality.38* The basic functions include having properties and sending event notifications,39* which all JavaBeans™ components must implement.40*41* <h3>1.0 Overview</h3>42* The <code>BaseRowSet</code> class provides the core functionality43* for all <code>RowSet</code> implementations,44* and all standard implementations <b>may</b> use this class in combination with45* one or more <code>RowSet</code> interfaces in order to provide a standard46* vendor-specific implementation. To clarify, all implementations must implement47* at least one of the <code>RowSet</code> interfaces (<code>JdbcRowSet</code>,48* <code>CachedRowSet</code>, <code>JoinRowSet</code>, <code>FilteredRowSet</code>,49* or <code>WebRowSet</code>). This means that any implementation that extends50* the <code>BaseRowSet</code> class must also implement one of the <code>RowSet</code>51* interfaces.52* <p>53* The <code>BaseRowSet</code> class provides the following:54*55* <UL>56* <LI><b>Properties</b>57* <ul>58* <li>Fields for storing current properties59* <li>Methods for getting and setting properties60* </ul>61*62* <LI><b>Event notification</b>63*64* <LI><b>A complete set of setter methods</b> for setting the parameters in a65* <code>RowSet</code> object's command66*67* <LI> <b>Streams</b>68* <ul>69* <li>Fields for storing stream instances70* <li>Constants for indicating the type of a stream71* </ul>72* <p>73* </UL>74*75* <h3>2.0 Setting Properties</h3>76* All rowsets maintain a set of properties, which will usually be set using77* a tool. The number and kinds of properties a rowset has will vary,78* depending on what the <code>RowSet</code> implementation does and how it gets79* its data. For example,80* rowsets that get their data from a <code>ResultSet</code> object need to81* set the properties that are required for making a database connection.82* If a <code>RowSet</code> object uses the <code>DriverManager</code> facility to make a83* connection, it needs to set a property for the JDBC URL that identifies the84* appropriate driver, and it needs to set the properties that give the85* user name and password.86* If, on the other hand, the rowset uses a <code>DataSource</code> object87* to make the connection, which is the preferred method, it does not need to88* set the property for the JDBC URL. Instead, it needs to set the property89* for the logical name of the data source along with the properties for90* the user name and password.91* <P>92* NOTE: In order to use a <code>DataSource</code> object for making a93* connection, the <code>DataSource</code> object must have been registered94* with a naming service that uses the Java Naming and Directory95* Interface™ (JNDI) API. This registration96* is usually done by a person acting in the capacity of a system administrator.97*98* <h3>3.0 Setting the Command and Its Parameters</h3>99* When a rowset gets its data from a relational database, it executes a command (a query)100* that produces a <code>ResultSet</code> object. This query is the command that is set101* for the <code>RowSet</code> object's command property. The rowset populates itself with data by reading the102* data from the <code>ResultSet</code> object into itself. If the query103* contains placeholders for values to be set, the <code>BaseRowSet</code> setter methods104* are used to set these values. All setter methods allow these values to be set105* to <code>null</code> if required.106* <P>107* The following code fragment illustrates how the108* <code>CachedRowSet</code>™109* object <code>crs</code> might have its command property set. Note that if a110* tool is used to set properties, this is the code that the tool would use.111* <PRE>{@code112* crs.setCommand("SELECT FIRST_NAME, LAST_NAME, ADDRESS FROM CUSTOMERS" +113* "WHERE CREDIT_LIMIT > ? AND REGION = ?");114* }</PRE>115* <P>116* In this example, the values for <code>CREDIT_LIMIT</code> and117* <code>REGION</code> are placeholder parameters, which are indicated with a118* question mark (?). The first question mark is placeholder parameter number119* <code>1</code>, the second question mark is placeholder parameter number120* <code>2</code>, and so on. Any placeholder parameters must be set with121* values before the query can be executed. To set these122* placeholder parameters, the <code>BaseRowSet</code> class provides a set of setter123* methods, similar to those provided by the <code>PreparedStatement</code>124* interface, for setting values of each data type. A <code>RowSet</code> object stores the125* parameter values internally, and its <code>execute</code> method uses them internally126* to set values for the placeholder parameters127* before it sends the command to the DBMS to be executed.128* <P>129* The following code fragment demonstrates130* setting the two parameters in the query from the previous example.131* <PRE>{@code132* crs.setInt(1, 5000);133* crs.setString(2, "West");134* }</PRE>135* If the <code>execute</code> method is called at this point, the query136* sent to the DBMS will be:137* <PRE>{@code138* "SELECT FIRST_NAME, LAST_NAME, ADDRESS FROM CUSTOMERS" +139* "WHERE CREDIT_LIMIT > 5000 AND REGION = 'West'"140* }</PRE>141* NOTE: Setting <code>Array</code>, <code>Clob</code>, <code>Blob</code> and142* <code>Ref</code> objects as a command parameter, stores these values as143* <code>SerialArray</code>, <code>SerialClob</code>, <code>SerialBlob</code>144* and <code>SerialRef</code> objects respectively.145*146* <h3>4.0 Handling of Parameters Behind the Scenes</h3>147*148* NOTE: The <code>BaseRowSet</code> class provides two kinds of setter methods,149* those that set properties and those that set placeholder parameters. The setter150* methods discussed in this section are those that set placeholder parameters.151* <P>152* The placeholder parameters set with the <code>BaseRowSet</code> setter methods153* are stored as objects in an internal <code>Hashtable</code> object.154* Primitives are stored as their <code>Object</code> type. For example, <code>byte</code>155* is stored as <code>Byte</code> object, and <code>int</code> is stored as156* an <code>Integer</code> object.157* When the method <code>execute</code> is called, the values in the158* <code>Hashtable</code> object are substituted for the appropriate placeholder159* parameters in the command.160* <P>161* A call to the method <code>getParams</code> returns the values stored in the162* <code>Hashtable</code> object as an array of <code>Object</code> instances.163* An element in this array may be a simple <code>Object</code> instance or an164* array (which is a type of <code>Object</code>). The particular setter method used165* determines whether an element in this array is an <code>Object</code> or an array.166* <P>167* The majority of methods for setting placeholder parameters take two parameters,168* with the first parameter169* indicating which placeholder parameter is to be set, and the second parameter170* giving the value to be set. Methods such as <code>setInt</code>,171* <code>setString</code>, <code>setBoolean</code>, and <code>setLong</code> fall into172* this category. After these methods have been called, a call to the method173* <code>getParams</code> will return an array with the values that have been set. Each174* element in the array is an <code>Object</code> instance representing the175* values that have been set. The order of these values in the array is determined by the176* <code>int</code> (the first parameter) passed to the setter method. The values in the177* array are the values (the second parameter) passed to the setter method.178* In other words, the first element in the array is the value179* to be set for the first placeholder parameter in the <code>RowSet</code> object's180* command. The second element is the value to181* be set for the second placeholder parameter, and so on.182* <P>183* Several setter methods send the driver and DBMS information beyond the value to be set.184* When the method <code>getParams</code> is called after one of these setter methods has185* been used, the elements in the array will themselves be arrays to accommodate the186* additional information. In this category, the method <code>setNull</code> is a special case187* because one version takes only188* two parameters (<code>setNull(int parameterIndex, int SqlType)</code>). Nevertheless,189* it requires190* an array to contain the information that will be passed to the driver and DBMS. The first191* element in this array is the value to be set, which is <code>null</code>, and the192* second element is the <code>int</code> supplied for <i>sqlType</i>, which193* indicates the type of SQL value that is being set to <code>null</code>. This information194* is needed by some DBMSs and is therefore required in order to ensure that applications195* are portable.196* The other version is intended to be used when the value to be set to <code>null</code>197* is a user-defined type. It takes three parameters198* (<code>setNull(int parameterIndex, int sqlType, String typeName)</code>) and also199* requires an array to contain the information to be passed to the driver and DBMS.200* The first two elements in this array are the same as for the first version of201* <code>setNull</code>. The third element, <i>typeName</i>, gives the SQL name of202* the user-defined type. As is true with the other setter methods, the number of the203* placeholder parameter to be set is indicated by an element's position in the array204* returned by <code>getParams</code>. So, for example, if the parameter205* supplied to <code>setNull</code> is <code>2</code>, the second element in the array206* returned by <code>getParams</code> will be an array of two or three elements.207* <P>208* Some methods, such as <code>setObject</code> and <code>setDate</code> have versions209* that take more than two parameters, with the extra parameters giving information210* to the driver or the DBMS. For example, the methods <code>setDate</code>,211* <code>setTime</code>, and <code>setTimestamp</code> can take a <code>Calendar</code>212* object as their third parameter. If the DBMS does not store time zone information,213* the driver uses the <code>Calendar</code> object to construct the <code>Date</code>,214* <code>Time</code>, or <code>Timestamp</code> object being set. As is true with other215* methods that provide additional information, the element in the array returned216* by <code>getParams</code> is an array instead of a simple <code>Object</code> instance.217* <P>218* The methods <code>setAsciiStream</code>, <code>setBinaryStream</code>,219* <code>setCharacterStream</code>, and <code>setUnicodeStream</code> (which is220* deprecated, so applications should use <code>getCharacterStream</code> instead)221* take three parameters, so for them, the element in the array returned by222* <code>getParams</code> is also an array. What is different about these setter223* methods is that in addition to the information provided by parameters, the array contains224* one of the <code>BaseRowSet</code> constants indicating the type of stream being set.225* <p>226* NOTE: The method <code>getParams</code> is called internally by227* <code>RowSet</code> implementations extending this class; it is not normally called by an228* application programmer directly.229*230* <h3>5.0 Event Notification</h3>231* The <code>BaseRowSet</code> class provides the event notification232* mechanism for rowsets. It contains the field233* <code>listeners</code>, methods for adding and removing listeners, and234* methods for notifying listeners of changes.235* <P>236* A listener is an object that has implemented the <code>RowSetListener</code> interface.237* If it has been added to a <code>RowSet</code> object's list of listeners, it will be notified238* when an event occurs on that <code>RowSet</code> object. Each listener's239* implementation of the <code>RowSetListener</code> methods defines what that object240* will do when it is notified that an event has occurred.241* <P>242* There are three possible events for a <code>RowSet</code> object:243* <OL>244* <LI>the cursor moves245* <LI>an individual row is changed (updated, deleted, or inserted)246* <LI>the contents of the entire <code>RowSet</code> object are changed247* </OL>248* <P>249* The <code>BaseRowSet</code> method used for the notification indicates the250* type of event that has occurred. For example, the method251* <code>notifyRowChanged</code> indicates that a row has been updated,252* deleted, or inserted. Each of the notification methods creates a253* <code>RowSetEvent</code> object, which is supplied to the listener in order to254* identify the <code>RowSet</code> object on which the event occurred.255* What the listener does with this information, which may be nothing, depends on how it was256* implemented.257*258* <h3>6.0 Default Behavior</h3>259* A default <code>BaseRowSet</code> object is initialized with many starting values.260*261* The following is true of a default <code>RowSet</code> instance that extends262* the <code>BaseRowSet</code> class:263* <UL>264* <LI>Has a scrollable cursor and does not show changes265* made by others.266* <LI>Is updatable.267* <LI>Does not show rows that have been deleted.268* <LI>Has no time limit for how long a driver may take to269* execute the <code>RowSet</code> object's command.270* <LI>Has no limit for the number of rows it may contain.271* <LI>Has no limit for the number of bytes a column may contain. NOTE: This272* limit applies only to columns that hold values of the273* following types: <code>BINARY</code>, <code>VARBINARY</code>,274* <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>,275* and <code>LONGVARCHAR</code>.276* <LI>Will not see uncommitted data (make "dirty" reads).277* <LI>Has escape processing turned on.278* <LI>Has its connection's type map set to <code>null</code>.279* <LI>Has an empty <code>Vector</code> object for storing the values set280* for the placeholder parameters in the <code>RowSet</code> object's command.281* </UL>282* <p>283* If other values are desired, an application must set the property values284* explicitly. For example, the following line of code sets the maximum number285* of rows for the <code>CachedRowSet</code> object <i>crs</i> to 500.286* <PRE>287* crs.setMaxRows(500);288* </PRE>289* Methods implemented in extensions of this <code>BaseRowSet</code> class <b>must</b> throw an290* <code>SQLException</code> object for any violation of the defined assertions. Also, if the291* extending class overrides and reimplements any <code>BaseRowSet</code> method and encounters292* connectivity or underlying data source issues, that method <b>may</b> in addition throw an293* <code>SQLException</code> object for that reason.294*/295296public abstract class BaseRowSet implements Serializable, Cloneable {297298/**299* A constant indicating to a <code>RowSetReaderImpl</code> object300* that a given parameter is a Unicode stream. This301* <code>RowSetReaderImpl</code> object is provided as an extension of the302* <code>SyncProvider</code> abstract class defined in the303* <code>SyncFactory</code> static factory SPI mechanism.304*/305public static final int UNICODE_STREAM_PARAM = 0;306307/**308* A constant indicating to a <code>RowSetReaderImpl</code> object309* that a given parameter is a binary stream. A310* <code>RowSetReaderImpl</code> object is provided as an extension of the311* <code>SyncProvider</code> abstract class defined in the312* <code>SyncFactory</code> static factory SPI mechanism.313*/314public static final int BINARY_STREAM_PARAM = 1;315316/**317* A constant indicating to a <code>RowSetReaderImpl</code> object318* that a given parameter is an ASCII stream. A319* <code>RowSetReaderImpl</code> object is provided as an extension of the320* <code>SyncProvider</code> abstract class defined in the321* <code>SyncFactory</code> static factory SPI mechanism.322*/323public static final int ASCII_STREAM_PARAM = 2;324325/**326* The <code>InputStream</code> object that will be327* returned by the method <code>getBinaryStream</code>, which is328* specified in the <code>ResultSet</code> interface.329* @serial330*/331protected java.io.InputStream binaryStream;332333/**334* The <code>InputStream</code> object that will be335* returned by the method <code>getUnicodeStream</code>,336* which is specified in the <code>ResultSet</code> interface.337* @serial338*/339protected java.io.InputStream unicodeStream;340341/**342* The <code>InputStream</code> object that will be343* returned by the method <code>getAsciiStream</code>,344* which is specified in the <code>ResultSet</code> interface.345* @serial346*/347protected java.io.InputStream asciiStream;348349/**350* The <code>Reader</code> object that will be351* returned by the method <code>getCharacterStream</code>,352* which is specified in the <code>ResultSet</code> interface.353* @serial354*/355protected java.io.Reader charStream;356357/**358* The query that will be sent to the DBMS for execution when the359* method <code>execute</code> is called.360* @serial361*/362private String command;363364/**365* The JDBC URL the reader, writer, or both supply to the method366* <code>DriverManager.getConnection</code> when the367* <code>DriverManager</code> is used to get a connection.368* <P>369* The JDBC URL identifies the driver to be used to make the conndection.370* This URL can be found in the documentation supplied by the driver371* vendor.372* @serial373*/374private String URL;375376/**377* The logical name of the data source that the reader/writer should use378* in order to retrieve a <code>DataSource</code> object from a Java379* Directory and Naming Interface (JNDI) naming service.380* @serial381*/382private String dataSource;383384/**385* The user name the reader, writer, or both supply to the method386* <code>DriverManager.getConnection</code> when the387* <code>DriverManager</code> is used to get a connection.388* @serial389*/390private transient String username;391392/**393* The password the reader, writer, or both supply to the method394* <code>DriverManager.getConnection</code> when the395* <code>DriverManager</code> is used to get a connection.396* @serial397*/398private transient String password;399400/**401* A constant indicating the type of this JDBC <code>RowSet</code>402* object. It must be one of the following <code>ResultSet</code>403* constants: <code>TYPE_FORWARD_ONLY</code>,404* <code>TYPE_SCROLL_INSENSITIVE</code>, or405* <code>TYPE_SCROLL_SENSITIVE</code>.406* @serial407*/408private int rowSetType = ResultSet.TYPE_SCROLL_INSENSITIVE;409410/**411* A <code>boolean</code> indicating whether deleted rows are visible in this412* JDBC <code>RowSet</code> object .413* @serial414*/415private boolean showDeleted = false; // default is false416417/**418* The maximum number of seconds the driver419* will wait for a command to execute. This limit applies while420* this JDBC <code>RowSet</code> object is connected to its data421* source, that is, while it is populating itself with422* data and while it is writing data back to the data source.423* @serial424*/425private int queryTimeout = 0; // default is no timeout426427/**428* The maximum number of rows the reader should read.429* @serial430*/431private int maxRows = 0; // default is no limit432433/**434* The maximum field size the reader should read.435* @serial436*/437private int maxFieldSize = 0; // default is no limit438439/**440* A constant indicating the concurrency of this JDBC <code>RowSet</code>441* object. It must be one of the following <code>ResultSet</code>442* constants: <code>CONCUR_READ_ONLY</code> or443* <code>CONCUR_UPDATABLE</code>.444* @serial445*/446private int concurrency = ResultSet.CONCUR_UPDATABLE;447448/**449* A <code>boolean</code> indicating whether this JDBC <code>RowSet</code>450* object is read-only. <code>true</code> indicates that it is read-only;451* <code>false</code> that it is writable.452* @serial453*/454private boolean readOnly;455456/**457* A <code>boolean</code> indicating whether the reader for this458* JDBC <code>RowSet</code> object should perform escape processing.459* <code>true</code> means that escape processing is turned on;460* <code>false</code> that it is not. The default is <code>true</code>.461* @serial462*/463private boolean escapeProcessing = true;464465/**466* A constant indicating the isolation level of the connection467* for this JDBC <code>RowSet</code> object . It must be one of468* the following <code>Connection</code> constants:469* <code>TRANSACTION_NONE</code>,470* <code>TRANSACTION_READ_UNCOMMITTED</code>,471* <code>TRANSACTION_READ_COMMITTED</code>,472* <code>TRANSACTION_REPEATABLE_READ</code> or473* <code>TRANSACTION_SERIALIZABLE</code>.474* @serial475*/476private int isolation;477478/**479* A constant used as a hint to the driver that indicates the direction in480* which data from this JDBC <code>RowSet</code> object is going481* to be fetched. The following <code>ResultSet</code> constants are482* possible values:483* <code>FETCH_FORWARD</code>,484* <code>FETCH_REVERSE</code>,485* <code>FETCH_UNKNOWN</code>.486* <P>487* Unused at this time.488* @serial489*/490private int fetchDir = ResultSet.FETCH_FORWARD; // default fetch direction491492/**493* A hint to the driver that indicates the expected number of rows494* in this JDBC <code>RowSet</code> object .495* <P>496* Unused at this time.497* @serial498*/499private int fetchSize = 0; // default fetchSize500501/**502* The <code>java.util.Map</code> object that contains entries mapping503* SQL type names to classes in the Java programming language for the504* custom mapping of user-defined types.505* @serial506*/507private Map<String, Class<?>> map;508509/**510* A <code>Vector</code> object that holds the list of listeners511* that have registered with this <code>RowSet</code> object.512* @serial513*/514private Vector<RowSetListener> listeners;515516/**517* A <code>Vector</code> object that holds the parameters set518* for this <code>RowSet</code> object's current command.519* @serial520*/521private Hashtable<Integer, Object> params; // could be transient?522523/**524* Constructs a new <code>BaseRowSet</code> object initialized with525* a default <code>Vector</code> object for its <code>listeners</code>526* field. The other default values with which it is initialized are listed527* in Section 6.0 of the class comment for this class.528*/529public BaseRowSet() {530// allocate the listeners collection531listeners = new Vector<RowSetListener>();532}533534/**535* Performs the necessary internal configurations and initializations536* to allow any JDBC <code>RowSet</code> implementation to start using537* the standard facilities provided by a <code>BaseRowSet</code>538* instance. This method <b>should</b> be called after the <code>RowSet</code> object539* has been instantiated to correctly initialize all parameters. This method540* <b>should</b> never be called by an application, but is called from with541* a <code>RowSet</code> implementation extending this class.542*/543protected void initParams() {544params = new Hashtable<Integer, Object>();545}546547//--------------------------------------------------------------------548// Events549//--------------------------------------------------------------------550551/**552* The listener will be notified whenever an event occurs on this <code>RowSet</code>553* object.554* <P>555* A listener might, for example, be a table or graph that needs to556* be updated in order to accurately reflect the current state of557* the <code>RowSet</code> object.558* <p>559* <b>Note</b>: if the <code>RowSetListener</code> object is560* <code>null</code>, this method silently discards the <code>null</code>561* value and does not add a null reference to the set of listeners.562* <p>563* <b>Note</b>: if the listener is already set, and the new <code>RowSetListerner</code>564* instance is added to the set of listeners already registered to receive565* event notifications from this <code>RowSet</code>.566*567* @param listener an object that has implemented the568* <code>javax.sql.RowSetListener</code> interface and wants to be notified569* of any events that occur on this <code>RowSet</code> object; May be570* null.571* @see #removeRowSetListener572*/573public void addRowSetListener(RowSetListener listener) {574listeners.add(listener);575}576577/**578* Removes the designated object from this <code>RowSet</code> object's list of listeners.579* If the given argument is not a registered listener, this method580* does nothing.581*582* <b>Note</b>: if the <code>RowSetListener</code> object is583* <code>null</code>, this method silently discards the <code>null</code>584* value.585*586* @param listener a <code>RowSetListener</code> object that is on the list587* of listeners for this <code>RowSet</code> object588* @see #addRowSetListener589*/590public void removeRowSetListener(RowSetListener listener) {591listeners.remove(listener);592}593594/**595* Determine if instance of this class extends the RowSet interface.596*/597private void checkforRowSetInterface() throws SQLException {598if ((this instanceof javax.sql.RowSet) == false) {599throw new SQLException("The class extending abstract class BaseRowSet " +600"must implement javax.sql.RowSet or one of it's sub-interfaces.");601}602}603604/**605* Notifies all of the listeners registered with this606* <code>RowSet</code> object that its cursor has moved.607* <P>608* When an application calls a method to move the cursor,609* that method moves the cursor and then calls this method610* internally. An application <b>should</b> never invoke611* this method directly.612*613* @throws SQLException if the class extending the <code>BaseRowSet</code>614* abstract class does not implement the <code>RowSet</code> interface or615* one of it's sub-interfaces.616*/617protected void notifyCursorMoved() throws SQLException {618checkforRowSetInterface();619if (listeners.isEmpty() == false) {620RowSetEvent event = new RowSetEvent((RowSet)this);621for (RowSetListener rsl : listeners) {622rsl.cursorMoved(event);623}624}625}626627/**628* Notifies all of the listeners registered with this <code>RowSet</code> object that629* one of its rows has changed.630* <P>631* When an application calls a method that changes a row, such as632* the <code>CachedRowSet</code> methods <code>insertRow</code>,633* <code>updateRow</code>, or <code>deleteRow</code>,634* that method calls <code>notifyRowChanged</code>635* internally. An application <b>should</b> never invoke636* this method directly.637*638* @throws SQLException if the class extending the <code>BaseRowSet</code>639* abstract class does not implement the <code>RowSet</code> interface or640* one of it's sub-interfaces.641*/642protected void notifyRowChanged() throws SQLException {643checkforRowSetInterface();644if (listeners.isEmpty() == false) {645RowSetEvent event = new RowSetEvent((RowSet)this);646for (RowSetListener rsl : listeners) {647rsl.rowChanged(event);648}649}650}651652/**653* Notifies all of the listeners registered with this <code>RowSet</code>654* object that its entire contents have changed.655* <P>656* When an application calls methods that change the entire contents657* of the <code>RowSet</code> object, such as the <code>CachedRowSet</code> methods658* <code>execute</code>, <code>populate</code>, <code>restoreOriginal</code>,659* or <code>release</code>, that method calls <code>notifyRowSetChanged</code>660* internally (either directly or indirectly). An application <b>should</b>661* never invoke this method directly.662*663* @throws SQLException if the class extending the <code>BaseRowSet</code>664* abstract class does not implement the <code>RowSet</code> interface or665* one of it's sub-interfaces.666*/667protected void notifyRowSetChanged() throws SQLException {668checkforRowSetInterface();669if (listeners.isEmpty() == false) {670RowSetEvent event = new RowSetEvent((RowSet)this);671for (RowSetListener rsl : listeners) {672rsl.rowSetChanged(event);673}674}675}676677/**678* Retrieves the SQL query that is the command for this679* <code>RowSet</code> object. The command property contains the query that680* will be executed to populate this <code>RowSet</code> object.681* <P>682* The SQL query returned by this method is used by <code>RowSet</code> methods683* such as <code>execute</code> and <code>populate</code>, which may be implemented684* by any class that extends the <code>BaseRowSet</code> abstract class and685* implements one or more of the standard JSR-114 <code>RowSet</code>686* interfaces.687* <P>688* The command is used by the <code>RowSet</code> object's689* reader to obtain a <code>ResultSet</code> object. The reader then690* reads the data from the <code>ResultSet</code> object and uses it to691* to populate this <code>RowSet</code> object.692* <P>693* The default value for the <code>command</code> property is <code>null</code>.694*695* @return the <code>String</code> that is the value for this696* <code>RowSet</code> object's <code>command</code> property;697* may be <code>null</code>698* @see #setCommand699*/700public String getCommand() {701return command;702}703704/**705* Sets this <code>RowSet</code> object's <code>command</code> property to706* the given <code>String</code> object and clears the parameters, if any,707* that were set for the previous command.708* <P>709* The <code>command</code> property may not be needed if the <code>RowSet</code>710* object gets its data from a source that does not support commands,711* such as a spreadsheet or other tabular file.712* Thus, this property is optional and may be <code>null</code>.713*714* @param cmd a <code>String</code> object containing an SQL query715* that will be set as this <code>RowSet</code> object's command716* property; may be <code>null</code> but may not be an empty string717* @throws SQLException if an empty string is provided as the command value718* @see #getCommand719*/720public void setCommand(String cmd) throws SQLException {721// cmd equal to null or722// cmd with length 0 (implies url =="")723// are not independent events.724725if(cmd == null) {726command = null;727} else if (cmd.length() == 0) {728throw new SQLException("Invalid command string detected. " +729"Cannot be of length less than 0");730} else {731// "unbind" any parameters from any previous command.732if(params == null){733throw new SQLException("Set initParams() before setCommand");734}735params.clear();736command = cmd;737}738739}740741/**742* Retrieves the JDBC URL that this <code>RowSet</code> object's743* <code>javax.sql.Reader</code> object uses to make a connection744* with a relational database using a JDBC technology-enabled driver.745*<P>746* The <code>Url</code> property will be <code>null</code> if the underlying data747* source is a non-SQL data source, such as a spreadsheet or an XML748* data source.749*750* @return a <code>String</code> object that contains the JDBC URL751* used to establish the connection for this <code>RowSet</code>752* object; may be <code>null</code> (default value) if not set753* @throws SQLException if an error occurs retrieving the URL value754* @see #setUrl755*/756public String getUrl() throws SQLException {757return URL;758}759760/**761* Sets the Url property for this <code>RowSet</code> object762* to the given <code>String</code> object and sets the dataSource name763* property to <code>null</code>. The Url property is a764* JDBC URL that is used when765* the connection is created using a JDBC technology-enabled driver766* ("JDBC driver") and the <code>DriverManager</code>.767* The correct JDBC URL for the specific driver to be used can be found768* in the driver documentation. Although there are guidelines for for how769* a JDBC URL is formed,770* a driver vendor can specify any <code>String</code> object except771* one with a length of <code>0</code> (an empty string).772* <P>773* Setting the Url property is optional if connections are established using774* a <code>DataSource</code> object instead of the <code>DriverManager</code>.775* The driver will use either the URL property or the776* dataSourceName property to create a connection, whichever was777* specified most recently. If an application uses a JDBC URL, it778* must load a JDBC driver that accepts the JDBC URL before it uses the779* <code>RowSet</code> object to connect to a database. The <code>RowSet</code>780* object will use the URL internally to create a database connection in order781* to read or write data.782*783* @param url a <code>String</code> object that contains the JDBC URL784* that will be used to establish the connection to a database for this785* <code>RowSet</code> object; may be <code>null</code> but must not786* be an empty string787* @throws SQLException if an error occurs setting the Url property or the788* parameter supplied is a string with a length of <code>0</code> (an789* empty string)790* @see #getUrl791*/792public void setUrl(String url) throws SQLException {793if(url == null) {794url = null;795} else if (url.length() < 1) {796throw new SQLException("Invalid url string detected. " +797"Cannot be of length less than 1");798} else {799URL = url;800}801802dataSource = null;803804}805806/**807* Returns the logical name that when supplied to a naming service808* that uses the Java Naming and Directory Interface (JNDI) API, will809* retrieve a <code>javax.sql.DataSource</code> object. This810* <code>DataSource</code> object can be used to establish a connection811* to the data source that it represents.812* <P>813* Users should set either the url or the data source name property.814* The driver will use the property set most recently to establish a815* connection.816*817* @return a <code>String</code> object that identifies the818* <code>DataSource</code> object to be used for making a819* connection; if no logical name has been set, <code>null</code>820* is returned.821* @see #setDataSourceName822*/823public String getDataSourceName() {824return dataSource;825}826827828/**829* Sets the <code>DataSource</code> name property for this <code>RowSet</code>830* object to the given logical name and sets this <code>RowSet</code> object's831* Url property to <code>null</code>. The name must have been bound to a832* <code>DataSource</code> object in a JNDI naming service so that an833* application can do a lookup using that name to retrieve the834* <code>DataSource</code> object bound to it. The <code>DataSource</code>835* object can then be used to establish a connection to the data source it836* represents.837* <P>838* Users should set either the Url property or the dataSourceName property.839* If both properties are set, the driver will use the property set most recently.840*841* @param name a <code>String</code> object with the name that can be supplied842* to a naming service based on JNDI technology to retrieve the843* <code>DataSource</code> object that can be used to get a connection;844* may be <code>null</code> but must not be an empty string845* @throws SQLException if an empty string is provided as the <code>DataSource</code>846* name847* @see #getDataSourceName848*/849public void setDataSourceName(String name) throws SQLException {850851if (name == null) {852dataSource = null;853} else if (name.equals("")) {854throw new SQLException("DataSource name cannot be empty string");855} else {856dataSource = name;857}858859URL = null;860}861862/**863* Returns the user name used to create a database connection. Because it864* is not serialized, the username property is set at runtime before865* calling the method <code>execute</code>.866*867* @return the <code>String</code> object containing the user name that868* is supplied to the data source to create a connection; may be869* <code>null</code> (default value) if not set870* @see #setUsername871*/872public String getUsername() {873return username;874}875876/**877* Sets the username property for this <code>RowSet</code> object878* to the given user name. Because it879* is not serialized, the username property is set at run time before880* calling the method <code>execute</code>.881*882* @param name the <code>String</code> object containing the user name that883* is supplied to the data source to create a connection. It may be null.884* @see #getUsername885*/886public void setUsername(String name) {887if(name == null)888{889username = null;890} else {891username = name;892}893}894895/**896* Returns the password used to create a database connection for this897* <code>RowSet</code> object. Because the password property is not898* serialized, it is set at run time before calling the method899* <code>execute</code>. The default value is <code>null</code>900*901* @return the <code>String</code> object that represents the password902* that must be supplied to the database to create a connection903* @see #setPassword904*/905public String getPassword() {906return password;907}908909/**910* Sets the password used to create a database connection for this911* <code>RowSet</code> object to the given <code>String</code>912* object. Because the password property is not913* serialized, it is set at run time before calling the method914* <code>execute</code>.915*916* @param pass the <code>String</code> object that represents the password917* that is supplied to the database to create a connection. It may be918* null.919* @see #getPassword920*/921public void setPassword(String pass) {922if(pass == null)923{924password = null;925} else {926password = pass;927}928}929930/**931* Sets the type for this <code>RowSet</code> object to the specified type.932* The default type is <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>.933*934* @param type one of the following constants:935* <code>ResultSet.TYPE_FORWARD_ONLY</code>,936* <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or937* <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>938* @throws SQLException if the parameter supplied is not one of the939* following constants:940* <code>ResultSet.TYPE_FORWARD_ONLY</code> or941* <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>942* <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>943* @see #getConcurrency944* @see #getType945*/946public void setType(int type) throws SQLException {947948if ((type != ResultSet.TYPE_FORWARD_ONLY) &&949(type != ResultSet.TYPE_SCROLL_INSENSITIVE) &&950(type != ResultSet.TYPE_SCROLL_SENSITIVE)) {951throw new SQLException("Invalid type of RowSet set. Must be either " +952"ResultSet.TYPE_FORWARD_ONLY or ResultSet.TYPE_SCROLL_INSENSITIVE " +953"or ResultSet.TYPE_SCROLL_SENSITIVE.");954}955this.rowSetType = type;956}957958/**959* Returns the type of this <code>RowSet</code> object. The type is initially960* determined by the statement that created the <code>RowSet</code> object.961* The <code>RowSet</code> object can call the method962* <code>setType</code> at any time to change its963* type. The default is <code>TYPE_SCROLL_INSENSITIVE</code>.964*965* @return the type of this JDBC <code>RowSet</code>966* object, which must be one of the following:967* <code>ResultSet.TYPE_FORWARD_ONLY</code>,968* <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or969* <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>970* @throws SQLException if an error occurs getting the type of971* of this <code>RowSet</code> object972* @see #setType973*/974public int getType() throws SQLException {975return rowSetType;976}977978/**979* Sets the concurrency for this <code>RowSet</code> object to980* the specified concurrency. The default concurrency for any <code>RowSet</code>981* object (connected or disconnected) is <code>ResultSet.CONCUR_UPDATABLE</code>,982* but this method may be called at any time to change the concurrency.983* <P>984* @param concurrency one of the following constants:985* <code>ResultSet.CONCUR_READ_ONLY</code> or986* <code>ResultSet.CONCUR_UPDATABLE</code>987* @throws SQLException if the parameter supplied is not one of the988* following constants:989* <code>ResultSet.CONCUR_UPDATABLE</code> or990* <code>ResultSet.CONCUR_READ_ONLY</code>991* @see #getConcurrency992* @see #isReadOnly993*/994public void setConcurrency(int concurrency) throws SQLException {995996if((concurrency != ResultSet.CONCUR_READ_ONLY) &&997(concurrency != ResultSet.CONCUR_UPDATABLE)) {998throw new SQLException("Invalid concurrency set. Must be either " +999"ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE.");1000}1001this.concurrency = concurrency;1002}10031004/**1005* Returns a <code>boolean</code> indicating whether this1006* <code>RowSet</code> object is read-only.1007* Any attempts to update a read-only <code>RowSet</code> object will result in an1008* <code>SQLException</code> being thrown. By default,1009* rowsets are updatable if updates are possible.1010*1011* @return <code>true</code> if this <code>RowSet</code> object1012* cannot be updated; <code>false</code> otherwise1013* @see #setConcurrency1014* @see #setReadOnly1015*/1016public boolean isReadOnly() {1017return readOnly;1018};10191020/**1021* Sets this <code>RowSet</code> object's readOnly property to the given <code>boolean</code>.1022*1023* @param value <code>true</code> to indicate that this1024* <code>RowSet</code> object is read-only;1025* <code>false</code> to indicate that it is updatable1026*/1027public void setReadOnly(boolean value) {1028readOnly = value;1029}10301031/**1032* Returns the transaction isolation property for this1033* <code>RowSet</code> object's connection. This property represents1034* the transaction isolation level requested for use in transactions.1035* <P>1036* For <code>RowSet</code> implementations such as1037* the <code>CachedRowSet</code> that operate in a disconnected environment,1038* the <code>SyncProvider</code> object1039* offers complementary locking and data integrity options. The1040* options described below are pertinent only to connected <code>RowSet</code>1041* objects (<code>JdbcRowSet</code> objects).1042*1043* @return one of the following constants:1044* <code>Connection.TRANSACTION_NONE</code>,1045* <code>Connection.TRANSACTION_READ_UNCOMMITTED</code>,1046* <code>Connection.TRANSACTION_READ_COMMITTED</code>,1047* <code>Connection.TRANSACTION_REPEATABLE_READ</code>, or1048* <code>Connection.TRANSACTION_SERIALIZABLE</code>1049* @see javax.sql.rowset.spi.SyncFactory1050* @see javax.sql.rowset.spi.SyncProvider1051* @see #setTransactionIsolation10521053*/1054public int getTransactionIsolation() {1055return isolation;1056};10571058/**1059* Sets the transaction isolation property for this JDBC <code>RowSet</code> object to the given1060* constant. The DBMS will use this transaction isolation level for1061* transactions if it can.1062* <p>1063* For <code>RowSet</code> implementations such as1064* the <code>CachedRowSet</code> that operate in a disconnected environment,1065* the <code>SyncProvider</code> object being used1066* offers complementary locking and data integrity options. The1067* options described below are pertinent only to connected <code>RowSet</code>1068* objects (<code>JdbcRowSet</code> objects).1069*1070* @param level one of the following constants, listed in ascending order:1071* <code>Connection.TRANSACTION_NONE</code>,1072* <code>Connection.TRANSACTION_READ_UNCOMMITTED</code>,1073* <code>Connection.TRANSACTION_READ_COMMITTED</code>,1074* <code>Connection.TRANSACTION_REPEATABLE_READ</code>, or1075* <code>Connection.TRANSACTION_SERIALIZABLE</code>1076* @throws SQLException if the given parameter is not one of the Connection1077* constants1078* @see javax.sql.rowset.spi.SyncFactory1079* @see javax.sql.rowset.spi.SyncProvider1080* @see #getTransactionIsolation1081*/1082public void setTransactionIsolation(int level) throws SQLException {1083if ((level != Connection.TRANSACTION_NONE) &&1084(level != Connection.TRANSACTION_READ_COMMITTED) &&1085(level != Connection.TRANSACTION_READ_UNCOMMITTED) &&1086(level != Connection.TRANSACTION_REPEATABLE_READ) &&1087(level != Connection.TRANSACTION_SERIALIZABLE))1088{1089throw new SQLException("Invalid transaction isolation set. Must " +1090"be either " +1091"Connection.TRANSACTION_NONE or " +1092"Connection.TRANSACTION_READ_UNCOMMITTED or " +1093"Connection.TRANSACTION_READ_COMMITTED or " +1094"Connection.RRANSACTION_REPEATABLE_READ or " +1095"Connection.TRANSACTION_SERIALIZABLE");1096}1097this.isolation = level;1098}10991100/**1101* Retrieves the type map associated with the <code>Connection</code>1102* object for this <code>RowSet</code> object.1103* <P>1104* Drivers that support the JDBC 3.0 API will create1105* <code>Connection</code> objects with an associated type map.1106* This type map, which is initially empty, can contain one or more1107* fully-qualified SQL names and <code>Class</code> objects indicating1108* the class to which the named SQL value will be mapped. The type mapping1109* specified in the connection's type map is used for custom type mapping1110* when no other type map supersedes it.1111* <p>1112* If a type map is explicitly supplied to a method that can perform1113* custom mapping, that type map supersedes the connection's type map.1114*1115* @return the <code>java.util.Map</code> object that is the type map1116* for this <code>RowSet</code> object's connection1117*/1118public java.util.Map<String,Class<?>> getTypeMap() {1119return map;1120}11211122/**1123* Installs the given <code>java.util.Map</code> object as the type map1124* associated with the <code>Connection</code> object for this1125* <code>RowSet</code> object. The custom mapping indicated in1126* this type map will be used unless a different type map is explicitly1127* supplied to a method, in which case the type map supplied will be used.1128*1129* @param map a <code>java.util.Map</code> object that contains the1130* mapping from SQL type names for user defined types (UDT) to classes in1131* the Java programming language. Each entry in the <code>Map</code>1132* object consists of the fully qualified SQL name of a UDT and the1133* <code>Class</code> object for the <code>SQLData</code> implementation1134* of that UDT. May be <code>null</code>.1135*/1136public void setTypeMap(java.util.Map<String,Class<?>> map) {1137this.map = map;1138}11391140/**1141* Retrieves the maximum number of bytes that can be used for a column1142* value in this <code>RowSet</code> object.1143* This limit applies only to columns that hold values of the1144* following types: <code>BINARY</code>, <code>VARBINARY</code>,1145* <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>,1146* and <code>LONGVARCHAR</code>. If the limit is exceeded, the excess1147* data is silently discarded.1148*1149* @return an <code>int</code> indicating the current maximum column size1150* limit; zero means that there is no limit1151* @throws SQLException if an error occurs internally determining the1152* maximum limit of the column size1153*/1154public int getMaxFieldSize() throws SQLException {1155return maxFieldSize;1156}11571158/**1159* Sets the maximum number of bytes that can be used for a column1160* value in this <code>RowSet</code> object to the given number.1161* This limit applies only to columns that hold values of the1162* following types: <code>BINARY</code>, <code>VARBINARY</code>,1163* <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>,1164* and <code>LONGVARCHAR</code>. If the limit is exceeded, the excess1165* data is silently discarded. For maximum portability, it is advisable to1166* use values greater than 256.1167*1168* @param max an <code>int</code> indicating the new maximum column size1169* limit; zero means that there is no limit1170* @throws SQLException if (1) an error occurs internally setting the1171* maximum limit of the column size or (2) a size of less than 0 is set1172*/1173public void setMaxFieldSize(int max) throws SQLException {1174if (max < 0) {1175throw new SQLException("Invalid max field size set. Cannot be of " +1176"value: " + max);1177}1178maxFieldSize = max;1179}11801181/**1182* Retrieves the maximum number of rows that this <code>RowSet</code> object may contain. If1183* this limit is exceeded, the excess rows are silently dropped.1184*1185* @return an <code>int</code> indicating the current maximum number of1186* rows; zero means that there is no limit1187* @throws SQLException if an error occurs internally determining the1188* maximum limit of rows that a <code>Rowset</code> object can contain1189*/1190public int getMaxRows() throws SQLException {1191return maxRows;1192}11931194/**1195* Sets the maximum number of rows that this <code>RowSet</code> object may contain to1196* the given number. If this limit is exceeded, the excess rows are1197* silently dropped.1198*1199* @param max an <code>int</code> indicating the current maximum number1200* of rows; zero means that there is no limit1201* @throws SQLException if an error occurs internally setting the1202* maximum limit on the number of rows that a JDBC <code>RowSet</code> object1203* can contain; or if <i>max</i> is less than <code>0</code>; or1204* if <i>max</i> is less than the <code>fetchSize</code> of the1205* <code>RowSet</code>1206*/1207public void setMaxRows(int max) throws SQLException {1208if (max < 0) {1209throw new SQLException("Invalid max row size set. Cannot be of " +1210"value: " + max);1211} else if (max < this.getFetchSize()) {1212throw new SQLException("Invalid max row size set. Cannot be less " +1213"than the fetchSize.");1214}1215this.maxRows = max;1216}12171218/**1219* Sets to the given <code>boolean</code> whether or not the driver will1220* scan for escape syntax and do escape substitution before sending SQL1221* statements to the database. The default is for the driver to do escape1222* processing.1223* <P>1224* Note: Since <code>PreparedStatement</code> objects have usually been1225* parsed prior to making this call, disabling escape processing for1226* prepared statements will likely have no effect.1227*1228* @param enable <code>true</code> to enable escape processing;1229* <code>false</code> to disable it1230* @throws SQLException if an error occurs setting the underlying JDBC1231* technology-enabled driver to process the escape syntax1232*/1233public void setEscapeProcessing(boolean enable) throws SQLException {1234escapeProcessing = enable;1235}12361237/**1238* Retrieves the maximum number of seconds the driver will wait for a1239* query to execute. If the limit is exceeded, an <code>SQLException</code>1240* is thrown.1241*1242* @return the current query timeout limit in seconds; zero means that1243* there is no limit1244* @throws SQLException if an error occurs in determining the query1245* time-out value1246*/1247public int getQueryTimeout() throws SQLException {1248return queryTimeout;1249}12501251/**1252* Sets to the given number the maximum number of seconds the driver will1253* wait for a query to execute. If the limit is exceeded, an1254* <code>SQLException</code> is thrown.1255*1256* @param seconds the new query time-out limit in seconds; zero means that1257* there is no limit; must not be less than zero1258* @throws SQLException if an error occurs setting the query1259* time-out or if the query time-out value is less than 01260*/1261public void setQueryTimeout(int seconds) throws SQLException {1262if (seconds < 0) {1263throw new SQLException("Invalid query timeout value set. Cannot be " +1264"of value: " + seconds);1265}1266this.queryTimeout = seconds;1267}12681269/**1270* Retrieves a <code>boolean</code> indicating whether rows marked1271* for deletion appear in the set of current rows.1272* The default value is <code>false</code>.1273* <P>1274* Note: Allowing deleted rows to remain visible complicates the behavior1275* of some of the methods. However, most <code>RowSet</code> object users1276* can simply ignore this extra detail because only sophisticated1277* applications will likely want to take advantage of this feature.1278*1279* @return <code>true</code> if deleted rows are visible;1280* <code>false</code> otherwise1281* @throws SQLException if an error occurs determining if deleted rows1282* are visible or not1283* @see #setShowDeleted1284*/1285public boolean getShowDeleted() throws SQLException {1286return showDeleted;1287}12881289/**1290* Sets the property <code>showDeleted</code> to the given1291* <code>boolean</code> value, which determines whether1292* rows marked for deletion appear in the set of current rows.1293*1294* @param value <code>true</code> if deleted rows should be shown;1295* <code>false</code> otherwise1296* @throws SQLException if an error occurs setting whether deleted1297* rows are visible or not1298* @see #getShowDeleted1299*/1300public void setShowDeleted(boolean value) throws SQLException {1301showDeleted = value;1302}13031304/**1305* Ascertains whether escape processing is enabled for this1306* <code>RowSet</code> object.1307*1308* @return <code>true</code> if escape processing is turned on;1309* <code>false</code> otherwise1310* @throws SQLException if an error occurs determining if escape1311* processing is enabled or not or if the internal escape1312* processing trigger has not been enabled1313*/1314public boolean getEscapeProcessing() throws SQLException {1315return escapeProcessing;1316}13171318/**1319* Gives the driver a performance hint as to the direction in1320* which the rows in this <code>RowSet</code> object will be1321* processed. The driver may ignore this hint.1322* <P>1323* A <code>RowSet</code> object inherits the default properties of the1324* <code>ResultSet</code> object from which it got its data. That1325* <code>ResultSet</code> object's default fetch direction is set by1326* the <code>Statement</code> object that created it.1327* <P>1328* This method applies to a <code>RowSet</code> object only while it is1329* connected to a database using a JDBC driver.1330* <p>1331* A <code>RowSet</code> object may use this method at any time to change1332* its setting for the fetch direction.1333*1334* @param direction one of <code>ResultSet.FETCH_FORWARD</code>,1335* <code>ResultSet.FETCH_REVERSE</code>, or1336* <code>ResultSet.FETCH_UNKNOWN</code>1337* @throws SQLException if (1) the <code>RowSet</code> type is1338* <code>TYPE_FORWARD_ONLY</code> and the given fetch direction is not1339* <code>FETCH_FORWARD</code> or (2) the given fetch direction is not1340* one of the following:1341* ResultSet.FETCH_FORWARD,1342* ResultSet.FETCH_REVERSE, or1343* ResultSet.FETCH_UNKNOWN1344* @see #getFetchDirection1345*/1346public void setFetchDirection(int direction) throws SQLException {1347// Changed the condition checking to the below as there were two1348// conditions that had to be checked1349// 1. RowSet is TYPE_FORWARD_ONLY and direction is not FETCH_FORWARD1350// 2. Direction is not one of the valid values13511352if (((getType() == ResultSet.TYPE_FORWARD_ONLY) && (direction != ResultSet.FETCH_FORWARD)) ||1353((direction != ResultSet.FETCH_FORWARD) &&1354(direction != ResultSet.FETCH_REVERSE) &&1355(direction != ResultSet.FETCH_UNKNOWN))) {1356throw new SQLException("Invalid Fetch Direction");1357}1358fetchDir = direction;1359}13601361/**1362* Retrieves this <code>RowSet</code> object's current setting for the1363* fetch direction. The default type is <code>ResultSet.FETCH_FORWARD</code>1364*1365* @return one of <code>ResultSet.FETCH_FORWARD</code>,1366* <code>ResultSet.FETCH_REVERSE</code>, or1367* <code>ResultSet.FETCH_UNKNOWN</code>1368* @throws SQLException if an error occurs in determining the1369* current fetch direction for fetching rows1370* @see #setFetchDirection1371*/1372public int getFetchDirection() throws SQLException {13731374//Added the following code to throw a1375//SQL Exception if the fetchDir is not1376//set properly.Bug id:491415513771378// This checking is not necessary!13791380/*1381if((fetchDir != ResultSet.FETCH_FORWARD) &&1382(fetchDir != ResultSet.FETCH_REVERSE) &&1383(fetchDir != ResultSet.FETCH_UNKNOWN)) {1384throw new SQLException("Fetch Direction Invalid");1385}1386*/1387return (fetchDir);1388}13891390/**1391* Sets the fetch size for this <code>RowSet</code> object to the given number of1392* rows. The fetch size gives a JDBC technology-enabled driver ("JDBC driver")1393* a hint as to the1394* number of rows that should be fetched from the database when more rows1395* are needed for this <code>RowSet</code> object. If the fetch size specified1396* is zero, the driver ignores the value and is free to make its own best guess1397* as to what the fetch size should be.1398* <P>1399* A <code>RowSet</code> object inherits the default properties of the1400* <code>ResultSet</code> object from which it got its data. That1401* <code>ResultSet</code> object's default fetch size is set by1402* the <code>Statement</code> object that created it.1403* <P>1404* This method applies to a <code>RowSet</code> object only while it is1405* connected to a database using a JDBC driver.1406* For connected <code>RowSet</code> implementations such as1407* <code>JdbcRowSet</code>, this method has a direct and immediate effect1408* on the underlying JDBC driver.1409* <P>1410* A <code>RowSet</code> object may use this method at any time to change1411* its setting for the fetch size.1412* <p>1413* For <code>RowSet</code> implementations such as1414* <code>CachedRowSet</code>, which operate in a disconnected environment,1415* the <code>SyncProvider</code> object being used1416* may leverage the fetch size to poll the data source and1417* retrieve a number of rows that do not exceed the fetch size and that may1418* form a subset of the actual rows returned by the original query. This is1419* an implementation variance determined by the specific <code>SyncProvider</code>1420* object employed by the disconnected <code>RowSet</code> object.1421* <P>1422*1423* @param rows the number of rows to fetch; <code>0</code> to let the1424* driver decide what the best fetch size is; must not be less1425* than <code>0</code> or more than the maximum number of rows1426* allowed for this <code>RowSet</code> object (the number returned1427* by a call to the method {@link #getMaxRows})1428* @throws SQLException if the specified fetch size is less than <code>0</code>1429* or more than the limit for the maximum number of rows1430* @see #getFetchSize1431*/1432public void setFetchSize(int rows) throws SQLException {1433//Added this checking as maxRows can be 0 when this function is called1434//maxRows = 0 means rowset can hold any number of rows, os this checking1435// is needed to take care of this condition.1436if (getMaxRows() == 0 && rows >= 0) {1437fetchSize = rows;1438return;1439}1440if ((rows < 0) || (rows > getMaxRows())) {1441throw new SQLException("Invalid fetch size set. Cannot be of " +1442"value: " + rows);1443}1444fetchSize = rows;1445}14461447/**1448* Returns the fetch size for this <code>RowSet</code> object. The default1449* value is zero.1450*1451* @return the number of rows suggested as the fetch size when this <code>RowSet</code> object1452* needs more rows from the database1453* @throws SQLException if an error occurs determining the number of rows in the1454* current fetch size1455* @see #setFetchSize1456*/1457public int getFetchSize() throws SQLException {1458return fetchSize;1459}14601461/**1462* Returns the concurrency for this <code>RowSet</code> object.1463* The default is <code>CONCUR_UPDATABLE</code> for both connected and1464* disconnected <code>RowSet</code> objects.1465* <P>1466* An application can call the method <code>setConcurrency</code> at any time1467* to change a <code>RowSet</code> object's concurrency.1468* <p>1469* @return the concurrency type for this <code>RowSet</code>1470* object, which must be one of the following:1471* <code>ResultSet.CONCUR_READ_ONLY</code> or1472* <code>ResultSet.CONCUR_UPDATABLE</code>1473* @throws SQLException if an error occurs getting the concurrency1474* of this <code>RowSet</code> object1475* @see #setConcurrency1476* @see #isReadOnly1477*/1478public int getConcurrency() throws SQLException {1479return concurrency;1480}14811482//-----------------------------------------------------------------------1483// Parameters1484//-----------------------------------------------------------------------14851486/**1487* Checks the given index to see whether it is less than <code>1</code> and1488* throws an <code>SQLException</code> object if it is.1489* <P>1490* This method is called by many methods internally; it is never1491* called by an application directly.1492*1493* @param idx an <code>int</code> indicating which parameter is to be1494* checked; the first parameter is <code>1</code>1495* @throws SQLException if the parameter is less than <code>1</code>1496*/1497private void checkParamIndex(int idx) throws SQLException {1498if ((idx < 1)) {1499throw new SQLException("Invalid Parameter Index");1500}1501}15021503//---------------------------------------------------------------------1504// setter methods for setting the parameters in a <code>RowSet</code> object's command1505//---------------------------------------------------------------------15061507/**1508* Sets the designated parameter to SQL <code>NULL</code>.1509* Note that the parameter's SQL type must be specified using one of the1510* type codes defined in <code>java.sql.Types</code>. This SQL type is1511* specified in the second parameter.1512* <p>1513* Note that the second parameter tells the DBMS the data type of the value being1514* set to <code>NULL</code>. Some DBMSs require this information, so it is required1515* in order to make code more portable.1516* <P>1517* The parameter value set by this method is stored internally and1518* will be supplied as the appropriate parameter in this <code>RowSet</code>1519* object's command when the method <code>execute</code> is called.1520* Methods such as <code>execute</code> and <code>populate</code> must be1521* provided in any class that extends this class and implements one or1522* more of the standard JSR-114 <code>RowSet</code> interfaces.1523* <P>1524* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method1525* as it is undefined in this class.1526* <P>1527* Calls made to the method <code>getParams</code> after this version of1528* <code>setNull</code>1529* has been called will return an <code>Object</code> array containing the parameter values that1530* have been set. In that array, the element that represents the values1531* set with this method will itself be an array. The first element of that array1532* is <code>null</code>.1533* The second element is the value set for <i>sqlType</i>.1534* The parameter number is indicated by an element's position in the array1535* returned by the method <code>getParams</code>,1536* with the first element being the value for the first placeholder parameter, the1537* second element being the value for the second placeholder parameter, and so on.1538* In other words, if the second placeholder parameter is being set to1539* <code>null</code>, the array containing it will be the second element in1540* the array returned by <code>getParams</code>.1541* <P>1542* Note that because the numbering of elements in an array starts at zero,1543* the array element that corresponds to placeholder parameter number1544* <i>parameterIndex</i> is <i>parameterIndex</i> -1.1545*1546* @param parameterIndex the ordinal number of the placeholder parameter1547* in this <code>RowSet</code> object's command that is to be set.1548* The first parameter is 1, the second is 2, and so on; must be1549* <code>1</code> or greater1550* @param sqlType an <code>int</code> that is one of the SQL type codes1551* defined in the class {@link java.sql.Types}. If a non-standard1552* <i>sqlType</i> is supplied, this method will not throw a1553* <code>SQLException</code>. This allows implicit support for1554* non-standard SQL types.1555* @throws SQLException if a database access error occurs or the given1556* parameter index is out of bounds1557* @see #getParams1558*/1559public void setNull(int parameterIndex, int sqlType) throws SQLException {1560Object nullVal[];1561checkParamIndex(parameterIndex);15621563nullVal = new Object[2];1564nullVal[0] = null;1565nullVal[1] = Integer.valueOf(sqlType);15661567if (params == null){1568throw new SQLException("Set initParams() before setNull");1569}15701571params.put(Integer.valueOf(parameterIndex - 1), nullVal);1572}15731574/**1575* Sets the designated parameter to SQL <code>NULL</code>.1576*1577* Although this version of the method <code>setNull</code> is intended1578* for user-defined1579* and <code>REF</code> parameters, this method may be used to set a null1580* parameter for any JDBC type. The following are user-defined types:1581* <code>STRUCT</code>, <code>DISTINCT</code>, and <code>JAVA_OBJECT</code>,1582* and named array types.1583*1584* <P><B>Note:</B> To be portable, applications must give the1585* SQL type code and the fully qualified SQL type name when specifying1586* a <code>NULL</code> user-defined or <code>REF</code> parameter.1587* In the case of a user-defined type, the name is the type name of1588* the parameter itself. For a <code>REF</code> parameter, the name is1589* the type name of the referenced type. If a JDBC technology-enabled1590* driver does not need the type code or type name information,1591* it may ignore it.1592* <P>1593* If the parameter does not have a user-defined or <code>REF</code> type,1594* the given <code>typeName</code> parameter is ignored.1595* <P>1596* The parameter value set by this method is stored internally and1597* will be supplied as the appropriate parameter in this <code>RowSet</code>1598* object's command when the method <code>execute</code> is called.1599* Methods such as <code>execute</code> and <code>populate</code> must be1600* provided in any class that extends this class and implements one or1601* more of the standard JSR-114 <code>RowSet</code> interfaces.1602* <P>1603* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method1604* as it is undefined in this class.1605* <P>1606* Calls made to the method <code>getParams</code> after this version of1607* <code>setNull</code>1608* has been called will return an <code>Object</code> array containing the parameter values that1609* have been set. In that array, the element that represents the values1610* set with this method will itself be an array. The first element of that array1611* is <code>null</code>.1612* The second element is the value set for <i>sqlType</i>, and the third1613* element is the value set for <i>typeName</i>.1614* The parameter number is indicated by an element's position in the array1615* returned by the method <code>getParams</code>,1616* with the first element being the value for the first placeholder parameter, the1617* second element being the value for the second placeholder parameter, and so on.1618* In other words, if the second placeholder parameter is being set to1619* <code>null</code>, the array containing it will be the second element in1620* the array returned by <code>getParams</code>.1621* <P>1622* Note that because the numbering of elements in an array starts at zero,1623* the array element that corresponds to placeholder parameter number1624* <i>parameterIndex</i> is <i>parameterIndex</i> -1.1625*1626* @param parameterIndex the ordinal number of the placeholder parameter1627* in this <code>RowSet</code> object's command that is to be set.1628* The first parameter is 1, the second is 2, and so on; must be1629* <code>1</code> or greater1630* @param sqlType a value from <code>java.sql.Types</code>1631* @param typeName the fully qualified name of an SQL user-defined type,1632* which is ignored if the parameter is not a user-defined1633* type or <code>REF</code> value1634* @throws SQLException if an error occurs or the given parameter index1635* is out of bounds1636* @see #getParams1637*/1638public void setNull(int parameterIndex, int sqlType, String typeName)1639throws SQLException {16401641Object nullVal[];1642checkParamIndex(parameterIndex);16431644nullVal = new Object[3];1645nullVal[0] = null;1646nullVal[1] = Integer.valueOf(sqlType);1647nullVal[2] = typeName;16481649if(params == null){1650throw new SQLException("Set initParams() before setNull");1651}16521653params.put(Integer.valueOf(parameterIndex - 1), nullVal);1654}165516561657/**1658* Sets the designated parameter to the given <code>boolean</code> in the1659* Java programming language. The driver converts this to an SQL1660* <code>BIT</code> value when it sends it to the database.1661* <P>1662* The parameter value set by this method is stored internally and1663* will be supplied as the appropriate parameter in this <code>RowSet</code>1664* object's command when the method <code>execute</code> is called.1665* Methods such as <code>execute</code>, <code>populate</code> must be1666* provided in any class that extends this class and implements one or1667* more of the standard JSR-114 <code>RowSet</code> interfaces.1668* <p>1669* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method1670* as it is undefined in this class.1671*1672* @param parameterIndex the ordinal number of the placeholder parameter1673* in this <code>RowSet</code> object's command that is to be set.1674* The first parameter is 1, the second is 2, and so on; must be1675* <code>1</code> or greater1676* @param x the parameter value1677* @throws SQLException if an error occurs or the1678* parameter index is out of bounds1679* @see #getParams1680*/1681public void setBoolean(int parameterIndex, boolean x) throws SQLException {1682checkParamIndex(parameterIndex);16831684if(params == null){1685throw new SQLException("Set initParams() before setNull");1686}16871688params.put(Integer.valueOf(parameterIndex - 1), Boolean.valueOf(x));1689}16901691/**1692* Sets the designated parameter to the given <code>byte</code> in the Java1693* programming language. The driver converts this to an SQL1694* <code>TINYINT</code> value when it sends it to the database.1695* <P>1696* The parameter value set by this method is stored internally and1697* will be supplied as the appropriate parameter in this <code>RowSet</code>1698* object's command when the method <code>execute</code> is called.1699* Methods such as <code>execute</code> and <code>populate</code> must be1700* provided in any class that extends this class and implements one or1701* more of the standard JSR-114 <code>RowSet</code> interfaces.1702* <p>1703* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method1704* as it is undefined in this class.1705*1706* @param parameterIndex the ordinal number of the placeholder parameter1707* in this <code>RowSet</code> object's command that is to be set.1708* The first parameter is 1, the second is 2, and so on; must be1709* <code>1</code> or greater1710* @param x the parameter value1711* @throws SQLException if an error occurs or the1712* parameter index is out of bounds1713* @see #getParams1714*/1715public void setByte(int parameterIndex, byte x) throws SQLException {1716checkParamIndex(parameterIndex);17171718if(params == null){1719throw new SQLException("Set initParams() before setByte");1720}17211722params.put(Integer.valueOf(parameterIndex - 1), Byte.valueOf(x));1723}17241725/**1726* Sets the designated parameter to the given <code>short</code> in the1727* Java programming language. The driver converts this to an SQL1728* <code>SMALLINT</code> value when it sends it to the database.1729* <P>1730* The parameter value set by this method is stored internally and1731* will be supplied as the appropriate parameter in this <code>RowSet</code>1732* object's command when the method <code>execute</code> is called.1733* Methods such as <code>execute</code> and <code>populate</code> must be1734* provided in any class that extends this class and implements one or1735* more of the standard JSR-114 <code>RowSet</code> interfaces.1736* <p>1737* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method1738* as it is undefined in this class.1739* <p>1740* @param parameterIndex the ordinal number of the placeholder parameter1741* in this <code>RowSet</code> object's command that is to be set.1742* The first parameter is 1, the second is 2, and so on; must be1743* <code>1</code> or greater1744* @param x the parameter value1745* @throws SQLException if an error occurs or the1746* parameter index is out of bounds1747* @see #getParams1748*/1749public void setShort(int parameterIndex, short x) throws SQLException {1750checkParamIndex(parameterIndex);17511752if(params == null){1753throw new SQLException("Set initParams() before setShort");1754}17551756params.put(Integer.valueOf(parameterIndex - 1), Short.valueOf(x));1757}17581759/**1760* Sets the designated parameter to an <code>int</code> in the Java1761* programming language. The driver converts this to an SQL1762* <code>INTEGER</code> value when it sends it to the database.1763* <P>1764* The parameter value set by this method is stored internally and1765* will be supplied as the appropriate parameter in this <code>RowSet</code>1766* object's command when the method <code>execute</code> is called.1767* Methods such as <code>execute</code> and <code>populate</code> must be1768* provided in any class that extends this class and implements one or1769* more of the standard JSR-114 <code>RowSet</code> interfaces.1770* <P>1771* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method1772* as it is undefined in this class.1773*1774* @param parameterIndex the ordinal number of the placeholder parameter1775* in this <code>RowSet</code> object's command that is to be set.1776* The first parameter is 1, the second is 2, and so on; must be1777* <code>1</code> or greater1778* @param x the parameter value1779* @throws SQLException if an error occurs or the1780* parameter index is out of bounds1781* @see #getParams1782*/1783public void setInt(int parameterIndex, int x) throws SQLException {1784checkParamIndex(parameterIndex);1785if(params == null){1786throw new SQLException("Set initParams() before setInt");1787}1788params.put(Integer.valueOf(parameterIndex - 1), Integer.valueOf(x));1789}17901791/**1792* Sets the designated parameter to the given <code>long</code> in the Java1793* programming language. The driver converts this to an SQL1794* <code>BIGINT</code> value when it sends it to the database.1795* <P>1796* The parameter value set by this method is stored internally and1797* will be supplied as the appropriate parameter in this <code>RowSet</code>1798* object's command when the method <code>execute</code> is called.1799* Methods such as <code>execute</code> and <code>populate</code> must be1800* provided in any class that extends this class and implements one or1801* more of the standard JSR-114 <code>RowSet</code> interfaces.1802* <P>1803* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method1804* as it is undefined in this class.1805*1806* @param parameterIndex the ordinal number of the placeholder parameter1807* in this <code>RowSet</code> object's command that is to be set.1808* The first parameter is 1, the second is 2, and so on; must be1809* <code>1</code> or greater1810* @param x the parameter value1811* @throws SQLException if an error occurs or the1812* parameter index is out of bounds1813* @see #getParams1814*/1815public void setLong(int parameterIndex, long x) throws SQLException {1816checkParamIndex(parameterIndex);1817if(params == null){1818throw new SQLException("Set initParams() before setLong");1819}1820params.put(Integer.valueOf(parameterIndex - 1), Long.valueOf(x));1821}18221823/**1824* Sets the designated parameter to the given <code>float</code> in the1825* Java programming language. The driver converts this to an SQL1826* <code>FLOAT</code> value when it sends it to the database.1827* <P>1828* The parameter value set by this method is stored internally and1829* will be supplied as the appropriate parameter in this <code>RowSet</code>1830* object's command when the method <code>execute</code> is called.1831* Methods such as <code>execute</code> and <code>populate</code> must be1832* provided in any class that extends this class and implements one or1833* more of the standard JSR-114 <code>RowSet</code> interfaces.1834* <P>1835* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method1836* as it is undefined in this class.1837*1838* @param parameterIndex the ordinal number of the placeholder parameter1839* in this <code>RowSet</code> object's command that is to be set.1840* The first parameter is 1, the second is 2, and so on; must be1841* <code>1</code> or greater1842* @param x the parameter value1843* @throws SQLException if an error occurs or the1844* parameter index is out of bounds1845* @see #getParams1846*/1847public void setFloat(int parameterIndex, float x) throws SQLException {1848checkParamIndex(parameterIndex);1849if(params == null){1850throw new SQLException("Set initParams() before setFloat");1851}1852params.put(Integer.valueOf(parameterIndex - 1), Float.valueOf(x));1853}18541855/**1856* Sets the designated parameter to the given <code>double</code> in the1857* Java programming language. The driver converts this to an SQL1858* <code>DOUBLE</code> value when it sends it to the database.1859* <P>1860* The parameter value set by this method is stored internally and1861* will be supplied as the appropriate parameter in this <code>RowSet</code>1862* object's command when the method <code>execute</code> is called.1863* Methods such as <code>execute</code> and <code>populate</code> must be1864* provided in any class that extends this class and implements one or1865* more of the standard JSR-114 <code>RowSet</code> interfaces.1866* <P>1867* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method1868* as it is undefined in this class.1869* S1870* @param parameterIndex the ordinal number of the placeholder parameter1871* in this <code>RowSet</code> object's command that is to be set.1872* The first parameter is 1, the second is 2, and so on; must be1873* <code>1</code> or greater1874* @param x the parameter value1875* @throws SQLException if an error occurs or the1876* parameter index is out of bounds1877* @see #getParams1878*/1879public void setDouble(int parameterIndex, double x) throws SQLException {1880checkParamIndex(parameterIndex);1881if(params == null){1882throw new SQLException("Set initParams() before setDouble");1883}1884params.put(Integer.valueOf(parameterIndex - 1), Double.valueOf(x));1885}18861887/**1888* Sets the designated parameter to the given1889* <code>java.lang.BigDecimal</code> value. The driver converts this to1890* an SQL <code>NUMERIC</code> value when it sends it to the database.1891* <P>1892* The parameter value set by this method is stored internally and1893* will be supplied as the appropriate parameter in this <code>RowSet</code>1894* object's command when the method <code>execute</code> is called.1895* Methods such as <code>execute</code> and <code>populate</code> must be1896* provided in any class that extends this class and implements one or1897* more of the standard JSR-114 <code>RowSet</code> interfaces.1898* <P>1899* Note: <code>JdbcRowSet</code> does not require the <code>populate</code> method1900* as it is undefined in this class.1901*1902* @param parameterIndex the ordinal number of the placeholder parameter1903* in this <code>RowSet</code> object's command that is to be set.1904* The first parameter is 1, the second is 2, and so on; must be1905* <code>1</code> or greater1906* @param x the parameter value1907* @throws SQLException if an error occurs or the1908* parameter index is out of bounds1909* @see #getParams1910*/1911public void setBigDecimal(int parameterIndex, java.math.BigDecimal x) throws SQLException {1912checkParamIndex(parameterIndex);1913if(params == null){1914throw new SQLException("Set initParams() before setBigDecimal");1915}1916params.put(Integer.valueOf(parameterIndex - 1), x);1917}19181919/**1920* Sets the designated parameter to the given <code>String</code>1921* value. The driver converts this to an SQL1922* <code>VARCHAR</code> or <code>LONGVARCHAR</code> value1923* (depending on the argument's size relative to the driver's limits1924* on <code>VARCHAR</code> values) when it sends it to the database.1925* <P>1926* The parameter value set by this method is stored internally and1927* will be supplied as the appropriate parameter in this <code>RowSet</code>1928* object's command when the method <code>execute</code> is called.1929* Methods such as <code>execute</code> and <code>populate</code> must be1930* provided in any class that extends this class and implements one or1931* more of the standard JSR-114 <code>RowSet</code> interfaces.1932* <p>1933* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method1934* as it is undefined in this class.1935* <p>1936* @param parameterIndex the ordinal number of the placeholder parameter1937* in this <code>RowSet</code> object's command that is to be set.1938* The first parameter is 1, the second is 2, and so on; must be1939* <code>1</code> or greater1940* @param x the parameter value1941* @throws SQLException if an error occurs or the1942* parameter index is out of bounds1943* @see #getParams1944*/1945public void setString(int parameterIndex, String x) throws SQLException {1946checkParamIndex(parameterIndex);1947if(params == null){1948throw new SQLException("Set initParams() before setString");1949}1950params.put(Integer.valueOf(parameterIndex - 1), x);1951}19521953/**1954* Sets the designated parameter to the given array of bytes.1955* The driver converts this to an SQL1956* <code>VARBINARY</code> or <code>LONGVARBINARY</code> value1957* (depending on the argument's size relative to the driver's limits1958* on <code>VARBINARY</code> values) when it sends it to the database.1959* <P>1960* The parameter value set by this method is stored internally and1961* will be supplied as the appropriate parameter in this <code>RowSet</code>1962* object's command when the method <code>execute</code> is called.1963* Methods such as <code>execute</code> and <code>populate</code> must be1964* provided in any class that extends this class and implements one or1965* more of the standard JSR-114 <code>RowSet</code> interfaces.1966* <p>1967* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method1968* as it is undefined in this class.1969*1970* @param parameterIndex the ordinal number of the placeholder parameter1971* in this <code>RowSet</code> object's command that is to be set.1972* The first parameter is 1, the second is 2, and so on; must be1973* <code>1</code> or greater1974* @param x the parameter value1975* @throws SQLException if an error occurs or the1976* parameter index is out of bounds1977* @see #getParams1978*/1979public void setBytes(int parameterIndex, byte x[]) throws SQLException {1980checkParamIndex(parameterIndex);1981if(params == null){1982throw new SQLException("Set initParams() before setBytes");1983}1984params.put(Integer.valueOf(parameterIndex - 1), x);1985}19861987/**1988* Sets the designated parameter to the given <code>java.sql.Date</code>1989* value. The driver converts this to an SQL1990* <code>DATE</code> value when it sends it to the database.1991* <P>1992* The parameter value set by this method is stored internally and1993* will be supplied as the appropriate parameter in this <code>RowSet</code>1994* object's command when the method <code>execute</code> is called.1995* Methods such as <code>execute</code> and <code>populate</code> must be1996* provided in any class that extends this class and implements one or1997* more of the standard JSR-114 <code>RowSet</code> interfaces.1998* <P>1999* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2000* as it is undefined in this class.2001* <P>2002* Calls made to the method <code>getParams</code> after this version2003* of <code>setDate</code>2004* has been called will return an array with the value to be set for2005* placeholder parameter number <i>parameterIndex</i> being the <code>Date</code>2006* object supplied as the second parameter.2007* Note that because the numbering of elements in an array starts at zero,2008* the array element that corresponds to placeholder parameter number2009* <i>parameterIndex</i> is <i>parameterIndex</i> -1.2010*2011* @param parameterIndex the ordinal number of the placeholder parameter2012* in this <code>RowSet</code> object's command that is to be set.2013* The first parameter is 1, the second is 2, and so on; must be2014* <code>1</code> or greater2015* @param x the parameter value2016* @throws SQLException if an error occurs or the2017* parameter index is out of bounds2018* @see #getParams2019*/2020public void setDate(int parameterIndex, java.sql.Date x) throws SQLException {2021checkParamIndex(parameterIndex);20222023if(params == null){2024throw new SQLException("Set initParams() before setDate");2025}2026params.put(Integer.valueOf(parameterIndex - 1), x);2027}20282029/**2030* Sets the designated parameter to the given <code>java.sql.Time</code>2031* value. The driver converts this to an SQL <code>TIME</code> value2032* when it sends it to the database.2033* <P>2034* The parameter value set by this method is stored internally and2035* will be supplied as the appropriate parameter in this <code>RowSet</code>2036* object's command when the method <code>execute</code> is called.2037* Methods such as <code>execute</code> and <code>populate</code> must be2038* provided in any class that extends this class and implements one or2039* more of the standard JSR-114 <code>RowSet</code> interfaces.2040* <P>2041* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2042* as it is undefined in this class.2043* <P>2044* Calls made to the method <code>getParams</code> after this version2045* of the method <code>setTime</code>2046* has been called will return an array of the parameters that have been set.2047* The parameter to be set for parameter placeholder number <i>parameterIndex</i>2048* will be the <code>Time</code> object that was set as the second parameter2049* to this method.2050* <P>2051* Note that because the numbering of elements in an array starts at zero,2052* the array element that corresponds to placeholder parameter number2053* <i>parameterIndex</i> is <i>parameterIndex</i> -1.2054*2055* @param parameterIndex the ordinal number of the placeholder parameter2056* in this <code>RowSet</code> object's command that is to be set.2057* The first parameter is 1, the second is 2, and so on; must be2058* <code>1</code> or greater2059* @param x a <code>java.sql.Time</code> object, which is to be set as the value2060* for placeholder parameter <i>parameterIndex</i>2061* @throws SQLException if an error occurs or the2062* parameter index is out of bounds2063* @see #getParams2064*/2065public void setTime(int parameterIndex, java.sql.Time x) throws SQLException {2066checkParamIndex(parameterIndex);2067if(params == null){2068throw new SQLException("Set initParams() before setTime");2069}20702071params.put(Integer.valueOf(parameterIndex - 1), x);2072}20732074/**2075* Sets the designated parameter to the given2076* <code>java.sql.Timestamp</code> value.2077* The driver converts this to an SQL <code>TIMESTAMP</code> value when it2078* sends it to the database.2079* <P>2080* The parameter value set by this method is stored internally and2081* will be supplied as the appropriate parameter in this <code>RowSet</code>2082* object's command when the method <code>execute</code> is called.2083* Methods such as <code>execute</code> and <code>populate</code> must be2084* provided in any class that extends this class and implements one or2085* more of the standard JSR-114 <code>RowSet</code> interfaces.2086* <P>2087* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2088* as it is undefined in this class.2089* <P>2090* Calls made to the method <code>getParams</code> after this version of2091* <code>setTimestamp</code>2092* has been called will return an array with the value for parameter placeholder2093* number <i>parameterIndex</i> being the <code>Timestamp</code> object that was2094* supplied as the second parameter to this method.2095* Note that because the numbering of elements in an array starts at zero,2096* the array element that corresponds to placeholder parameter number2097* <i>parameterIndex</i> is <i>parameterIndex</i> -1.2098*2099* @param parameterIndex the ordinal number of the placeholder parameter2100* in this <code>RowSet</code> object's command that is to be set.2101* The first parameter is 1, the second is 2, and so on; must be2102* <code>1</code> or greater2103* @param x a <code>java.sql.Timestamp</code> object2104* @throws SQLException if an error occurs or the2105* parameter index is out of bounds2106* @see #getParams2107*/2108public void setTimestamp(int parameterIndex, java.sql.Timestamp x) throws SQLException {2109checkParamIndex(parameterIndex);2110if(params == null){2111throw new SQLException("Set initParams() before setTimestamp");2112}21132114params.put(Integer.valueOf(parameterIndex - 1), x);2115}21162117/**2118* Sets the designated parameter to the given2119* <code>java.io.InputStream</code> object,2120* which will have the specified number of bytes.2121* The contents of the stream will be read and sent to the database.2122* This method throws an <code>SQLException</code> object if the number of bytes2123* read and sent to the database is not equal to <i>length</i>.2124* <P>2125* When a very large ASCII value is input to a <code>LONGVARCHAR</code>2126* parameter, it may be more practical to send it via a2127* <code>java.io.InputStream</code> object. A JDBC technology-enabled2128* driver will read the data from the stream as needed until it reaches2129* end-of-file. The driver will do any necessary conversion from ASCII to2130* the database <code>CHAR</code> format.2131*2132* <P><B>Note:</B> This stream object can be either a standard2133* Java stream object or your own subclass that implements the2134* standard interface.2135* <P>2136* The parameter value set by this method is stored internally and2137* will be supplied as the appropriate parameter in this <code>RowSet</code>2138* object's command when the method <code>execute</code> is called.2139* Methods such as <code>execute</code> and <code>populate</code> must be2140* provided in any class that extends this class and implements one or2141* more of the standard JSR-114 <code>RowSet</code> interfaces.2142* <P>2143* Note: <code>JdbcRowSet</code> does not require the <code>populate</code> method2144* as it is undefined in this class.2145* <P>2146* Calls made to the method <code>getParams</code> after <code>setAsciiStream</code>2147* has been called will return an array containing the parameter values that2148* have been set. The element in the array that represents the values2149* set with this method will itself be an array. The first element of that array2150* is the given <code>java.io.InputStream</code> object.2151* The second element is the value set for <i>length</i>.2152* The third element is an internal <code>BaseRowSet</code> constant2153* specifying that the stream passed to this method is an ASCII stream.2154* The parameter number is indicated by an element's position in the array2155* returned by the method <code>getParams</code>,2156* with the first element being the value for the first placeholder parameter, the2157* second element being the value for the second placeholder parameter, and so on.2158* In other words, if the input stream being set is the value for the second2159* placeholder parameter, the array containing it will be the second element in2160* the array returned by <code>getParams</code>.2161* <P>2162* Note that because the numbering of elements in an array starts at zero,2163* the array element that corresponds to placeholder parameter number2164* <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.2165*2166* @param parameterIndex the ordinal number of the placeholder parameter2167* in this <code>RowSet</code> object's command that is to be set.2168* The first parameter is 1, the second is 2, and so on; must be2169* <code>1</code> or greater2170* @param x the Java input stream that contains the ASCII parameter value2171* @param length the number of bytes in the stream. This is the number of bytes2172* the driver will send to the DBMS; lengths of 0 or less are2173* are undefined but will cause an invalid length exception to be2174* thrown in the underlying JDBC driver.2175* @throws SQLException if an error occurs, the parameter index is out of bounds,2176* or when connected to a data source, the number of bytes the driver reads2177* and sends to the database is not equal to the number of bytes specified2178* in <i>length</i>2179* @see #getParams2180*/2181public void setAsciiStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException {2182Object asciiStream[];2183checkParamIndex(parameterIndex);21842185asciiStream = new Object[3];2186asciiStream[0] = x;2187asciiStream[1] = Integer.valueOf(length);2188asciiStream[2] = Integer.valueOf(ASCII_STREAM_PARAM);21892190if(params == null){2191throw new SQLException("Set initParams() before setAsciiStream");2192}21932194params.put(Integer.valueOf(parameterIndex - 1), asciiStream);2195}21962197/**2198* Sets the designated parameter in this <code>RowSet</code> object's command2199* to the given input stream.2200* When a very large ASCII value is input to a <code>LONGVARCHAR</code>2201* parameter, it may be more practical to send it via a2202* <code>java.io.InputStream</code>. Data will be read from the stream2203* as needed until end-of-file is reached. The JDBC driver will2204* do any necessary conversion from ASCII to the database char format.2205*2206* <P><B>Note:</B> This stream object can either be a standard2207* Java stream object or your own subclass that implements the2208* standard interface.2209* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2210* it might be more efficient to use a version of2211* <code>setAsciiStream</code> which takes a length parameter.2212*2213* @param parameterIndex the first parameter is 1, the second is 2, ...2214* @param x the Java input stream that contains the ASCII parameter value2215* @exception SQLException if a database access error occurs or2216* this method is called on a closed <code>PreparedStatement</code>2217* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2218* @since 1.62219*/2220public void setAsciiStream(int parameterIndex, java.io.InputStream x)2221throws SQLException {2222throw new SQLFeatureNotSupportedException("Feature not supported");2223}22242225/**2226* Sets the designated parameter to the given <code>java.io.InputStream</code>2227* object, which will have the specified number of bytes.2228* The contents of the stream will be read and sent to the database.2229* This method throws an <code>SQLException</code> object if the number of bytes2230* read and sent to the database is not equal to <i>length</i>.2231* <P>2232* When a very large binary value is input to a2233* <code>LONGVARBINARY</code> parameter, it may be more practical2234* to send it via a <code>java.io.InputStream</code> object.2235* A JDBC technology-enabled driver will read the data from the2236* stream as needed until it reaches end-of-file.2237*2238* <P><B>Note:</B> This stream object can be either a standard2239* Java stream object or your own subclass that implements the2240* standard interface.2241* <P>2242* The parameter value set by this method is stored internally and2243* will be supplied as the appropriate parameter in this <code>RowSet</code>2244* object's command when the method <code>execute</code> is called.2245* Methods such as <code>execute</code> and <code>populate</code> must be2246* provided in any class that extends this class and implements one or2247* more of the standard JSR-114 <code>RowSet</code> interfaces.2248*<P>2249* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2250* as it is undefined in this class.2251* <P>2252* Calls made to the method <code>getParams</code> after <code>setBinaryStream</code>2253* has been called will return an array containing the parameter values that2254* have been set. In that array, the element that represents the values2255* set with this method will itself be an array. The first element of that array2256* is the given <code>java.io.InputStream</code> object.2257* The second element is the value set for <i>length</i>.2258* The third element is an internal <code>BaseRowSet</code> constant2259* specifying that the stream passed to this method is a binary stream.2260* The parameter number is indicated by an element's position in the array2261* returned by the method <code>getParams</code>,2262* with the first element being the value for the first placeholder parameter, the2263* second element being the value for the second placeholder parameter, and so on.2264* In other words, if the input stream being set is the value for the second2265* placeholder parameter, the array containing it will be the second element in2266* the array returned by <code>getParams</code>.2267* <P>2268* Note that because the numbering of elements in an array starts at zero,2269* the array element that corresponds to placeholder parameter number2270* <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.2271*2272* @param parameterIndex the ordinal number of the placeholder parameter2273* in this <code>RowSet</code> object's command that is to be set.2274* The first parameter is 1, the second is 2, and so on; must be2275* <code>1</code> or greater2276* @param x the input stream that contains the binary value to be set2277* @param length the number of bytes in the stream; lengths of 0 or less are2278* are undefined but will cause an invalid length exception to be2279* thrown in the underlying JDBC driver.2280* @throws SQLException if an error occurs, the parameter index is out of bounds,2281* or when connected to a data source, the number of bytes the driver2282* reads and sends to the database is not equal to the number of bytes2283* specified in <i>length</i>2284* @see #getParams2285*/2286public void setBinaryStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException {2287Object binaryStream[];2288checkParamIndex(parameterIndex);22892290binaryStream = new Object[3];2291binaryStream[0] = x;2292binaryStream[1] = Integer.valueOf(length);2293binaryStream[2] = Integer.valueOf(BINARY_STREAM_PARAM);2294if(params == null){2295throw new SQLException("Set initParams() before setBinaryStream");2296}22972298params.put(Integer.valueOf(parameterIndex - 1), binaryStream);2299}230023012302/**2303* Sets the designated parameter in this <code>RowSet</code> object's command2304* to the given input stream.2305* When a very large binary value is input to a <code>LONGVARBINARY</code>2306* parameter, it may be more practical to send it via a2307* <code>java.io.InputStream</code> object. The data will be read from the2308* stream as needed until end-of-file is reached.2309*2310* <P><B>Note:</B> This stream object can either be a standard2311* Java stream object or your own subclass that implements the2312* standard interface.2313* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2314* it might be more efficient to use a version of2315* <code>setBinaryStream</code> which takes a length parameter.2316*2317* @param parameterIndex the first parameter is 1, the second is 2, ...2318* @param x the java input stream which contains the binary parameter value2319* @exception SQLException if a database access error occurs or2320* this method is called on a closed <code>PreparedStatement</code>2321* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2322* @since 1.62323*/2324public void setBinaryStream(int parameterIndex, java.io.InputStream x)2325throws SQLException {2326throw new SQLFeatureNotSupportedException("Feature not supported");2327}232823292330/**2331* Sets the designated parameter to the given2332* <code>java.io.InputStream</code> object, which will have the specified2333* number of bytes. The contents of the stream will be read and sent2334* to the database.2335* This method throws an <code>SQLException</code> if the number of bytes2336* read and sent to the database is not equal to <i>length</i>.2337* <P>2338* When a very large Unicode value is input to a2339* <code>LONGVARCHAR</code> parameter, it may be more practical2340* to send it via a <code>java.io.InputStream</code> object.2341* A JDBC technology-enabled driver will read the data from the2342* stream as needed, until it reaches end-of-file.2343* The driver will do any necessary conversion from Unicode to the2344* database <code>CHAR</code> format.2345* The byte format of the Unicode stream must be Java UTF-8, as2346* defined in the Java Virtual Machine Specification.2347*2348* <P><B>Note:</B> This stream object can be either a standard2349* Java stream object or your own subclass that implements the2350* standard interface.2351* <P>2352* This method is deprecated; the method <code>getCharacterStream</code>2353* should be used in its place.2354* <P>2355* The parameter value set by this method is stored internally and2356* will be supplied as the appropriate parameter in this <code>RowSet</code>2357* object's command when the method <code>execute</code> is called.2358* Calls made to the method <code>getParams</code> after <code>setUnicodeStream</code>2359* has been called will return an array containing the parameter values that2360* have been set. In that array, the element that represents the values2361* set with this method will itself be an array. The first element of that array2362* is the given <code>java.io.InputStream</code> object.2363* The second element is the value set for <i>length</i>.2364* The third element is an internal <code>BaseRowSet</code> constant2365* specifying that the stream passed to this method is a Unicode stream.2366* The parameter number is indicated by an element's position in the array2367* returned by the method <code>getParams</code>,2368* with the first element being the value for the first placeholder parameter, the2369* second element being the value for the second placeholder parameter, and so on.2370* In other words, if the input stream being set is the value for the second2371* placeholder parameter, the array containing it will be the second element in2372* the array returned by <code>getParams</code>.2373* <P>2374* Note that because the numbering of elements in an array starts at zero,2375* the array element that corresponds to placeholder parameter number2376* <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.2377*2378* @param parameterIndex the ordinal number of the placeholder parameter2379* in this <code>RowSet</code> object's command that is to be set.2380* The first parameter is 1, the second is 2, and so on; must be2381* <code>1</code> or greater2382* @param x the <code>java.io.InputStream</code> object that contains the2383* UNICODE parameter value2384* @param length the number of bytes in the input stream2385* @throws SQLException if an error occurs, the parameter index is out of bounds,2386* or the number of bytes the driver reads and sends to the database is2387* not equal to the number of bytes specified in <i>length</i>2388* @deprecated getCharacterStream should be used in its place2389* @see #getParams2390*/2391@Deprecated2392public void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException {2393Object unicodeStream[];2394checkParamIndex(parameterIndex);23952396unicodeStream = new Object[3];2397unicodeStream[0] = x;2398unicodeStream[1] = Integer.valueOf(length);2399unicodeStream[2] = Integer.valueOf(UNICODE_STREAM_PARAM);2400if(params == null){2401throw new SQLException("Set initParams() before setUnicodeStream");2402}2403params.put(Integer.valueOf(parameterIndex - 1), unicodeStream);2404}24052406/**2407* Sets the designated parameter to the given <code>java.io.Reader</code>2408* object, which will have the specified number of characters. The2409* contents of the reader will be read and sent to the database.2410* This method throws an <code>SQLException</code> if the number of bytes2411* read and sent to the database is not equal to <i>length</i>.2412* <P>2413* When a very large Unicode value is input to a2414* <code>LONGVARCHAR</code> parameter, it may be more practical2415* to send it via a <code>Reader</code> object.2416* A JDBC technology-enabled driver will read the data from the2417* stream as needed until it reaches end-of-file.2418* The driver will do any necessary conversion from Unicode to the2419* database <code>CHAR</code> format.2420* The byte format of the Unicode stream must be Java UTF-8, as2421* defined in the Java Virtual Machine Specification.2422*2423* <P><B>Note:</B> This stream object can be either a standard2424* Java stream object or your own subclass that implements the2425* standard interface.2426* <P>2427* The parameter value set by this method is stored internally and2428* will be supplied as the appropriate parameter in this <code>RowSet</code>2429* object's command when the method <code>execute</code> is called.2430* Methods such as <code>execute</code> and <code>populate</code> must be2431* provided in any class that extends this class and implements one or2432* more of the standard JSR-114 <code>RowSet</code> interfaces.2433* <P>2434* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2435* as it is undefined in this class.2436* <P>2437* Calls made to the method <code>getParams</code> after2438* <code>setCharacterStream</code>2439* has been called will return an array containing the parameter values that2440* have been set. In that array, the element that represents the values2441* set with this method will itself be an array. The first element of that array2442* is the given <code>java.io.Reader</code> object.2443* The second element is the value set for <i>length</i>.2444* The parameter number is indicated by an element's position in the array2445* returned by the method <code>getParams</code>,2446* with the first element being the value for the first placeholder parameter, the2447* second element being the value for the second placeholder parameter, and so on.2448* In other words, if the reader being set is the value for the second2449* placeholder parameter, the array containing it will be the second element in2450* the array returned by <code>getParams</code>.2451* <P>2452* Note that because the numbering of elements in an array starts at zero,2453* the array element that corresponds to placeholder parameter number2454* <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.2455*2456* @param parameterIndex the ordinal number of the placeholder parameter2457* in this <code>RowSet</code> object's command that is to be set.2458* The first parameter is 1, the second is 2, and so on; must be2459* <code>1</code> or greater2460* @param reader the <code>Reader</code> object that contains the2461* Unicode data2462* @param length the number of characters in the stream; lengths of 0 or2463* less are undefined but will cause an invalid length exception to2464* be thrown in the underlying JDBC driver.2465* @throws SQLException if an error occurs, the parameter index is out of bounds,2466* or when connected to a data source, the number of bytes the driver2467* reads and sends to the database is not equal to the number of bytes2468* specified in <i>length</i>2469* @see #getParams2470*/2471public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException {2472Object charStream[];2473checkParamIndex(parameterIndex);24742475charStream = new Object[2];2476charStream[0] = reader;2477charStream[1] = Integer.valueOf(length);2478if(params == null){2479throw new SQLException("Set initParams() before setCharacterStream");2480}2481params.put(Integer.valueOf(parameterIndex - 1), charStream);2482}24832484/**2485* Sets the designated parameter in this <code>RowSet</code> object's command2486* to the given <code>Reader</code>2487* object.2488* When a very large UNICODE value is input to a <code>LONGVARCHAR</code>2489* parameter, it may be more practical to send it via a2490* <code>java.io.Reader</code> object. The data will be read from the stream2491* as needed until end-of-file is reached. The JDBC driver will2492* do any necessary conversion from UNICODE to the database char format.2493*2494* <P><B>Note:</B> This stream object can either be a standard2495* Java stream object or your own subclass that implements the2496* standard interface.2497* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2498* it might be more efficient to use a version of2499* <code>setCharacterStream</code> which takes a length parameter.2500*2501* @param parameterIndex the first parameter is 1, the second is 2, ...2502* @param reader the <code>java.io.Reader</code> object that contains the2503* Unicode data2504* @exception SQLException if a database access error occurs or2505* this method is called on a closed <code>PreparedStatement</code>2506* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2507* @since 1.62508*/2509public void setCharacterStream(int parameterIndex,2510java.io.Reader reader) throws SQLException {2511throw new SQLFeatureNotSupportedException("Feature not supported");2512}25132514/**2515* Sets the designated parameter to an <code>Object</code> in the Java2516* programming language. The second parameter must be an2517* <code>Object</code> type. For integral values, the2518* <code>java.lang</code> equivalent2519* objects should be used. For example, use the class <code>Integer</code>2520* for an <code>int</code>.2521* <P>2522* The driver converts this object to the specified2523* target SQL type before sending it to the database.2524* If the object has a custom mapping (is of a class implementing2525* <code>SQLData</code>), the driver should call the method2526* <code>SQLData.writeSQL</code> to write the object to the SQL2527* data stream. If, on the other hand, the object is of a class2528* implementing <code>Ref</code>, <code>Blob</code>, <code>Clob</code>,2529* <code>Struct</code>, or <code>Array</code>,2530* the driver should pass it to the database as a value of the2531* corresponding SQL type.2532*2533* <p>Note that this method may be used to pass database-2534* specific abstract data types.2535* <P>2536* The parameter value set by this method is stored internally and2537* will be supplied as the appropriate parameter in this <code>RowSet</code>2538* object's command when the method <code>execute</code> is called.2539* Methods such as <code>execute</code> and <code>populate</code> must be2540* provided in any class that extends this class and implements one or2541* more of the standard JSR-114 <code>RowSet</code> interfaces.2542* <P>2543* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2544* as it is undefined in this class.2545* <P>2546* Calls made to the method <code>getParams</code> after this version of2547* <code>setObject</code>2548* has been called will return an array containing the parameter values that2549* have been set. In that array, the element that represents the values2550* set with this method will itself be an array. The first element of that array2551* is the given <code>Object</code> instance, and the2552* second element is the value set for <i>targetSqlType</i>. The2553* third element is the value set for <i>scale</i>, which the driver will2554* ignore if the type of the object being set is not2555* <code>java.sql.Types.NUMERIC</code> or <code>java.sql.Types.DECIMAL</code>.2556* The parameter number is indicated by an element's position in the array2557* returned by the method <code>getParams</code>,2558* with the first element being the value for the first placeholder parameter, the2559* second element being the value for the second placeholder parameter, and so on.2560* In other words, if the object being set is the value for the second2561* placeholder parameter, the array containing it will be the second element in2562* the array returned by <code>getParams</code>.2563*<P>2564* Note that because the numbering of elements in an array starts at zero,2565* the array element that corresponds to placeholder parameter number2566* <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.2567*2568*2569* @param parameterIndex the ordinal number of the placeholder parameter2570* in this <code>RowSet</code> object's command that is to be set.2571* The first parameter is 1, the second is 2, and so on; must be2572* <code>1</code> or greater2573* @param x the <code>Object</code> containing the input parameter value;2574* must be an <code>Object</code> type2575* @param targetSqlType the SQL type (as defined in <code>java.sql.Types</code>)2576* to be sent to the database. The <code>scale</code> argument may2577* further qualify this type. If a non-standard <i>targetSqlType</i>2578* is supplied, this method will not throw a <code>SQLException</code>.2579* This allows implicit support for non-standard SQL types.2580* @param scale for the types <code>java.sql.Types.DECIMAL</code> and2581* <code>java.sql.Types.NUMERIC</code>, this is the number2582* of digits after the decimal point. For all other types, this2583* value will be ignored.2584* @throws SQLException if an error occurs or the parameter index is out of bounds2585* @see #getParams2586*/2587public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException {2588Object obj[];2589checkParamIndex(parameterIndex);25902591obj = new Object[3];2592obj[0] = x;2593obj[1] = Integer.valueOf(targetSqlType);2594obj[2] = Integer.valueOf(scale);2595if(params == null){2596throw new SQLException("Set initParams() before setObject");2597}2598params.put(Integer.valueOf(parameterIndex - 1), obj);2599}26002601/**2602* Sets the value of the designated parameter with the given2603* <code>Object</code> value.2604* This method is like <code>setObject(int parameterIndex, Object x, int2605* targetSqlType, int scale)</code> except that it assumes a scale of zero.2606* <P>2607* The parameter value set by this method is stored internally and2608* will be supplied as the appropriate parameter in this <code>RowSet</code>2609* object's command when the method <code>execute</code> is called.2610* Methods such as <code>execute</code> and <code>populate</code> must be2611* provided in any class that extends this class and implements one or2612* more of the standard JSR-114 <code>RowSet</code> interfaces.2613* <P>2614* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2615* as it is undefined in this class.2616* <P>2617* Calls made to the method <code>getParams</code> after this version of2618* <code>setObject</code>2619* has been called will return an array containing the parameter values that2620* have been set. In that array, the element that represents the values2621* set with this method will itself be an array. The first element of that array2622* is the given <code>Object</code> instance.2623* The second element is the value set for <i>targetSqlType</i>.2624* The parameter number is indicated by an element's position in the array2625* returned by the method <code>getParams</code>,2626* with the first element being the value for the first placeholder parameter, the2627* second element being the value for the second placeholder parameter, and so on.2628* In other words, if the object being set is the value for the second2629* placeholder parameter, the array containing it will be the second element in2630* the array returned by <code>getParams</code>.2631* <P>2632* Note that because the numbering of elements in an array starts at zero,2633* the array element that corresponds to placeholder parameter number2634* <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.2635*2636* @param parameterIndex the ordinal number of the placeholder parameter2637* in this <code>RowSet</code> object's command that is to be set.2638* The first parameter is 1, the second is 2, and so on; must be2639* <code>1</code> or greater2640* @param x the <code>Object</code> containing the input parameter value;2641* must be an <code>Object</code> type2642* @param targetSqlType the SQL type (as defined in <code>java.sql.Types</code>)2643* to be sent to the database. If a non-standard <i>targetSqlType</i>2644* is supplied, this method will not throw a <code>SQLException</code>.2645* This allows implicit support for non-standard SQL types.2646* @throws SQLException if an error occurs or the parameter index2647* is out of bounds2648* @see #getParams2649*/2650public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException {2651Object obj[];2652checkParamIndex(parameterIndex);26532654obj = new Object[2];2655obj[0] = x;2656obj[1] = Integer.valueOf(targetSqlType);2657if (params == null){2658throw new SQLException("Set initParams() before setObject");2659}2660params.put(Integer.valueOf(parameterIndex - 1), obj);2661}26622663/**2664* Sets the designated parameter to an <code>Object</code> in the Java2665* programming language. The second parameter must be an2666* <code>Object</code>2667* type. For integral values, the <code>java.lang</code> equivalent2668* objects should be used. For example, use the class <code>Integer</code>2669* for an <code>int</code>.2670* <P>2671* The JDBC specification defines a standard mapping from2672* Java <code>Object</code> types to SQL types. The driver will2673* use this standard mapping to convert the given object2674* to its corresponding SQL type before sending it to the database.2675* If the object has a custom mapping (is of a class implementing2676* <code>SQLData</code>), the driver should call the method2677* <code>SQLData.writeSQL</code> to write the object to the SQL2678* data stream.2679* <P>2680* If, on the other hand, the object is of a class2681* implementing <code>Ref</code>, <code>Blob</code>, <code>Clob</code>,2682* <code>Struct</code>, or <code>Array</code>,2683* the driver should pass it to the database as a value of the2684* corresponding SQL type.2685* <P>2686* This method throws an exception if there2687* is an ambiguity, for example, if the object is of a class2688* implementing more than one interface.2689* <P>2690* Note that this method may be used to pass database-specific2691* abstract data types.2692* <P>2693* The parameter value set by this method is stored internally and2694* will be supplied as the appropriate parameter in this <code>RowSet</code>2695* object's command when the method <code>execute</code> is called.2696* Methods such as <code>execute</code> and <code>populate</code> must be2697* provided in any class that extends this class and implements one or2698* more of the standard JSR-114 <code>RowSet</code> interfaces.2699* <p>2700* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2701* as it is undefined in this class.2702* <P>2703* After this method has been called, a call to the2704* method <code>getParams</code>2705* will return an object array of the current command parameters, which will2706* include the <code>Object</code> set for placeholder parameter number2707* <code>parameterIndex</code>.2708* Note that because the numbering of elements in an array starts at zero,2709* the array element that corresponds to placeholder parameter number2710* <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.2711*2712* @param parameterIndex the ordinal number of the placeholder parameter2713* in this <code>RowSet</code> object's command that is to be set.2714* The first parameter is 1, the second is 2, and so on; must be2715* <code>1</code> or greater2716* @param x the object containing the input parameter value2717* @throws SQLException if an error occurs the2718* parameter index is out of bounds, or there2719* is ambiguity in the implementation of the2720* object being set2721* @see #getParams2722*/2723public void setObject(int parameterIndex, Object x) throws SQLException {2724checkParamIndex(parameterIndex);2725if (params == null) {2726throw new SQLException("Set initParams() before setObject");2727}2728params.put(Integer.valueOf(parameterIndex - 1), x);2729}27302731/**2732* Sets the designated parameter to the given <code>Ref</code> object in2733* the Java programming language. The driver converts this to an SQL2734* <code>REF</code> value when it sends it to the database. Internally, the2735* <code>Ref</code> is represented as a <code>SerialRef</code> to ensure2736* serializability.2737* <P>2738* The parameter value set by this method is stored internally and2739* will be supplied as the appropriate parameter in this <code>RowSet</code>2740* object's command when the method <code>execute</code> is called.2741* Methods such as <code>execute</code> and <code>populate</code> must be2742* provided in any class that extends this class and implements one or2743* more of the standard JSR-114 <code>RowSet</code> interfaces.2744* <p>2745* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2746* as it is undefined in this class.2747* <p>2748* After this method has been called, a call to the2749* method <code>getParams</code>2750* will return an object array of the current command parameters, which will2751* include the <code>Ref</code> object set for placeholder parameter number2752* <code>parameterIndex</code>.2753* Note that because the numbering of elements in an array starts at zero,2754* the array element that corresponds to placeholder parameter number2755* <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.2756*2757* @param parameterIndex the ordinal number of the placeholder parameter2758* in this <code>RowSet</code> object's command that is to be set.2759* The first parameter is 1, the second is 2, and so on; must be2760* <code>1</code> or greater2761* @param ref a <code>Ref</code> object representing an SQL <code>REF</code>2762* value; cannot be null2763* @throws SQLException if an error occurs; the parameter index is out of2764* bounds or the <code>Ref</code> object is <code>null</code>; or2765* the <code>Ref</code> object returns a <code>null</code> base type2766* name.2767* @see #getParams2768* @see javax.sql.rowset.serial.SerialRef2769*/2770public void setRef (int parameterIndex, Ref ref) throws SQLException {2771checkParamIndex(parameterIndex);2772if (params == null) {2773throw new SQLException("Set initParams() before setRef");2774}2775params.put(Integer.valueOf(parameterIndex - 1), new SerialRef(ref));2776}27772778/**2779* Sets the designated parameter to the given <code>Blob</code> object in2780* the Java programming language. The driver converts this to an SQL2781* <code>BLOB</code> value when it sends it to the database. Internally,2782* the <code>Blob</code> is represented as a <code>SerialBlob</code>2783* to ensure serializability.2784* <P>2785* The parameter value set by this method is stored internally and2786* will be supplied as the appropriate parameter in this <code>RowSet</code>2787* object's command when the method <code>execute</code> is called.2788* Methods such as <code>execute</code> and <code>populate</code> must be2789* provided in any class that extends this class and implements one or2790* more of the standard JSR-114 <code>RowSet</code> interfaces.2791* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2792* as it is undefined in this class.2793* <p>2794* After this method has been called, a call to the2795* method <code>getParams</code>2796* will return an object array of the current command parameters, which will2797* include the <code>Blob</code> object set for placeholder parameter number2798* <code>parameterIndex</code>.2799* Note that because the numbering of elements in an array starts at zero,2800* the array element that corresponds to placeholder parameter number2801* <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.2802*2803* @param parameterIndex the ordinal number of the placeholder parameter2804* in this <code>RowSet</code> object's command that is to be set.2805* The first parameter is 1, the second is 2, and so on; must be2806* <code>1</code> or greater2807* @param x a <code>Blob</code> object representing an SQL2808* <code>BLOB</code> value2809* @throws SQLException if an error occurs or the2810* parameter index is out of bounds2811* @see #getParams2812* @see javax.sql.rowset.serial.SerialBlob2813*/2814public void setBlob (int parameterIndex, Blob x) throws SQLException {2815checkParamIndex(parameterIndex);2816if(params == null){2817throw new SQLException("Set initParams() before setBlob");2818}2819params.put(Integer.valueOf(parameterIndex - 1), new SerialBlob(x));2820}28212822/**2823* Sets the designated parameter to the given <code>Clob</code> object in2824* the Java programming language. The driver converts this to an SQL2825* <code>CLOB</code> value when it sends it to the database. Internally, the2826* <code>Clob</code> is represented as a <code>SerialClob</code> to ensure2827* serializability.2828* <P>2829* The parameter value set by this method is stored internally and2830* will be supplied as the appropriate parameter in this <code>RowSet</code>2831* object's command when the method <code>execute</code> is called.2832* Methods such as <code>execute</code> and <code>populate</code> must be2833* provided in any class that extends this class and implements one or2834* more of the standard JSR-114 <code>RowSet</code> interfaces.2835* <p>2836* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2837* as it is undefined in this class.2838* <p>2839* After this method has been called, a call to the2840* method <code>getParams</code>2841* will return an object array of the current command parameters, which will2842* include the <code>Clob</code> object set for placeholder parameter number2843* <code>parameterIndex</code>.2844* Note that because the numbering of elements in an array starts at zero,2845* the array element that corresponds to placeholder parameter number2846* <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.2847*2848* @param parameterIndex the ordinal number of the placeholder parameter2849* in this <code>RowSet</code> object's command that is to be set.2850* The first parameter is 1, the second is 2, and so on; must be2851* <code>1</code> or greater2852* @param x a <code>Clob</code> object representing an SQL2853* <code>CLOB</code> value; cannot be null2854* @throws SQLException if an error occurs; the parameter index is out of2855* bounds or the <code>Clob</code> is null2856* @see #getParams2857* @see javax.sql.rowset.serial.SerialBlob2858*/2859public void setClob (int parameterIndex, Clob x) throws SQLException {2860checkParamIndex(parameterIndex);2861if(params == null){2862throw new SQLException("Set initParams() before setClob");2863}2864params.put(Integer.valueOf(parameterIndex - 1), new SerialClob(x));2865}28662867/**2868* Sets the designated parameter to an <code>Array</code> object in the2869* Java programming language. The driver converts this to an SQL2870* <code>ARRAY</code> value when it sends it to the database. Internally,2871* the <code>Array</code> is represented as a <code>SerialArray</code>2872* to ensure serializability.2873* <P>2874* The parameter value set by this method is stored internally and2875* will be supplied as the appropriate parameter in this <code>RowSet</code>2876* object's command when the method <code>execute</code> is called.2877* Methods such as <code>execute</code> and <code>populate</code> must be2878* provided in any class that extends this class and implements one or2879* more of the standard JSR-114 <code>RowSet</code> interfaces.2880* <P>2881* Note: <code>JdbcRowSet</code> does not require the <code>populate</code> method2882* as it is undefined in this class.2883* <p>2884* After this method has been called, a call to the2885* method <code>getParams</code>2886* will return an object array of the current command parameters, which will2887* include the <code>Array</code> object set for placeholder parameter number2888* <code>parameterIndex</code>.2889* Note that because the numbering of elements in an array starts at zero,2890* the array element that corresponds to placeholder parameter number2891* <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.2892*2893* @param parameterIndex the ordinal number of the placeholder parameter2894* in this <code>RowSet</code> object's command that is to be set.2895* The first parameter is 1, the second is 2, and so on; must be2896* <code>1</code> or greater2897* @param array an <code>Array</code> object representing an SQL2898* <code>ARRAY</code> value; cannot be null. The <code>Array</code> object2899* passed to this method must return a non-null Object for all2900* <code>getArray()</code> method calls. A null value will cause a2901* <code>SQLException</code> to be thrown.2902* @throws SQLException if an error occurs; the parameter index is out of2903* bounds or the <code>ARRAY</code> is null2904* @see #getParams2905* @see javax.sql.rowset.serial.SerialArray2906*/2907public void setArray (int parameterIndex, Array array) throws SQLException {2908checkParamIndex(parameterIndex);2909if (params == null){2910throw new SQLException("Set initParams() before setArray");2911}2912params.put(Integer.valueOf(parameterIndex - 1), new SerialArray(array));2913}29142915/**2916* Sets the designated parameter to the given <code>java.sql.Date</code>2917* object.2918* When the DBMS does not store time zone information, the driver will use2919* the given <code>Calendar</code> object to construct the SQL <code>DATE</code>2920* value to send to the database. With a2921* <code>Calendar</code> object, the driver can calculate the date2922* taking into account a custom time zone. If no <code>Calendar</code>2923* object is specified, the driver uses the time zone of the Virtual Machine2924* that is running the application.2925* <P>2926* The parameter value set by this method is stored internally and2927* will be supplied as the appropriate parameter in this <code>RowSet</code>2928* object's command when the method <code>execute</code> is called.2929* Methods such as <code>execute</code> and <code>populate</code> must be2930* provided in any class that extends this class and implements one or2931* more of the standard JSR-114 <code>RowSet</code> interfaces.2932* <P>2933* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2934* as it is undefined in this class.2935* <P>2936* Calls made to the method <code>getParams</code> after this version of2937* <code>setDate</code>2938* has been called will return an array containing the parameter values that2939* have been set. In that array, the element that represents the values2940* set with this method will itself be an array. The first element of that array2941* is the given <code>java.sql.Date</code> object.2942* The second element is the value set for <i>cal</i>.2943* The parameter number is indicated by an element's position in the array2944* returned by the method <code>getParams</code>,2945* with the first element being the value for the first placeholder parameter, the2946* second element being the value for the second placeholder parameter, and so on.2947* In other words, if the date being set is the value for the second2948* placeholder parameter, the array containing it will be the second element in2949* the array returned by <code>getParams</code>.2950* <P>2951* Note that because the numbering of elements in an array starts at zero,2952* the array element that corresponds to placeholder parameter number2953* <i>parameterIndex</i> is <i>parameterIndex</i> -1.2954*2955* @param parameterIndex the ordinal number of the placeholder parameter2956* in this <code>RowSet</code> object's command that is to be set.2957* The first parameter is 1, the second is 2, and so on; must be2958* <code>1</code> or greater2959* @param x a <code>java.sql.Date</code> object representing an SQL2960* <code>DATE</code> value2961* @param cal a <code>java.util.Calendar</code> object to use when2962* when constructing the date2963* @throws SQLException if an error occurs or the2964* parameter index is out of bounds2965* @see #getParams2966*/2967public void setDate(int parameterIndex, java.sql.Date x, Calendar cal) throws SQLException {2968Object date[];2969checkParamIndex(parameterIndex);29702971date = new Object[2];2972date[0] = x;2973date[1] = cal;2974if(params == null){2975throw new SQLException("Set initParams() before setDate");2976}2977params.put(Integer.valueOf(parameterIndex - 1), date);2978}29792980/**2981* Sets the designated parameter to the given <code>java.sql.Time</code>2982* object. The driver converts this2983* to an SQL <code>TIME</code> value when it sends it to the database.2984* <P>2985* When the DBMS does not store time zone information, the driver will use2986* the given <code>Calendar</code> object to construct the SQL <code>TIME</code>2987* value to send to the database. With a2988* <code>Calendar</code> object, the driver can calculate the date2989* taking into account a custom time zone. If no <code>Calendar</code>2990* object is specified, the driver uses the time zone of the Virtual Machine2991* that is running the application.2992* <P>2993* The parameter value set by this method is stored internally and2994* will be supplied as the appropriate parameter in this <code>RowSet</code>2995* object's command when the method <code>execute</code> is called.2996* Methods such as <code>execute</code> and <code>populate</code> must be2997* provided in any class that extends this class and implements one or2998* more of the standard JSR-114 <code>RowSet</code> interfaces.2999* <P>3000* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method3001* as it is undefined in this class.3002* <P>3003* Calls made to the method <code>getParams</code> after this version of3004* <code>setTime</code>3005* has been called will return an array containing the parameter values that3006* have been set. In that array, the element that represents the values3007* set with this method will itself be an array. The first element of that array3008* is the given <code>java.sql.Time</code> object.3009* The second element is the value set for <i>cal</i>.3010* The parameter number is indicated by an element's position in the array3011* returned by the method <code>getParams</code>,3012* with the first element being the value for the first placeholder parameter, the3013* second element being the value for the second placeholder parameter, and so on.3014* In other words, if the time being set is the value for the second3015* placeholder parameter, the array containing it will be the second element in3016* the array returned by <code>getParams</code>.3017* <P>3018* Note that because the numbering of elements in an array starts at zero,3019* the array element that corresponds to placeholder parameter number3020* <i>parameterIndex</i> is <i>parameterIndex</i> -1.3021*3022* @param parameterIndex the ordinal number of the placeholder parameter3023* in this <code>RowSet</code> object's command that is to be set.3024* The first parameter is 1, the second is 2, and so on; must be3025* <code>1</code> or greater3026* @param x a <code>java.sql.Time</code> object3027* @param cal the <code>java.util.Calendar</code> object the driver can use to3028* construct the time3029* @throws SQLException if an error occurs or the3030* parameter index is out of bounds3031* @see #getParams3032*/3033public void setTime(int parameterIndex, java.sql.Time x, Calendar cal) throws SQLException {3034Object time[];3035checkParamIndex(parameterIndex);30363037time = new Object[2];3038time[0] = x;3039time[1] = cal;3040if(params == null){3041throw new SQLException("Set initParams() before setTime");3042}3043params.put(Integer.valueOf(parameterIndex - 1), time);3044}30453046/**3047* Sets the designated parameter to the given3048* <code>java.sql.Timestamp</code> object. The driver converts this3049* to an SQL <code>TIMESTAMP</code> value when it sends it to the database.3050* <P>3051* When the DBMS does not store time zone information, the driver will use3052* the given <code>Calendar</code> object to construct the SQL <code>TIMESTAMP</code>3053* value to send to the database. With a3054* <code>Calendar</code> object, the driver can calculate the timestamp3055* taking into account a custom time zone. If no <code>Calendar</code>3056* object is specified, the driver uses the time zone of the Virtual Machine3057* that is running the application.3058* <P>3059* The parameter value set by this method is stored internally and3060* will be supplied as the appropriate parameter in this <code>RowSet</code>3061* object's command when the method <code>execute</code> is called.3062* Methods such as <code>execute</code> and <code>populate</code> must be3063* provided in any class that extends this class and implements one or3064* more of the standard JSR-114 <code>RowSet</code> interfaces.3065* <P>3066* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method3067* as it is undefined in this class.3068* <P>3069* Calls made to the method <code>getParams</code> after this version of3070* <code>setTimestamp</code>3071* has been called will return an array containing the parameter values that3072* have been set. In that array, the element that represents the values3073* set with this method will itself be an array. The first element of that array3074* is the given <code>java.sql.Timestamp</code> object.3075* The second element is the value set for <i>cal</i>.3076* The parameter number is indicated by an element's position in the array3077* returned by the method <code>getParams</code>,3078* with the first element being the value for the first placeholder parameter, the3079* second element being the value for the second placeholder parameter, and so on.3080* In other words, if the timestamp being set is the value for the second3081* placeholder parameter, the array containing it will be the second element in3082* the array returned by <code>getParams</code>.3083* <P>3084* Note that because the numbering of elements in an array starts at zero,3085* the array element that corresponds to placeholder parameter number3086* <i>parameterIndex</i> is <i>parameterIndex</i> -1.3087*3088* @param parameterIndex the ordinal number of the placeholder parameter3089* in this <code>RowSet</code> object's command that is to be set.3090* The first parameter is 1, the second is 2, and so on; must be3091* <code>1</code> or greater3092* @param x a <code>java.sql.Timestamp</code> object3093* @param cal the <code>java.util.Calendar</code> object the driver can use to3094* construct the timestamp3095* @throws SQLException if an error occurs or the3096* parameter index is out of bounds3097* @see #getParams3098*/3099public void setTimestamp(int parameterIndex, java.sql.Timestamp x, Calendar cal) throws SQLException {3100Object timestamp[];3101checkParamIndex(parameterIndex);31023103timestamp = new Object[2];3104timestamp[0] = x;3105timestamp[1] = cal;3106if(params == null){3107throw new SQLException("Set initParams() before setTimestamp");3108}3109params.put(Integer.valueOf(parameterIndex - 1), timestamp);3110}31113112/**3113* Clears all of the current parameter values in this <code>RowSet</code>3114* object's internal representation of the parameters to be set in3115* this <code>RowSet</code> object's command when it is executed.3116* <P>3117* In general, parameter values remain in force for repeated use in3118* this <code>RowSet</code> object's command. Setting a parameter value with the3119* setter methods automatically clears the value of the3120* designated parameter and replaces it with the new specified value.3121* <P>3122* This method is called internally by the <code>setCommand</code>3123* method to clear all of the parameters set for the previous command.3124* <P>3125* Furthermore, this method differs from the <code>initParams</code>3126* method in that it maintains the schema of the <code>RowSet</code> object.3127*3128* @throws SQLException if an error occurs clearing the parameters3129*/3130public void clearParameters() throws SQLException {3131params.clear();3132}31333134/**3135* Retrieves an array containing the parameter values (both Objects and3136* primitives) that have been set for this3137* <code>RowSet</code> object's command and throws an <code>SQLException</code> object3138* if all parameters have not been set. Before the command is sent to the3139* DBMS to be executed, these parameters will be substituted3140* for placeholder parameters in the <code>PreparedStatement</code> object3141* that is the command for a <code>RowSet</code> implementation extending3142* the <code>BaseRowSet</code> class.3143* <P>3144* Each element in the array that is returned is an <code>Object</code> instance3145* that contains the values of the parameters supplied to a setter method.3146* The order of the elements is determined by the value supplied for3147* <i>parameterIndex</i>. If the setter method takes only the parameter index3148* and the value to be set (possibly null), the array element will contain the value to be set3149* (which will be expressed as an <code>Object</code>). If there are additional3150* parameters, the array element will itself be an array containing the value to be set3151* plus any additional parameter values supplied to the setter method. If the method3152* sets a stream, the array element includes the type of stream being supplied to the3153* method. These additional parameters are for the use of the driver or the DBMS and may or3154* may not be used.3155* <P>3156* NOTE: Stored parameter values of types <code>Array</code>, <code>Blob</code>,3157* <code>Clob</code> and <code>Ref</code> are returned as <code>SerialArray</code>,3158* <code>SerialBlob</code>, <code>SerialClob</code> and <code>SerialRef</code>3159* respectively.3160*3161* @return an array of <code>Object</code> instances that includes the3162* parameter values that may be set in this <code>RowSet</code> object's3163* command; an empty array if no parameters have been set3164* @throws SQLException if an error occurs retrieving the object array of3165* parameters of this <code>RowSet</code> object or if not all parameters have3166* been set3167*/3168public Object[] getParams() throws SQLException {3169if (params == null) {31703171initParams();3172Object [] paramsArray = new Object[params.size()];3173return paramsArray;31743175} else {3176// The parameters may be set in random order3177// but all must be set, check to verify all3178// have been set till the last parameter3179// else throw exception.31803181Object[] paramsArray = new Object[params.size()];3182for (int i = 0; i < params.size(); i++) {3183paramsArray[i] = params.get(Integer.valueOf(i));3184if (paramsArray[i] == null) {3185throw new SQLException("missing parameter: " + (i + 1));3186} //end if3187} //end for3188return paramsArray;31893190} //end if31913192} //end getParams319331943195/**3196* Sets the designated parameter to SQL <code>NULL</code>.3197*3198* <P><B>Note:</B> You must specify the parameter's SQL type.3199*3200* @param parameterName the name of the parameter3201* @param sqlType the SQL type code defined in <code>java.sql.Types</code>3202* @exception SQLException if a database access error occurs or3203* this method is called on a closed <code>CallableStatement</code>3204* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3205* this method3206* @since 1.43207*/3208public void setNull(String parameterName, int sqlType) throws SQLException {3209throw new SQLFeatureNotSupportedException("Feature not supported");3210}321132123213/**3214* Sets the designated parameter to SQL <code>NULL</code>.3215* This version of the method <code>setNull</code> should3216* be used for user-defined types and REF type parameters. Examples3217* of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and3218* named array types.3219*3220* <P><B>Note:</B> To be portable, applications must give the3221* SQL type code and the fully-qualified SQL type name when specifying3222* a NULL user-defined or REF parameter. In the case of a user-defined type3223* the name is the type name of the parameter itself. For a REF3224* parameter, the name is the type name of the referenced type. If3225* a JDBC driver does not need the type code or type name information,3226* it may ignore it.3227*3228* Although it is intended for user-defined and Ref parameters,3229* this method may be used to set a null parameter of any JDBC type.3230* If the parameter does not have a user-defined or REF type, the given3231* typeName is ignored.3232*3233*3234* @param parameterName the name of the parameter3235* @param sqlType a value from <code>java.sql.Types</code>3236* @param typeName the fully-qualified name of an SQL user-defined type;3237* ignored if the parameter is not a user-defined type or3238* SQL <code>REF</code> value3239* @exception SQLException if a database access error occurs or3240* this method is called on a closed <code>CallableStatement</code>3241* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3242* this method3243* @since 1.43244*/3245public void setNull (String parameterName, int sqlType, String typeName)3246throws SQLException{3247throw new SQLFeatureNotSupportedException("Feature not supported");3248}3249325032513252/**3253* Sets the designated parameter to the given Java <code>boolean</code> value.3254* The driver converts this3255* to an SQL <code>BIT</code> or <code>BOOLEAN</code> value when it sends it to the database.3256*3257* @param parameterName the name of the parameter3258* @param x the parameter value3259* @exception SQLException if a database access error occurs or3260* this method is called on a closed <code>CallableStatement</code>3261* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3262* this method3263* @see #getParams3264* @since 1.43265*/3266public void setBoolean(String parameterName, boolean x) throws SQLException{3267throw new SQLFeatureNotSupportedException("Feature not supported");3268}3269327032713272/**3273* Sets the designated parameter to the given Java <code>byte</code> value.3274* The driver converts this3275* to an SQL <code>TINYINT</code> value when it sends it to the database.3276*3277* @param parameterName the name of the parameter3278* @param x the parameter value3279* @exception SQLException if a database access error occurs or3280* this method is called on a closed <code>CallableStatement</code>3281* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3282* this method3283* @see #getParams3284* @since 1.43285*/3286public void setByte(String parameterName, byte x) throws SQLException{3287throw new SQLFeatureNotSupportedException("Feature not supported");3288}3289329032913292/**3293* Sets the designated parameter to the given Java <code>short</code> value.3294* The driver converts this3295* to an SQL <code>SMALLINT</code> value when it sends it to the database.3296*3297* @param parameterName the name of the parameter3298* @param x the parameter value3299* @exception SQLException if a database access error occurs or3300* this method is called on a closed <code>CallableStatement</code>3301* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3302* this method3303* @see #getParams3304* @since 1.43305*/3306public void setShort(String parameterName, short x) throws SQLException{3307throw new SQLFeatureNotSupportedException("Feature not supported");3308}330933103311/**3312* Sets the designated parameter to the given Java <code>int</code> value.3313* The driver converts this3314* to an SQL <code>INTEGER</code> value when it sends it to the database.3315*3316* @param parameterName the name of the parameter3317* @param x the parameter value3318* @exception SQLException if a database access error occurs or3319* this method is called on a closed <code>CallableStatement</code>3320* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3321* this method3322* @see #getParams3323* @since 1.43324*/3325public void setInt(String parameterName, int x) throws SQLException{3326throw new SQLFeatureNotSupportedException("Feature not supported");3327}332833293330/**3331* Sets the designated parameter to the given Java <code>long</code> value.3332* The driver converts this3333* to an SQL <code>BIGINT</code> value when it sends it to the database.3334*3335* @param parameterName the name of the parameter3336* @param x the parameter value3337* @exception SQLException if a database access error occurs or3338* this method is called on a closed <code>CallableStatement</code>3339* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3340* this method3341* @see #getParams3342* @since 1.43343*/3344public void setLong(String parameterName, long x) throws SQLException{3345throw new SQLFeatureNotSupportedException("Feature not supported");3346}334733483349/**3350* Sets the designated parameter to the given Java <code>float</code> value.3351* The driver converts this3352* to an SQL <code>FLOAT</code> value when it sends it to the database.3353*3354* @param parameterName the name of the parameter3355* @param x the parameter value3356* @exception SQLException if a database access error occurs or3357* this method is called on a closed <code>CallableStatement</code>3358* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3359* this method3360* @see #getParams3361* @since 1.43362*/3363public void setFloat(String parameterName, float x) throws SQLException{3364throw new SQLFeatureNotSupportedException("Feature not supported");3365}336633673368/**3369* Sets the designated parameter to the given Java <code>double</code> value.3370* The driver converts this3371* to an SQL <code>DOUBLE</code> value when it sends it to the database.3372*3373* @param parameterName the name of the parameter3374* @param x the parameter value3375* @exception SQLException if a database access error occurs or3376* this method is called on a closed <code>CallableStatement</code>3377* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3378* this method3379* @see #getParams3380* @since 1.43381*/3382public void setDouble(String parameterName, double x) throws SQLException{3383throw new SQLFeatureNotSupportedException("Feature not supported");3384}3385338633873388/**3389* Sets the designated parameter to the given3390* <code>java.math.BigDecimal</code> value.3391* The driver converts this to an SQL <code>NUMERIC</code> value when3392* it sends it to the database.3393*3394* @param parameterName the name of the parameter3395* @param x the parameter value3396* @exception SQLException if a database access error occurs or3397* this method is called on a closed <code>CallableStatement</code>3398* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3399* this method3400* @see #getParams3401* @since 1.43402*/3403public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException{3404throw new SQLFeatureNotSupportedException("Feature not supported");3405}3406340734083409/**3410* Sets the designated parameter to the given Java <code>String</code> value.3411* The driver converts this3412* to an SQL <code>VARCHAR</code> or <code>LONGVARCHAR</code> value3413* (depending on the argument's3414* size relative to the driver's limits on <code>VARCHAR</code> values)3415* when it sends it to the database.3416*3417* @param parameterName the name of the parameter3418* @param x the parameter value3419* @exception SQLException if a database access error occurs or3420* this method is called on a closed <code>CallableStatement</code>3421* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3422* this method3423* @see #getParams3424* @since 1.43425*/3426public void setString(String parameterName, String x) throws SQLException{3427throw new SQLFeatureNotSupportedException("Feature not supported");3428}3429343034313432/**3433* Sets the designated parameter to the given Java array of bytes.3434* The driver converts this to an SQL <code>VARBINARY</code> or3435* <code>LONGVARBINARY</code> (depending on the argument's size relative3436* to the driver's limits on <code>VARBINARY</code> values) when it sends3437* it to the database.3438*3439* @param parameterName the name of the parameter3440* @param x the parameter value3441* @exception SQLException if a database access error occurs or3442* this method is called on a closed <code>CallableStatement</code>3443* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3444* this method3445* @see #getParams3446* @since 1.43447*/3448public void setBytes(String parameterName, byte x[]) throws SQLException{3449throw new SQLFeatureNotSupportedException("Feature not supported");3450}3451345234533454/**3455* Sets the designated parameter to the given <code>java.sql.Timestamp</code> value.3456* The driver3457* converts this to an SQL <code>TIMESTAMP</code> value when it sends it to the3458* database.3459*3460* @param parameterName the name of the parameter3461* @param x the parameter value3462* @exception SQLException if a database access error occurs or3463* this method is called on a closed <code>CallableStatement</code>3464* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3465* this method3466* @see #getParams3467* @since 1.43468*/3469public void setTimestamp(String parameterName, java.sql.Timestamp x)3470throws SQLException{3471throw new SQLFeatureNotSupportedException("Feature not supported");3472}3473347434753476/**3477* Sets the designated parameter to the given input stream, which will have3478* the specified number of bytes.3479* When a very large ASCII value is input to a <code>LONGVARCHAR</code>3480* parameter, it may be more practical to send it via a3481* <code>java.io.InputStream</code>. Data will be read from the stream3482* as needed until end-of-file is reached. The JDBC driver will3483* do any necessary conversion from ASCII to the database char format.3484*3485* <P><B>Note:</B> This stream object can either be a standard3486* Java stream object or your own subclass that implements the3487* standard interface.3488*3489* @param parameterName the name of the parameter3490* @param x the Java input stream that contains the ASCII parameter value3491* @param length the number of bytes in the stream3492* @exception SQLException if a database access error occurs or3493* this method is called on a closed <code>CallableStatement</code>3494* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3495* this method3496* @since 1.43497*/3498public void setAsciiStream(String parameterName, java.io.InputStream x, int length)3499throws SQLException{3500throw new SQLFeatureNotSupportedException("Feature not supported");3501}350235033504/**3505* Sets the designated parameter to the given input stream, which will have3506* the specified number of bytes.3507* When a very large binary value is input to a <code>LONGVARBINARY</code>3508* parameter, it may be more practical to send it via a3509* <code>java.io.InputStream</code> object. The data will be read from the stream3510* as needed until end-of-file is reached.3511*3512* <P><B>Note:</B> This stream object can either be a standard3513* Java stream object or your own subclass that implements the3514* standard interface.3515*3516* @param parameterName the name of the parameter3517* @param x the java input stream which contains the binary parameter value3518* @param length the number of bytes in the stream3519* @exception SQLException if a database access error occurs or3520* this method is called on a closed <code>CallableStatement</code>3521* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3522* this method3523* @since 1.43524*/3525public void setBinaryStream(String parameterName, java.io.InputStream x,3526int length) throws SQLException{3527throw new SQLFeatureNotSupportedException("Feature not supported");3528}352935303531/**3532* Sets the designated parameter to the given <code>Reader</code>3533* object, which is the given number of characters long.3534* When a very large UNICODE value is input to a <code>LONGVARCHAR</code>3535* parameter, it may be more practical to send it via a3536* <code>java.io.Reader</code> object. The data will be read from the stream3537* as needed until end-of-file is reached. The JDBC driver will3538* do any necessary conversion from UNICODE to the database char format.3539*3540* <P><B>Note:</B> This stream object can either be a standard3541* Java stream object or your own subclass that implements the3542* standard interface.3543*3544* @param parameterName the name of the parameter3545* @param reader the <code>java.io.Reader</code> object that3546* contains the UNICODE data used as the designated parameter3547* @param length the number of characters in the stream3548* @exception SQLException if a database access error occurs or3549* this method is called on a closed <code>CallableStatement</code>3550* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3551* this method3552* @since 1.43553*/3554public void setCharacterStream(String parameterName,3555java.io.Reader reader,3556int length) throws SQLException{3557throw new SQLFeatureNotSupportedException("Feature not supported");3558}355935603561/**3562* Sets the designated parameter to the given input stream.3563* When a very large ASCII value is input to a <code>LONGVARCHAR</code>3564* parameter, it may be more practical to send it via a3565* <code>java.io.InputStream</code>. Data will be read from the stream3566* as needed until end-of-file is reached. The JDBC driver will3567* do any necessary conversion from ASCII to the database char format.3568*3569* <P><B>Note:</B> This stream object can either be a standard3570* Java stream object or your own subclass that implements the3571* standard interface.3572* <P><B>Note:</B> Consult your JDBC driver documentation to determine if3573* it might be more efficient to use a version of3574* <code>setAsciiStream</code> which takes a length parameter.3575*3576* @param parameterName the name of the parameter3577* @param x the Java input stream that contains the ASCII parameter value3578* @exception SQLException if a database access error occurs or3579* this method is called on a closed <code>CallableStatement</code>3580* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method3581* @since 1.63582*/3583public void setAsciiStream(String parameterName, java.io.InputStream x)3584throws SQLException{3585throw new SQLFeatureNotSupportedException("Feature not supported");3586}358735883589/**3590* Sets the designated parameter to the given input stream.3591* When a very large binary value is input to a <code>LONGVARBINARY</code>3592* parameter, it may be more practical to send it via a3593* <code>java.io.InputStream</code> object. The data will be read from the3594* stream as needed until end-of-file is reached.3595*3596* <P><B>Note:</B> This stream object can either be a standard3597* Java stream object or your own subclass that implements the3598* standard interface.3599* <P><B>Note:</B> Consult your JDBC driver documentation to determine if3600* it might be more efficient to use a version of3601* <code>setBinaryStream</code> which takes a length parameter.3602*3603* @param parameterName the name of the parameter3604* @param x the java input stream which contains the binary parameter value3605* @exception SQLException if a database access error occurs or3606* this method is called on a closed <code>CallableStatement</code>3607* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method3608* @since 1.63609*/3610public void setBinaryStream(String parameterName, java.io.InputStream x)3611throws SQLException{3612throw new SQLFeatureNotSupportedException("Feature not supported");3613}3614361536163617/**3618* Sets the designated parameter to the given <code>Reader</code>3619* object.3620* When a very large UNICODE value is input to a <code>LONGVARCHAR</code>3621* parameter, it may be more practical to send it via a3622* <code>java.io.Reader</code> object. The data will be read from the stream3623* as needed until end-of-file is reached. The JDBC driver will3624* do any necessary conversion from UNICODE to the database char format.3625*3626* <P><B>Note:</B> This stream object can either be a standard3627* Java stream object or your own subclass that implements the3628* standard interface.3629* <P><B>Note:</B> Consult your JDBC driver documentation to determine if3630* it might be more efficient to use a version of3631* <code>setCharacterStream</code> which takes a length parameter.3632*3633* @param parameterName the name of the parameter3634* @param reader the <code>java.io.Reader</code> object that contains the3635* Unicode data3636* @exception SQLException if a database access error occurs or3637* this method is called on a closed <code>CallableStatement</code>3638* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method3639* @since 1.63640*/3641public void setCharacterStream(String parameterName,3642java.io.Reader reader) throws SQLException{3643throw new SQLFeatureNotSupportedException("Feature not supported");3644}364536463647/**3648* Sets the designated parameter in this <code>RowSet</code> object's command3649* to a <code>Reader</code> object. The3650* <code>Reader</code> reads the data till end-of-file is reached. The3651* driver does the necessary conversion from Java character format to3652* the national character set in the database.36533654* <P><B>Note:</B> This stream object can either be a standard3655* Java stream object or your own subclass that implements the3656* standard interface.3657* <P><B>Note:</B> Consult your JDBC driver documentation to determine if3658* it might be more efficient to use a version of3659* <code>setNCharacterStream</code> which takes a length parameter.3660*3661* @param parameterIndex of the first parameter is 1, the second is 2, ...3662* @param value the parameter value3663* @throws SQLException if the driver does not support national3664* character sets; if the driver can detect that a data conversion3665* error could occur ; if a database access error occurs; or3666* this method is called on a closed <code>PreparedStatement</code>3667* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method3668* @since 1.63669*/3670public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException{3671throw new SQLFeatureNotSupportedException("Feature not supported");3672}3673367436753676/**3677* Sets the value of the designated parameter with the given object. The second3678* argument must be an object type; for integral values, the3679* <code>java.lang</code> equivalent objects should be used.3680*3681* <p>The given Java object will be converted to the given targetSqlType3682* before being sent to the database.3683*3684* If the object has a custom mapping (is of a class implementing the3685* interface <code>SQLData</code>),3686* the JDBC driver should call the method <code>SQLData.writeSQL</code> to write it3687* to the SQL data stream.3688* If, on the other hand, the object is of a class implementing3689* <code>Ref</code>, <code>Blob</code>, <code>Clob</code>, <code>NClob</code>,3690* <code>Struct</code>, <code>java.net.URL</code>,3691* or <code>Array</code>, the driver should pass it to the database as a3692* value of the corresponding SQL type.3693* <P>3694* Note that this method may be used to pass datatabase-3695* specific abstract data types.3696*3697* @param parameterName the name of the parameter3698* @param x the object containing the input parameter value3699* @param targetSqlType the SQL type (as defined in java.sql.Types) to be3700* sent to the database. The scale argument may further qualify this type.3701* @param scale for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types,3702* this is the number of digits after the decimal point. For all other3703* types, this value will be ignored.3704* @exception SQLException if a database access error occurs or3705* this method is called on a closed <code>CallableStatement</code>3706* @exception SQLFeatureNotSupportedException if <code>targetSqlType</code> is3707* a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,3708* <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,3709* <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,3710* <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>3711* or <code>STRUCT</code> data type and the JDBC driver does not support3712* this data type3713* @see Types3714* @see #getParams3715* @since 1.43716*/3717public void setObject(String parameterName, Object x, int targetSqlType, int scale)3718throws SQLException{3719throw new SQLFeatureNotSupportedException("Feature not supported");3720}3721372237233724/**3725* Sets the value of the designated parameter with the given object.3726* This method is like the method <code>setObject</code>3727* above, except that it assumes a scale of zero.3728*3729* @param parameterName the name of the parameter3730* @param x the object containing the input parameter value3731* @param targetSqlType the SQL type (as defined in java.sql.Types) to be3732* sent to the database3733* @exception SQLException if a database access error occurs or3734* this method is called on a closed <code>CallableStatement</code>3735* @exception SQLFeatureNotSupportedException if <code>targetSqlType</code> is3736* a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,3737* <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,3738* <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,3739* <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>3740* or <code>STRUCT</code> data type and the JDBC driver does not support3741* this data type3742* @see #getParams3743* @since 1.43744*/3745public void setObject(String parameterName, Object x, int targetSqlType)3746throws SQLException{3747throw new SQLFeatureNotSupportedException("Feature not supported");3748}374937503751/**3752* Sets the value of the designated parameter with the given object.3753* The second parameter must be of type <code>Object</code>; therefore, the3754* <code>java.lang</code> equivalent objects should be used for built-in types.3755*3756* <p>The JDBC specification specifies a standard mapping from3757* Java <code>Object</code> types to SQL types. The given argument3758* will be converted to the corresponding SQL type before being3759* sent to the database.3760*3761* <p>Note that this method may be used to pass datatabase-3762* specific abstract data types, by using a driver-specific Java3763* type.3764*3765* If the object is of a class implementing the interface <code>SQLData</code>,3766* the JDBC driver should call the method <code>SQLData.writeSQL</code>3767* to write it to the SQL data stream.3768* If, on the other hand, the object is of a class implementing3769* <code>Ref</code>, <code>Blob</code>, <code>Clob</code>, <code>NClob</code>,3770* <code>Struct</code>, <code>java.net.URL</code>,3771* or <code>Array</code>, the driver should pass it to the database as a3772* value of the corresponding SQL type.3773* <P>3774* This method throws an exception if there is an ambiguity, for example, if the3775* object is of a class implementing more than one of the interfaces named above.3776*3777* @param parameterName the name of the parameter3778* @param x the object containing the input parameter value3779* @exception SQLException if a database access error occurs,3780* this method is called on a closed <code>CallableStatement</code> or if the given3781* <code>Object</code> parameter is ambiguous3782* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3783* this method3784* @see #getParams3785* @since 1.43786*/3787public void setObject(String parameterName, Object x) throws SQLException{3788throw new SQLFeatureNotSupportedException("Feature not supported");3789}3790379137923793/**3794* Sets the designated parameter to a <code>InputStream</code> object. The inputstream must contain the number3795* of characters specified by length otherwise a <code>SQLException</code> will be3796* generated when the <code>PreparedStatement</code> is executed.3797* This method differs from the <code>setBinaryStream (int, InputStream, int)</code>3798* method because it informs the driver that the parameter value should be3799* sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used,3800* the driver may have to do extra work to determine whether the parameter3801* data should be sent to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>3802* @param parameterIndex index of the first parameter is 1,3803* the second is 2, ...3804* @param inputStream An object that contains the data to set the parameter3805* value to.3806* @param length the number of bytes in the parameter data.3807* @throws SQLException if a database access error occurs,3808* this method is called on a closed <code>PreparedStatement</code>,3809* if parameterIndex does not correspond3810* to a parameter marker in the SQL statement, if the length specified3811* is less than zero or if the number of bytes in the inputstream does not match3812* the specified length.3813* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method3814*3815* @since 1.63816*/3817public void setBlob(int parameterIndex, InputStream inputStream, long length)3818throws SQLException{3819throw new SQLFeatureNotSupportedException("Feature not supported");3820}382138223823/**3824* Sets the designated parameter to a <code>InputStream</code> object.3825* This method differs from the <code>setBinaryStream (int, InputStream)</code>3826* method because it informs the driver that the parameter value should be3827* sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used,3828* the driver may have to do extra work to determine whether the parameter3829* data should be sent to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>3830*3831* <P><B>Note:</B> Consult your JDBC driver documentation to determine if3832* it might be more efficient to use a version of3833* <code>setBlob</code> which takes a length parameter.3834*3835* @param parameterIndex index of the first parameter is 1,3836* the second is 2, ...3837* @param inputStream An object that contains the data to set the parameter3838* value to.3839* @throws SQLException if a database access error occurs,3840* this method is called on a closed <code>PreparedStatement</code> or3841* if parameterIndex does not correspond3842* to a parameter marker in the SQL statement,3843* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method3844*3845* @since 1.63846*/3847public void setBlob(int parameterIndex, InputStream inputStream)3848throws SQLException{3849throw new SQLFeatureNotSupportedException("Feature not supported");3850}385138523853/**3854* Sets the designated parameter to a <code>InputStream</code> object. The <code>inputstream</code> must contain the number3855* of characters specified by length, otherwise a <code>SQLException</code> will be3856* generated when the <code>CallableStatement</code> is executed.3857* This method differs from the <code>setBinaryStream (int, InputStream, int)</code>3858* method because it informs the driver that the parameter value should be3859* sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used,3860* the driver may have to do extra work to determine whether the parameter3861* data should be sent to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>3862*3863* @param parameterName the name of the parameter to be set3864* the second is 2, ...3865*3866* @param inputStream An object that contains the data to set the parameter3867* value to.3868* @param length the number of bytes in the parameter data.3869* @throws SQLException if parameterIndex does not correspond3870* to a parameter marker in the SQL statement, or if the length specified3871* is less than zero; if the number of bytes in the inputstream does not match3872* the specified length; if a database access error occurs or3873* this method is called on a closed <code>CallableStatement</code>3874* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3875* this method3876*3877* @since 1.63878*/3879public void setBlob(String parameterName, InputStream inputStream, long length)3880throws SQLException{3881throw new SQLFeatureNotSupportedException("Feature not supported");3882}388338843885/**3886* Sets the designated parameter to the given <code>java.sql.Blob</code> object.3887* The driver converts this to an SQL <code>BLOB</code> value when it3888* sends it to the database.3889*3890* @param parameterName the name of the parameter3891* @param x a <code>Blob</code> object that maps an SQL <code>BLOB</code> value3892* @exception SQLException if a database access error occurs or3893* this method is called on a closed <code>CallableStatement</code>3894* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3895* this method3896* @since 1.63897*/3898public void setBlob (String parameterName, Blob x) throws SQLException{3899throw new SQLFeatureNotSupportedException("Feature not supported");3900}390139023903/**3904* Sets the designated parameter to a <code>InputStream</code> object.3905* This method differs from the <code>setBinaryStream (int, InputStream)</code>3906* method because it informs the driver that the parameter value should be3907* sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used,3908* the driver may have to do extra work to determine whether the parameter3909* data should be send to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>3910*3911* <P><B>Note:</B> Consult your JDBC driver documentation to determine if3912* it might be more efficient to use a version of3913* <code>setBlob</code> which takes a length parameter.3914*3915* @param parameterName the name of the parameter3916* @param inputStream An object that contains the data to set the parameter3917* value to.3918* @throws SQLException if a database access error occurs or3919* this method is called on a closed <code>CallableStatement</code>3920* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method3921*3922* @since 1.63923*/3924public void setBlob(String parameterName, InputStream inputStream)3925throws SQLException{3926throw new SQLFeatureNotSupportedException("Feature not supported");3927}392839293930/**3931* Sets the designated parameter to a <code>Reader</code> object. The reader must contain the number3932* of characters specified by length otherwise a <code>SQLException</code> will be3933* generated when the <code>PreparedStatement</code> is executed.3934*This method differs from the <code>setCharacterStream (int, Reader, int)</code> method3935* because it informs the driver that the parameter value should be sent to3936* the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the3937* driver may have to do extra work to determine whether the parameter3938* data should be sent to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>3939* @param parameterIndex index of the first parameter is 1, the second is 2, ...3940* @param reader An object that contains the data to set the parameter value to.3941* @param length the number of characters in the parameter data.3942* @throws SQLException if a database access error occurs, this method is called on3943* a closed <code>PreparedStatement</code>, if parameterIndex does not correspond to a parameter3944* marker in the SQL statement, or if the length specified is less than zero.3945*3946* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method3947* @since 1.63948*/3949public void setClob(int parameterIndex, Reader reader, long length)3950throws SQLException{3951throw new SQLFeatureNotSupportedException("Feature not supported");3952}395339543955/**3956* Sets the designated parameter to a <code>Reader</code> object.3957* This method differs from the <code>setCharacterStream (int, Reader)</code> method3958* because it informs the driver that the parameter value should be sent to3959* the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the3960* driver may have to do extra work to determine whether the parameter3961* data should be sent to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>3962*3963* <P><B>Note:</B> Consult your JDBC driver documentation to determine if3964* it might be more efficient to use a version of3965* <code>setClob</code> which takes a length parameter.3966*3967* @param parameterIndex index of the first parameter is 1, the second is 2, ...3968* @param reader An object that contains the data to set the parameter value to.3969* @throws SQLException if a database access error occurs, this method is called on3970* a closed <code>PreparedStatement</code>or if parameterIndex does not correspond to a parameter3971* marker in the SQL statement3972*3973* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method3974* @since 1.63975*/3976public void setClob(int parameterIndex, Reader reader)3977throws SQLException{3978throw new SQLFeatureNotSupportedException("Feature not supported");3979}398039813982/**3983* Sets the designated parameter to a <code>Reader</code> object. The <code>reader</code> must contain the number3984* of characters specified by length otherwise a <code>SQLException</code> will be3985* generated when the <code>CallableStatement</code> is executed.3986* This method differs from the <code>setCharacterStream (int, Reader, int)</code> method3987* because it informs the driver that the parameter value should be sent to3988* the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the3989* driver may have to do extra work to determine whether the parameter3990* data should be send to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>3991* @param parameterName the name of the parameter to be set3992* @param reader An object that contains the data to set the parameter value to.3993* @param length the number of characters in the parameter data.3994* @throws SQLException if parameterIndex does not correspond to a parameter3995* marker in the SQL statement; if the length specified is less than zero;3996* a database access error occurs or3997* this method is called on a closed <code>CallableStatement</code>3998* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3999* this method4000*4001* @since 1.64002*/4003public void setClob(String parameterName, Reader reader, long length)4004throws SQLException{4005throw new SQLFeatureNotSupportedException("Feature not supported");4006}400740084009/**4010* Sets the designated parameter to the given <code>java.sql.Clob</code> object.4011* The driver converts this to an SQL <code>CLOB</code> value when it4012* sends it to the database.4013*4014* @param parameterName the name of the parameter4015* @param x a <code>Clob</code> object that maps an SQL <code>CLOB</code> value4016* @exception SQLException if a database access error occurs or4017* this method is called on a closed <code>CallableStatement</code>4018* @exception SQLFeatureNotSupportedException if the JDBC driver does not support4019* this method4020* @since 1.64021*/4022public void setClob (String parameterName, Clob x) throws SQLException{4023throw new SQLFeatureNotSupportedException("Feature not supported");4024}402540264027/**4028* Sets the designated parameter to a <code>Reader</code> object.4029* This method differs from the <code>setCharacterStream (int, Reader)</code> method4030* because it informs the driver that the parameter value should be sent to4031* the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the4032* driver may have to do extra work to determine whether the parameter4033* data should be send to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>4034*4035* <P><B>Note:</B> Consult your JDBC driver documentation to determine if4036* it might be more efficient to use a version of4037* <code>setClob</code> which takes a length parameter.4038*4039* @param parameterName the name of the parameter4040* @param reader An object that contains the data to set the parameter value to.4041* @throws SQLException if a database access error occurs or this method is called on4042* a closed <code>CallableStatement</code>4043*4044* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method4045* @since 1.64046*/4047public void setClob(String parameterName, Reader reader)4048throws SQLException{4049throw new SQLFeatureNotSupportedException("Feature not supported");4050}405140524053/**4054* Sets the designated parameter to the given <code>java.sql.Date</code> value4055* using the default time zone of the virtual machine that is running4056* the application.4057* The driver converts this4058* to an SQL <code>DATE</code> value when it sends it to the database.4059*4060* @param parameterName the name of the parameter4061* @param x the parameter value4062* @exception SQLException if a database access error occurs or4063* this method is called on a closed <code>CallableStatement</code>4064* @exception SQLFeatureNotSupportedException if the JDBC driver does not support4065* this method4066* @see #getParams4067* @since 1.44068*/4069public void setDate(String parameterName, java.sql.Date x)4070throws SQLException{4071throw new SQLFeatureNotSupportedException("Feature not supported");4072}407340744075/**4076* Sets the designated parameter to the given <code>java.sql.Date</code> value,4077* using the given <code>Calendar</code> object. The driver uses4078* the <code>Calendar</code> object to construct an SQL <code>DATE</code> value,4079* which the driver then sends to the database. With a4080* a <code>Calendar</code> object, the driver can calculate the date4081* taking into account a custom timezone. If no4082* <code>Calendar</code> object is specified, the driver uses the default4083* timezone, which is that of the virtual machine running the application.4084*4085* @param parameterName the name of the parameter4086* @param x the parameter value4087* @param cal the <code>Calendar</code> object the driver will use4088* to construct the date4089* @exception SQLException if a database access error occurs or4090* this method is called on a closed <code>CallableStatement</code>4091* @exception SQLFeatureNotSupportedException if the JDBC driver does not support4092* this method4093* @see #getParams4094* @since 1.44095*/4096public void setDate(String parameterName, java.sql.Date x, Calendar cal)4097throws SQLException{4098throw new SQLFeatureNotSupportedException("Feature not supported");4099}410041014102/**4103* Sets the designated parameter to the given <code>java.sql.Time</code> value.4104* The driver converts this4105* to an SQL <code>TIME</code> value when it sends it to the database.4106*4107* @param parameterName the name of the parameter4108* @param x the parameter value4109* @exception SQLException if a database access error occurs or4110* this method is called on a closed <code>CallableStatement</code>4111* @exception SQLFeatureNotSupportedException if the JDBC driver does not support4112* this method4113* @see #getParams4114* @since 1.44115*/4116public void setTime(String parameterName, java.sql.Time x)4117throws SQLException{4118throw new SQLFeatureNotSupportedException("Feature not supported");4119}412041214122/**4123* Sets the designated parameter to the given <code>java.sql.Time</code> value,4124* using the given <code>Calendar</code> object. The driver uses4125* the <code>Calendar</code> object to construct an SQL <code>TIME</code> value,4126* which the driver then sends to the database. With a4127* a <code>Calendar</code> object, the driver can calculate the time4128* taking into account a custom timezone. If no4129* <code>Calendar</code> object is specified, the driver uses the default4130* timezone, which is that of the virtual machine running the application.4131*4132* @param parameterName the name of the parameter4133* @param x the parameter value4134* @param cal the <code>Calendar</code> object the driver will use4135* to construct the time4136* @exception SQLException if a database access error occurs or4137* this method is called on a closed <code>CallableStatement</code>4138* @exception SQLFeatureNotSupportedException if the JDBC driver does not support4139* this method4140* @see #getParams4141* @since 1.44142*/4143public void setTime(String parameterName, java.sql.Time x, Calendar cal)4144throws SQLException{4145throw new SQLFeatureNotSupportedException("Feature not supported");4146}414741484149/**4150* Sets the designated parameter to the given <code>java.sql.Timestamp</code> value,4151* using the given <code>Calendar</code> object. The driver uses4152* the <code>Calendar</code> object to construct an SQL <code>TIMESTAMP</code> value,4153* which the driver then sends to the database. With a4154* a <code>Calendar</code> object, the driver can calculate the timestamp4155* taking into account a custom timezone. If no4156* <code>Calendar</code> object is specified, the driver uses the default4157* timezone, which is that of the virtual machine running the application.4158*4159* @param parameterName the name of the parameter4160* @param x the parameter value4161* @param cal the <code>Calendar</code> object the driver will use4162* to construct the timestamp4163* @exception SQLException if a database access error occurs or4164* this method is called on a closed <code>CallableStatement</code>4165* @exception SQLFeatureNotSupportedException if the JDBC driver does not support4166* this method4167* @see #getParams4168* @since 1.44169*/4170public void setTimestamp(String parameterName, java.sql.Timestamp x, Calendar cal)4171throws SQLException{4172throw new SQLFeatureNotSupportedException("Feature not supported");4173}417441754176/**4177* Sets the designated parameter to the given <code>java.sql.SQLXML</code> object. The driver converts this to an4178* SQL <code>XML</code> value when it sends it to the database.4179* @param parameterIndex index of the first parameter is 1, the second is 2, ...4180* @param xmlObject a <code>SQLXML</code> object that maps an SQL <code>XML</code> value4181* @throws SQLException if a database access error occurs, this method4182* is called on a closed result set,4183* the <code>java.xml.transform.Result</code>,4184* <code>Writer</code> or <code>OutputStream</code> has not been closed4185* for the <code>SQLXML</code> object or4186* if there is an error processing the XML value. The <code>getCause</code> method4187* of the exception may provide a more detailed exception, for example, if the4188* stream does not contain valid XML.4189* @throws SQLFeatureNotSupportedException if the JDBC driver does not4190* support this method4191* @since 1.64192*/4193public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException{4194throw new SQLFeatureNotSupportedException("Feature not supported");4195}419641974198/**4199* Sets the designated parameter to the given <code>java.sql.SQLXML</code> object. The driver converts this to an4200* <code>SQL XML</code> value when it sends it to the database.4201* @param parameterName the name of the parameter4202* @param xmlObject a <code>SQLXML</code> object that maps an <code>SQL XML</code> value4203* @throws SQLException if a database access error occurs, this method4204* is called on a closed result set,4205* the <code>java.xml.transform.Result</code>,4206* <code>Writer</code> or <code>OutputStream</code> has not been closed4207* for the <code>SQLXML</code> object or4208* if there is an error processing the XML value. The <code>getCause</code> method4209* of the exception may provide a more detailed exception, for example, if the4210* stream does not contain valid XML.4211* @throws SQLFeatureNotSupportedException if the JDBC driver does not4212* support this method4213* @since 1.64214*/4215public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException{4216throw new SQLFeatureNotSupportedException("Feature not supported");4217}421842194220/**4221* Sets the designated parameter to the given <code>java.sql.RowId</code> object. The4222* driver converts this to a SQL <code>ROWID</code> value when it sends it4223* to the database4224*4225* @param parameterIndex the first parameter is 1, the second is 2, ...4226* @param x the parameter value4227* @throws SQLException if a database access error occurs4228* @throws SQLFeatureNotSupportedException if the JDBC driver does not4229* support this method4230*4231* @since 1.64232*/4233public void setRowId(int parameterIndex, RowId x) throws SQLException{4234throw new SQLFeatureNotSupportedException("Feature not supported");4235}423642374238/**4239* Sets the designated parameter to the given <code>java.sql.RowId</code> object. The4240* driver converts this to a SQL <code>ROWID</code> when it sends it to the4241* database.4242*4243* @param parameterName the name of the parameter4244* @param x the parameter value4245* @throws SQLException if a database access error occurs4246* @throws SQLFeatureNotSupportedException if the JDBC driver does not4247* support this method4248* @since 1.64249*/4250public void setRowId(String parameterName, RowId x) throws SQLException{4251throw new SQLFeatureNotSupportedException("Feature not supported");4252}42534254/**4255* Sets the designated parameter to the given <code>String</code> object.4256* The driver converts this to a SQL <code>NCHAR</code> or4257* <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value4258* (depending on the argument's4259* size relative to the driver's limits on <code>NVARCHAR</code> values)4260* when it sends it to the database.4261*4262* @param parameterIndex of the first parameter is 1, the second is 2, ...4263* @param value the parameter value4264* @throws SQLException if the driver does not support national4265* character sets; if the driver can detect that a data conversion4266* error could occur ; or if a database access error occurs4267* @throws SQLFeatureNotSupportedException if the JDBC driver does not4268* support this method4269* @since 1.64270*/4271public void setNString(int parameterIndex, String value) throws SQLException{4272throw new SQLFeatureNotSupportedException("Feature not supported");4273}427442754276/**4277* Sets the designated parameter to the given <code>String</code> object.4278* The driver converts this to a SQL <code>NCHAR</code> or4279* <code>NVARCHAR</code> or <code>LONGNVARCHAR</code>4280* @param parameterName the name of the column to be set4281* @param value the parameter value4282* @throws SQLException if the driver does not support national4283* character sets; if the driver can detect that a data conversion4284* error could occur; or if a database access error occurs4285* @throws SQLFeatureNotSupportedException if the JDBC driver does not4286* support this method4287* @since 1.64288*/4289public void setNString(String parameterName, String value)4290throws SQLException{4291throw new SQLFeatureNotSupportedException("Feature not supported");4292}429342944295/**4296* Sets the designated parameter to a <code>Reader</code> object. The4297* <code>Reader</code> reads the data till end-of-file is reached. The4298* driver does the necessary conversion from Java character format to4299* the national character set in the database.4300* @param parameterIndex of the first parameter is 1, the second is 2, ...4301* @param value the parameter value4302* @param length the number of characters in the parameter data.4303* @throws SQLException if the driver does not support national4304* character sets; if the driver can detect that a data conversion4305* error could occur ; or if a database access error occurs4306* @throws SQLFeatureNotSupportedException if the JDBC driver does not4307* support this method4308* @since 1.64309*/4310public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException{4311throw new SQLFeatureNotSupportedException("Feature not supported");4312}431343144315/**4316* Sets the designated parameter to a <code>Reader</code> object. The4317* <code>Reader</code> reads the data till end-of-file is reached. The4318* driver does the necessary conversion from Java character format to4319* the national character set in the database.4320* @param parameterName the name of the column to be set4321* @param value the parameter value4322* @param length the number of characters in the parameter data.4323* @throws SQLException if the driver does not support national4324* character sets; if the driver can detect that a data conversion4325* error could occur; or if a database access error occurs4326* @throws SQLFeatureNotSupportedException if the JDBC driver does not4327* support this method4328* @since 1.64329*/4330public void setNCharacterStream(String parameterName, Reader value, long length)4331throws SQLException{4332throw new SQLFeatureNotSupportedException("Feature not supported");4333}433443354336/**4337* Sets the designated parameter to a <code>Reader</code> object. The4338* <code>Reader</code> reads the data till end-of-file is reached. The4339* driver does the necessary conversion from Java character format to4340* the national character set in the database.43414342* <P><B>Note:</B> This stream object can either be a standard4343* Java stream object or your own subclass that implements the4344* standard interface.4345* <P><B>Note:</B> Consult your JDBC driver documentation to determine if4346* it might be more efficient to use a version of4347* <code>setNCharacterStream</code> which takes a length parameter.4348*4349* @param parameterName the name of the parameter4350* @param value the parameter value4351* @throws SQLException if the driver does not support national4352* character sets; if the driver can detect that a data conversion4353* error could occur ; if a database access error occurs; or4354* this method is called on a closed <code>CallableStatement</code>4355* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method4356* @since 1.64357*/4358public void setNCharacterStream(String parameterName, Reader value) throws SQLException{4359throw new SQLFeatureNotSupportedException("Feature not supported");4360}436143624363/**4364* Sets the designated parameter to a <code>java.sql.NClob</code> object. The object4365* implements the <code>java.sql.NClob</code> interface. This <code>NClob</code>4366* object maps to a SQL <code>NCLOB</code>.4367* @param parameterName the name of the column to be set4368* @param value the parameter value4369* @throws SQLException if the driver does not support national4370* character sets; if the driver can detect that a data conversion4371* error could occur; or if a database access error occurs4372* @throws SQLFeatureNotSupportedException if the JDBC driver does not4373* support this method4374* @since 1.64375*/4376public void setNClob(String parameterName, NClob value) throws SQLException{4377throw new SQLFeatureNotSupportedException("Feature not supported");4378}437943804381/**4382* Sets the designated parameter to a <code>Reader</code> object. The <code>reader</code> must contain4383* the number4384* of characters specified by length otherwise a <code>SQLException</code> will be4385* generated when the <code>CallableStatement</code> is executed.4386* This method differs from the <code>setCharacterStream (int, Reader, int)</code> method4387* because it informs the driver that the parameter value should be sent to4388* the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the4389* driver may have to do extra work to determine whether the parameter4390* data should be send to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>4391*4392* @param parameterName the name of the parameter to be set4393* @param reader An object that contains the data to set the parameter value to.4394* @param length the number of characters in the parameter data.4395* @throws SQLException if parameterIndex does not correspond to a parameter4396* marker in the SQL statement; if the length specified is less than zero;4397* if the driver does not support national4398* character sets; if the driver can detect that a data conversion4399* error could occur; if a database access error occurs or4400* this method is called on a closed <code>CallableStatement</code>4401* @exception SQLFeatureNotSupportedException if the JDBC driver does not support4402* this method4403* @since 1.64404*/4405public void setNClob(String parameterName, Reader reader, long length)4406throws SQLException{4407throw new SQLFeatureNotSupportedException("Feature not supported");4408}440944104411/**4412* Sets the designated parameter to a <code>Reader</code> object.4413* This method differs from the <code>setCharacterStream (int, Reader)</code> method4414* because it informs the driver that the parameter value should be sent to4415* the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the4416* driver may have to do extra work to determine whether the parameter4417* data should be send to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>4418* <P><B>Note:</B> Consult your JDBC driver documentation to determine if4419* it might be more efficient to use a version of4420* <code>setNClob</code> which takes a length parameter.4421*4422* @param parameterName the name of the parameter4423* @param reader An object that contains the data to set the parameter value to.4424* @throws SQLException if the driver does not support national character sets;4425* if the driver can detect that a data conversion4426* error could occur; if a database access error occurs or4427* this method is called on a closed <code>CallableStatement</code>4428* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method4429*4430* @since 1.64431*/4432public void setNClob(String parameterName, Reader reader)4433throws SQLException{4434throw new SQLFeatureNotSupportedException("Feature not supported");4435}443644374438/**4439* Sets the designated parameter to a <code>Reader</code> object. The reader must contain the number4440* of characters specified by length otherwise a <code>SQLException</code> will be4441* generated when the <code>PreparedStatement</code> is executed.4442* This method differs from the <code>setCharacterStream (int, Reader, int)</code> method4443* because it informs the driver that the parameter value should be sent to4444* the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the4445* driver may have to do extra work to determine whether the parameter4446* data should be sent to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>4447* @param parameterIndex index of the first parameter is 1, the second is 2, ...4448* @param reader An object that contains the data to set the parameter value to.4449* @param length the number of characters in the parameter data.4450* @throws SQLException if parameterIndex does not correspond to a parameter4451* marker in the SQL statement; if the length specified is less than zero;4452* if the driver does not support national character sets;4453* if the driver can detect that a data conversion4454* error could occur; if a database access error occurs or4455* this method is called on a closed <code>PreparedStatement</code>4456* @throws SQLFeatureNotSupportedException if the JDBC driver does not4457* support this method4458*4459* @since 1.64460*/4461public void setNClob(int parameterIndex, Reader reader, long length)4462throws SQLException{4463throw new SQLFeatureNotSupportedException("Feature not supported");4464}446544664467/**4468* Sets the designated parameter to a <code>java.sql.NClob</code> object. The driver converts this oa4469* SQL <code>NCLOB</code> value when it sends it to the database.4470* @param parameterIndex of the first parameter is 1, the second is 2, ...4471* @param value the parameter value4472* @throws SQLException if the driver does not support national4473* character sets; if the driver can detect that a data conversion4474* error could occur ; or if a database access error occurs4475* @throws SQLFeatureNotSupportedException if the JDBC driver does not4476* support this method4477* @since 1.64478*/4479public void setNClob(int parameterIndex, NClob value) throws SQLException{4480throw new SQLFeatureNotSupportedException("Feature not supported");4481}448244834484/**4485* Sets the designated parameter to a <code>Reader</code> object.4486* This method differs from the <code>setCharacterStream (int, Reader)</code> method4487* because it informs the driver that the parameter value should be sent to4488* the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the4489* driver may have to do extra work to determine whether the parameter4490* data should be sent to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>4491* <P><B>Note:</B> Consult your JDBC driver documentation to determine if4492* it might be more efficient to use a version of4493* <code>setNClob</code> which takes a length parameter.4494*4495* @param parameterIndex index of the first parameter is 1, the second is 2, ...4496* @param reader An object that contains the data to set the parameter value to.4497* @throws SQLException if parameterIndex does not correspond to a parameter4498* marker in the SQL statement;4499* if the driver does not support national character sets;4500* if the driver can detect that a data conversion4501* error could occur; if a database access error occurs or4502* this method is called on a closed <code>PreparedStatement</code>4503* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method4504*4505* @since 1.64506*/4507public void setNClob(int parameterIndex, Reader reader)4508throws SQLException{4509throw new SQLFeatureNotSupportedException("Feature not supported");4510}451145124513/**4514* Sets the designated parameter to the given <code>java.net.URL</code> value.4515* The driver converts this to an SQL <code>DATALINK</code> value4516* when it sends it to the database.4517*4518* @param parameterIndex the first parameter is 1, the second is 2, ...4519* @param x the <code>java.net.URL</code> object to be set4520* @exception SQLException if a database access error occurs or4521* this method is called on a closed <code>PreparedStatement</code>4522* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method4523* @since 1.44524*/4525public void setURL(int parameterIndex, java.net.URL x) throws SQLException{4526throw new SQLFeatureNotSupportedException("Feature not supported");4527}4528452945304531static final long serialVersionUID = 4886719666485113312L;45324533} //end class453445354536