Path: blob/master/src/java.sql.rowset/share/classes/javax/sql/rowset/BaseRowSet.java
40948 views
/*1* Copyright (c) 2003, 2019, 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* <h2>1.0 Overview</h2>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* </UL>73*74* <h2>2.0 Setting Properties</h2>75* All rowsets maintain a set of properties, which will usually be set using76* a tool. The number and kinds of properties a rowset has will vary,77* depending on what the <code>RowSet</code> implementation does and how it gets78* its data. For example,79* rowsets that get their data from a <code>ResultSet</code> object need to80* set the properties that are required for making a database connection.81* If a <code>RowSet</code> object uses the <code>DriverManager</code> facility to make a82* connection, it needs to set a property for the JDBC URL that identifies the83* appropriate driver, and it needs to set the properties that give the84* user name and password.85* If, on the other hand, the rowset uses a <code>DataSource</code> object86* to make the connection, which is the preferred method, it does not need to87* set the property for the JDBC URL. Instead, it needs to set the property88* for the logical name of the data source along with the properties for89* the user name and password.90* <P>91* NOTE: In order to use a <code>DataSource</code> object for making a92* connection, the <code>DataSource</code> object must have been registered93* with a naming service that uses the Java Naming and Directory94* Interface (JNDI) API. This registration95* is usually done by a person acting in the capacity of a system administrator.96*97* <h2>3.0 Setting the Command and Its Parameters</h2>98* When a rowset gets its data from a relational database, it executes a command (a query)99* that produces a <code>ResultSet</code> object. This query is the command that is set100* for the <code>RowSet</code> object's command property. The rowset populates itself with data by reading the101* data from the <code>ResultSet</code> object into itself. If the query102* contains placeholders for values to be set, the <code>BaseRowSet</code> setter methods103* are used to set these values. All setter methods allow these values to be set104* to <code>null</code> if required.105* <P>106* The following code fragment illustrates how the107* <code>CachedRowSet</code>108* object <code>crs</code> might have its command property set. Note that if a109* tool is used to set properties, this is the code that the tool would use.110* <PRE>{@code111* crs.setCommand("SELECT FIRST_NAME, LAST_NAME, ADDRESS FROM CUSTOMERS" +112* "WHERE CREDIT_LIMIT > ? AND REGION = ?");113* }</PRE>114* <P>115* In this example, the values for <code>CREDIT_LIMIT</code> and116* <code>REGION</code> are placeholder parameters, which are indicated with a117* question mark (?). The first question mark is placeholder parameter number118* <code>1</code>, the second question mark is placeholder parameter number119* <code>2</code>, and so on. Any placeholder parameters must be set with120* values before the query can be executed. To set these121* placeholder parameters, the <code>BaseRowSet</code> class provides a set of setter122* methods, similar to those provided by the <code>PreparedStatement</code>123* interface, for setting values of each data type. A <code>RowSet</code> object stores the124* parameter values internally, and its <code>execute</code> method uses them internally125* to set values for the placeholder parameters126* before it sends the command to the DBMS to be executed.127* <P>128* The following code fragment demonstrates129* setting the two parameters in the query from the previous example.130* <PRE>{@code131* crs.setInt(1, 5000);132* crs.setString(2, "West");133* }</PRE>134* If the <code>execute</code> method is called at this point, the query135* sent to the DBMS will be:136* <PRE>{@code137* "SELECT FIRST_NAME, LAST_NAME, ADDRESS FROM CUSTOMERS" +138* "WHERE CREDIT_LIMIT > 5000 AND REGION = 'West'"139* }</PRE>140* NOTE: Setting <code>Array</code>, <code>Clob</code>, <code>Blob</code> and141* <code>Ref</code> objects as a command parameter, stores these values as142* <code>SerialArray</code>, <code>SerialClob</code>, <code>SerialBlob</code>143* and <code>SerialRef</code> objects respectively.144*145* <h2>4.0 Handling of Parameters Behind the Scenes</h2>146*147* NOTE: The <code>BaseRowSet</code> class provides two kinds of setter methods,148* those that set properties and those that set placeholder parameters. The setter149* methods discussed in this section are those that set placeholder parameters.150* <P>151* The placeholder parameters set with the <code>BaseRowSet</code> setter methods152* are stored as objects in an internal <code>Hashtable</code> object.153* Primitives are stored as their <code>Object</code> type. For example, <code>byte</code>154* is stored as <code>Byte</code> object, and <code>int</code> is stored as155* an <code>Integer</code> object.156* When the method <code>execute</code> is called, the values in the157* <code>Hashtable</code> object are substituted for the appropriate placeholder158* parameters in the command.159* <P>160* A call to the method <code>getParams</code> returns the values stored in the161* <code>Hashtable</code> object as an array of <code>Object</code> instances.162* An element in this array may be a simple <code>Object</code> instance or an163* array (which is a type of <code>Object</code>). The particular setter method used164* determines whether an element in this array is an <code>Object</code> or an array.165* <P>166* The majority of methods for setting placeholder parameters take two parameters,167* with the first parameter168* indicating which placeholder parameter is to be set, and the second parameter169* giving the value to be set. Methods such as <code>setInt</code>,170* <code>setString</code>, <code>setBoolean</code>, and <code>setLong</code> fall into171* this category. After these methods have been called, a call to the method172* <code>getParams</code> will return an array with the values that have been set. Each173* element in the array is an <code>Object</code> instance representing the174* values that have been set. The order of these values in the array is determined by the175* <code>int</code> (the first parameter) passed to the setter method. The values in the176* array are the values (the second parameter) passed to the setter method.177* In other words, the first element in the array is the value178* to be set for the first placeholder parameter in the <code>RowSet</code> object's179* command. The second element is the value to180* be set for the second placeholder parameter, and so on.181* <P>182* Several setter methods send the driver and DBMS information beyond the value to be set.183* When the method <code>getParams</code> is called after one of these setter methods has184* been used, the elements in the array will themselves be arrays to accommodate the185* additional information. In this category, the method <code>setNull</code> is a special case186* because one version takes only187* two parameters (<code>setNull(int parameterIndex, int SqlType)</code>). Nevertheless,188* it requires189* an array to contain the information that will be passed to the driver and DBMS. The first190* element in this array is the value to be set, which is <code>null</code>, and the191* second element is the <code>int</code> supplied for <i>sqlType</i>, which192* indicates the type of SQL value that is being set to <code>null</code>. This information193* is needed by some DBMSs and is therefore required in order to ensure that applications194* are portable.195* The other version is intended to be used when the value to be set to <code>null</code>196* is a user-defined type. It takes three parameters197* (<code>setNull(int parameterIndex, int sqlType, String typeName)</code>) and also198* requires an array to contain the information to be passed to the driver and DBMS.199* The first two elements in this array are the same as for the first version of200* <code>setNull</code>. The third element, <i>typeName</i>, gives the SQL name of201* the user-defined type. As is true with the other setter methods, the number of the202* placeholder parameter to be set is indicated by an element's position in the array203* returned by <code>getParams</code>. So, for example, if the parameter204* supplied to <code>setNull</code> is <code>2</code>, the second element in the array205* returned by <code>getParams</code> will be an array of two or three elements.206* <P>207* Some methods, such as <code>setObject</code> and <code>setDate</code> have versions208* that take more than two parameters, with the extra parameters giving information209* to the driver or the DBMS. For example, the methods <code>setDate</code>,210* <code>setTime</code>, and <code>setTimestamp</code> can take a <code>Calendar</code>211* object as their third parameter. If the DBMS does not store time zone information,212* the driver uses the <code>Calendar</code> object to construct the <code>Date</code>,213* <code>Time</code>, or <code>Timestamp</code> object being set. As is true with other214* methods that provide additional information, the element in the array returned215* by <code>getParams</code> is an array instead of a simple <code>Object</code> instance.216* <P>217* The methods <code>setAsciiStream</code>, <code>setBinaryStream</code>,218* <code>setCharacterStream</code>, and <code>setUnicodeStream</code> (which is219* deprecated, so applications should use <code>getCharacterStream</code> instead)220* take three parameters, so for them, the element in the array returned by221* <code>getParams</code> is also an array. What is different about these setter222* methods is that in addition to the information provided by parameters, the array contains223* one of the <code>BaseRowSet</code> constants indicating the type of stream being set.224* <p>225* NOTE: The method <code>getParams</code> is called internally by226* <code>RowSet</code> implementations extending this class; it is not normally called by an227* application programmer directly.228*229* <h2>5.0 Event Notification</h2>230* The <code>BaseRowSet</code> class provides the event notification231* mechanism for rowsets. It contains the field232* <code>listeners</code>, methods for adding and removing listeners, and233* methods for notifying listeners of changes.234* <P>235* A listener is an object that has implemented the <code>RowSetListener</code> interface.236* If it has been added to a <code>RowSet</code> object's list of listeners, it will be notified237* when an event occurs on that <code>RowSet</code> object. Each listener's238* implementation of the <code>RowSetListener</code> methods defines what that object239* will do when it is notified that an event has occurred.240* <P>241* There are three possible events for a <code>RowSet</code> object:242* <OL>243* <LI>the cursor moves244* <LI>an individual row is changed (updated, deleted, or inserted)245* <LI>the contents of the entire <code>RowSet</code> object are changed246* </OL>247* <P>248* The <code>BaseRowSet</code> method used for the notification indicates the249* type of event that has occurred. For example, the method250* <code>notifyRowChanged</code> indicates that a row has been updated,251* deleted, or inserted. Each of the notification methods creates a252* <code>RowSetEvent</code> object, which is supplied to the listener in order to253* identify the <code>RowSet</code> object on which the event occurred.254* What the listener does with this information, which may be nothing, depends on how it was255* implemented.256*257* <h2>6.0 Default Behavior</h2>258* A default <code>BaseRowSet</code> object is initialized with many starting values.259*260* The following is true of a default <code>RowSet</code> instance that extends261* the <code>BaseRowSet</code> class:262* <UL>263* <LI>Has a scrollable cursor and does not show changes264* made by others.265* <LI>Is updatable.266* <LI>Does not show rows that have been deleted.267* <LI>Has no time limit for how long a driver may take to268* execute the <code>RowSet</code> object's command.269* <LI>Has no limit for the number of rows it may contain.270* <LI>Has no limit for the number of bytes a column may contain. NOTE: This271* limit applies only to columns that hold values of the272* following types: <code>BINARY</code>, <code>VARBINARY</code>,273* <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>,274* and <code>LONGVARCHAR</code>.275* <LI>Will not see uncommitted data (make "dirty" reads).276* <LI>Has escape processing turned on.277* <LI>Has its connection's type map set to <code>null</code>.278* <LI>Has an empty <code>Vector</code> object for storing the values set279* for the placeholder parameters in the <code>RowSet</code> object's command.280* </UL>281* <p>282* If other values are desired, an application must set the property values283* explicitly. For example, the following line of code sets the maximum number284* of rows for the <code>CachedRowSet</code> object <i>crs</i> to 500.285* <PRE>286* crs.setMaxRows(500);287* </PRE>288* Methods implemented in extensions of this <code>BaseRowSet</code> class <b>must</b> throw an289* <code>SQLException</code> object for any violation of the defined assertions. Also, if the290* extending class overrides and reimplements any <code>BaseRowSet</code> method and encounters291* connectivity or underlying data source issues, that method <b>may</b> in addition throw an292* <code>SQLException</code> object for that reason.293*294* @since 1.5295*/296297public abstract class BaseRowSet implements Serializable, Cloneable {298299/**300* A constant indicating to a <code>RowSetReaderImpl</code> object301* that a given parameter is a Unicode stream. This302* <code>RowSetReaderImpl</code> object is provided as an extension of the303* <code>SyncProvider</code> abstract class defined in the304* <code>SyncFactory</code> static factory SPI mechanism.305*/306public static final int UNICODE_STREAM_PARAM = 0;307308/**309* A constant indicating to a <code>RowSetReaderImpl</code> object310* that a given parameter is a binary stream. A311* <code>RowSetReaderImpl</code> object is provided as an extension of the312* <code>SyncProvider</code> abstract class defined in the313* <code>SyncFactory</code> static factory SPI mechanism.314*/315public static final int BINARY_STREAM_PARAM = 1;316317/**318* A constant indicating to a <code>RowSetReaderImpl</code> object319* that a given parameter is an ASCII stream. A320* <code>RowSetReaderImpl</code> object is provided as an extension of the321* <code>SyncProvider</code> abstract class defined in the322* <code>SyncFactory</code> static factory SPI mechanism.323*/324public static final int ASCII_STREAM_PARAM = 2;325326/**327* The <code>InputStream</code> object that will be328* returned by the method <code>getBinaryStream</code>, which is329* specified in the <code>ResultSet</code> interface.330* @serial331*/332@SuppressWarnings("serial") // Not statically typed as Serializable333protected java.io.InputStream binaryStream;334335/**336* The <code>InputStream</code> object that will be337* returned by the method <code>getUnicodeStream</code>,338* which is specified in the <code>ResultSet</code> interface.339* @serial340*/341@SuppressWarnings("serial") // Not statically typed as Serializable342protected java.io.InputStream unicodeStream;343344/**345* The <code>InputStream</code> object that will be346* returned by the method <code>getAsciiStream</code>,347* which is specified in the <code>ResultSet</code> interface.348* @serial349*/350@SuppressWarnings("serial") // Not statically typed as Serializable351protected java.io.InputStream asciiStream;352353/**354* The <code>Reader</code> object that will be355* returned by the method <code>getCharacterStream</code>,356* which is specified in the <code>ResultSet</code> interface.357* @serial358*/359@SuppressWarnings("serial") // Not statically typed as Serializable360protected java.io.Reader charStream;361362/**363* The query that will be sent to the DBMS for execution when the364* method <code>execute</code> is called.365* @serial366*/367private String command;368369/**370* The JDBC URL the reader, writer, or both supply to the method371* <code>DriverManager.getConnection</code> when the372* <code>DriverManager</code> is used to get a connection.373* <P>374* The JDBC URL identifies the driver to be used to make the connection.375* This URL can be found in the documentation supplied by the driver376* vendor.377* @serial378*/379private String URL;380381/**382* The logical name of the data source that the reader/writer should use383* in order to retrieve a <code>DataSource</code> object from a Java384* Directory and Naming Interface (JNDI) naming service.385* @serial386*/387private String dataSource;388389/**390* The user name the reader, writer, or both supply to the method391* <code>DriverManager.getConnection</code> when the392* <code>DriverManager</code> is used to get a connection.393* @serial394*/395private transient String username;396397/**398* The password the reader, writer, or both supply to the method399* <code>DriverManager.getConnection</code> when the400* <code>DriverManager</code> is used to get a connection.401* @serial402*/403private transient String password;404405/**406* A constant indicating the type of this JDBC <code>RowSet</code>407* object. It must be one of the following <code>ResultSet</code>408* constants: <code>TYPE_FORWARD_ONLY</code>,409* <code>TYPE_SCROLL_INSENSITIVE</code>, or410* <code>TYPE_SCROLL_SENSITIVE</code>.411* @serial412*/413private int rowSetType = ResultSet.TYPE_SCROLL_INSENSITIVE;414415/**416* A <code>boolean</code> indicating whether deleted rows are visible in this417* JDBC <code>RowSet</code> object .418* @serial419*/420private boolean showDeleted = false; // default is false421422/**423* The maximum number of seconds the driver424* will wait for a command to execute. This limit applies while425* this JDBC <code>RowSet</code> object is connected to its data426* source, that is, while it is populating itself with427* data and while it is writing data back to the data source.428* @serial429*/430private int queryTimeout = 0; // default is no timeout431432/**433* The maximum number of rows the reader should read.434* @serial435*/436private int maxRows = 0; // default is no limit437438/**439* The maximum field size the reader should read.440* @serial441*/442private int maxFieldSize = 0; // default is no limit443444/**445* A constant indicating the concurrency of this JDBC <code>RowSet</code>446* object. It must be one of the following <code>ResultSet</code>447* constants: <code>CONCUR_READ_ONLY</code> or448* <code>CONCUR_UPDATABLE</code>.449* @serial450*/451private int concurrency = ResultSet.CONCUR_UPDATABLE;452453/**454* A <code>boolean</code> indicating whether this JDBC <code>RowSet</code>455* object is read-only. <code>true</code> indicates that it is read-only;456* <code>false</code> that it is writable.457* @serial458*/459private boolean readOnly;460461/**462* A <code>boolean</code> indicating whether the reader for this463* JDBC <code>RowSet</code> object should perform escape processing.464* <code>true</code> means that escape processing is turned on;465* <code>false</code> that it is not. The default is <code>true</code>.466* @serial467*/468private boolean escapeProcessing = true;469470/**471* A constant indicating the isolation level of the connection472* for this JDBC <code>RowSet</code> object . It must be one of473* the following <code>Connection</code> constants:474* <code>TRANSACTION_NONE</code>,475* <code>TRANSACTION_READ_UNCOMMITTED</code>,476* <code>TRANSACTION_READ_COMMITTED</code>,477* <code>TRANSACTION_REPEATABLE_READ</code> or478* <code>TRANSACTION_SERIALIZABLE</code>.479* @serial480*/481private int isolation;482483/**484* A constant used as a hint to the driver that indicates the direction in485* which data from this JDBC <code>RowSet</code> object is going486* to be fetched. The following <code>ResultSet</code> constants are487* possible values:488* <code>FETCH_FORWARD</code>,489* <code>FETCH_REVERSE</code>,490* <code>FETCH_UNKNOWN</code>.491* <P>492* Unused at this time.493* @serial494*/495private int fetchDir = ResultSet.FETCH_FORWARD; // default fetch direction496497/**498* A hint to the driver that indicates the expected number of rows499* in this JDBC <code>RowSet</code> object .500* <P>501* Unused at this time.502* @serial503*/504private int fetchSize = 0; // default fetchSize505506/**507* The <code>java.util.Map</code> object that contains entries mapping508* SQL type names to classes in the Java programming language for the509* custom mapping of user-defined types.510* @serial511*/512@SuppressWarnings("serial") // Not statically typed as Serializable513private Map<String, Class<?>> map;514515/**516* A <code>Vector</code> object that holds the list of listeners517* that have registered with this <code>RowSet</code> object.518* @serial519*/520private Vector<RowSetListener> listeners;521522/**523* A <code>Vector</code> object that holds the parameters set524* for this <code>RowSet</code> object's current command.525* @serial526*/527private Hashtable<Integer, Object> params; // could be transient?528529/**530* Constructs a new <code>BaseRowSet</code> object initialized with531* a default <code>Vector</code> object for its <code>listeners</code>532* field. The other default values with which it is initialized are listed533* in Section 6.0 of the class comment for this class.534*/535public BaseRowSet() {536// allocate the listeners collection537listeners = new Vector<RowSetListener>();538}539540/**541* Performs the necessary internal configurations and initializations542* to allow any JDBC <code>RowSet</code> implementation to start using543* the standard facilities provided by a <code>BaseRowSet</code>544* instance. This method <b>should</b> be called after the <code>RowSet</code> object545* has been instantiated to correctly initialize all parameters. This method546* <b>should</b> never be called by an application, but is called from with547* a <code>RowSet</code> implementation extending this class.548*/549protected void initParams() {550params = new Hashtable<Integer, Object>();551}552553//--------------------------------------------------------------------554// Events555//--------------------------------------------------------------------556557/**558* The listener will be notified whenever an event occurs on this <code>RowSet</code>559* object.560* <P>561* A listener might, for example, be a table or graph that needs to562* be updated in order to accurately reflect the current state of563* the <code>RowSet</code> object.564* <p>565* <b>Note</b>: if the <code>RowSetListener</code> object is566* <code>null</code>, this method silently discards the <code>null</code>567* value and does not add a null reference to the set of listeners.568* <p>569* <b>Note</b>: if the listener is already set, and the new <code>RowSetListener</code>570* instance is added to the set of listeners already registered to receive571* event notifications from this <code>RowSet</code>.572*573* @param listener an object that has implemented the574* <code>javax.sql.RowSetListener</code> interface and wants to be notified575* of any events that occur on this <code>RowSet</code> object; May be576* null.577* @see #removeRowSetListener578*/579public void addRowSetListener(RowSetListener listener) {580listeners.add(listener);581}582583/**584* Removes the designated object from this <code>RowSet</code> object's list of listeners.585* If the given argument is not a registered listener, this method586* does nothing.587*588* <b>Note</b>: if the <code>RowSetListener</code> object is589* <code>null</code>, this method silently discards the <code>null</code>590* value.591*592* @param listener a <code>RowSetListener</code> object that is on the list593* of listeners for this <code>RowSet</code> object594* @see #addRowSetListener595*/596public void removeRowSetListener(RowSetListener listener) {597listeners.remove(listener);598}599600/**601* Determine if instance of this class extends the RowSet interface.602*/603private void checkforRowSetInterface() throws SQLException {604if ((this instanceof javax.sql.RowSet) == false) {605throw new SQLException("The class extending abstract class BaseRowSet " +606"must implement javax.sql.RowSet or one of it's sub-interfaces.");607}608}609610/**611* Notifies all of the listeners registered with this612* <code>RowSet</code> object that its cursor has moved.613* <P>614* When an application calls a method to move the cursor,615* that method moves the cursor and then calls this method616* internally. An application <b>should</b> never invoke617* this method directly.618*619* @throws SQLException if the class extending the <code>BaseRowSet</code>620* abstract class does not implement the <code>RowSet</code> interface or621* one of it's sub-interfaces.622*/623protected void notifyCursorMoved() throws SQLException {624checkforRowSetInterface();625if (listeners.isEmpty() == false) {626RowSetEvent event = new RowSetEvent((RowSet)this);627for (RowSetListener rsl : listeners) {628rsl.cursorMoved(event);629}630}631}632633/**634* Notifies all of the listeners registered with this <code>RowSet</code> object that635* one of its rows has changed.636* <P>637* When an application calls a method that changes a row, such as638* the <code>CachedRowSet</code> methods <code>insertRow</code>,639* <code>updateRow</code>, or <code>deleteRow</code>,640* that method calls <code>notifyRowChanged</code>641* internally. An application <b>should</b> never invoke642* this method directly.643*644* @throws SQLException if the class extending the <code>BaseRowSet</code>645* abstract class does not implement the <code>RowSet</code> interface or646* one of it's sub-interfaces.647*/648protected void notifyRowChanged() throws SQLException {649checkforRowSetInterface();650if (listeners.isEmpty() == false) {651RowSetEvent event = new RowSetEvent((RowSet)this);652for (RowSetListener rsl : listeners) {653rsl.rowChanged(event);654}655}656}657658/**659* Notifies all of the listeners registered with this <code>RowSet</code>660* object that its entire contents have changed.661* <P>662* When an application calls methods that change the entire contents663* of the <code>RowSet</code> object, such as the <code>CachedRowSet</code> methods664* <code>execute</code>, <code>populate</code>, <code>restoreOriginal</code>,665* or <code>release</code>, that method calls <code>notifyRowSetChanged</code>666* internally (either directly or indirectly). An application <b>should</b>667* never invoke this method directly.668*669* @throws SQLException if the class extending the <code>BaseRowSet</code>670* abstract class does not implement the <code>RowSet</code> interface or671* one of it's sub-interfaces.672*/673protected void notifyRowSetChanged() throws SQLException {674checkforRowSetInterface();675if (listeners.isEmpty() == false) {676RowSetEvent event = new RowSetEvent((RowSet)this);677for (RowSetListener rsl : listeners) {678rsl.rowSetChanged(event);679}680}681}682683/**684* Retrieves the SQL query that is the command for this685* <code>RowSet</code> object. The command property contains the query that686* will be executed to populate this <code>RowSet</code> object.687* <P>688* The SQL query returned by this method is used by <code>RowSet</code> methods689* such as <code>execute</code> and <code>populate</code>, which may be implemented690* by any class that extends the <code>BaseRowSet</code> abstract class and691* implements one or more of the standard JSR-114 <code>RowSet</code>692* interfaces.693* <P>694* The command is used by the <code>RowSet</code> object's695* reader to obtain a <code>ResultSet</code> object. The reader then696* reads the data from the <code>ResultSet</code> object and uses it to697* to populate this <code>RowSet</code> object.698* <P>699* The default value for the <code>command</code> property is <code>null</code>.700*701* @return the <code>String</code> that is the value for this702* <code>RowSet</code> object's <code>command</code> property;703* may be <code>null</code>704* @see #setCommand705*/706public String getCommand() {707return command;708}709710/**711* Sets this <code>RowSet</code> object's <code>command</code> property to712* the given <code>String</code> object and clears the parameters, if any,713* that were set for the previous command.714* <P>715* The <code>command</code> property may not be needed if the <code>RowSet</code>716* object gets its data from a source that does not support commands,717* such as a spreadsheet or other tabular file.718* Thus, this property is optional and may be <code>null</code>.719*720* @param cmd a <code>String</code> object containing an SQL query721* that will be set as this <code>RowSet</code> object's command722* property; may be <code>null</code> but may not be an empty string723* @throws SQLException if an empty string is provided as the command value724* @see #getCommand725*/726public void setCommand(String cmd) throws SQLException {727// cmd equal to null or728// cmd with length 0 (implies url =="")729// are not independent events.730731if(cmd == null) {732command = null;733} else if (cmd.length() == 0) {734throw new SQLException("Invalid command string detected. " +735"Cannot be of length less than 0");736} else {737// "unbind" any parameters from any previous command.738if(params == null){739throw new SQLException("Set initParams() before setCommand");740}741params.clear();742command = cmd;743}744745}746747/**748* Retrieves the JDBC URL that this <code>RowSet</code> object's749* <code>javax.sql.Reader</code> object uses to make a connection750* with a relational database using a JDBC technology-enabled driver.751*<P>752* The <code>Url</code> property will be <code>null</code> if the underlying data753* source is a non-SQL data source, such as a spreadsheet or an XML754* data source.755*756* @return a <code>String</code> object that contains the JDBC URL757* used to establish the connection for this <code>RowSet</code>758* object; may be <code>null</code> (default value) if not set759* @throws SQLException if an error occurs retrieving the URL value760* @see #setUrl761*/762public String getUrl() throws SQLException {763return URL;764}765766/**767* Sets the Url property for this <code>RowSet</code> object768* to the given <code>String</code> object and sets the dataSource name769* property to <code>null</code>. The Url property is a770* JDBC URL that is used when771* the connection is created using a JDBC technology-enabled driver772* ("JDBC driver") and the <code>DriverManager</code>.773* The correct JDBC URL for the specific driver to be used can be found774* in the driver documentation. Although there are guidelines for how775* a JDBC URL is formed,776* a driver vendor can specify any <code>String</code> object except777* one with a length of <code>0</code> (an empty string).778* <P>779* Setting the Url property is optional if connections are established using780* a <code>DataSource</code> object instead of the <code>DriverManager</code>.781* The driver will use either the URL property or the782* dataSourceName property to create a connection, whichever was783* specified most recently. If an application uses a JDBC URL, it784* must load a JDBC driver that accepts the JDBC URL before it uses the785* <code>RowSet</code> object to connect to a database. The <code>RowSet</code>786* object will use the URL internally to create a database connection in order787* to read or write data.788*789* @param url a <code>String</code> object that contains the JDBC URL790* that will be used to establish the connection to a database for this791* <code>RowSet</code> object; may be <code>null</code> but must not792* be an empty string793* @throws SQLException if an error occurs setting the Url property or the794* parameter supplied is a string with a length of <code>0</code> (an795* empty string)796* @see #getUrl797*/798public void setUrl(String url) throws SQLException {799if(url == null) {800url = null;801} else if (url.length() < 1) {802throw new SQLException("Invalid url string detected. " +803"Cannot be of length less than 1");804} else {805URL = url;806}807808dataSource = null;809810}811812/**813* Returns the logical name that when supplied to a naming service814* that uses the Java Naming and Directory Interface (JNDI) API, will815* retrieve a <code>javax.sql.DataSource</code> object. This816* <code>DataSource</code> object can be used to establish a connection817* to the data source that it represents.818* <P>819* Users should set either the url or the data source name property.820* The driver will use the property set most recently to establish a821* connection.822*823* @return a <code>String</code> object that identifies the824* <code>DataSource</code> object to be used for making a825* connection; if no logical name has been set, <code>null</code>826* is returned.827* @see #setDataSourceName828*/829public String getDataSourceName() {830return dataSource;831}832833834/**835* Sets the <code>DataSource</code> name property for this <code>RowSet</code>836* object to the given logical name and sets this <code>RowSet</code> object's837* Url property to <code>null</code>. The name must have been bound to a838* <code>DataSource</code> object in a JNDI naming service so that an839* application can do a lookup using that name to retrieve the840* <code>DataSource</code> object bound to it. The <code>DataSource</code>841* object can then be used to establish a connection to the data source it842* represents.843* <P>844* Users should set either the Url property or the dataSourceName property.845* If both properties are set, the driver will use the property set most recently.846*847* @param name a <code>String</code> object with the name that can be supplied848* to a naming service based on JNDI technology to retrieve the849* <code>DataSource</code> object that can be used to get a connection;850* may be <code>null</code> but must not be an empty string851* @throws SQLException if an empty string is provided as the <code>DataSource</code>852* name853* @see #getDataSourceName854*/855public void setDataSourceName(String name) throws SQLException {856857if (name == null) {858dataSource = null;859} else if (name.isEmpty()) {860throw new SQLException("DataSource name cannot be empty string");861} else {862dataSource = name;863}864865URL = null;866}867868/**869* Returns the user name used to create a database connection. Because it870* is not serialized, the username property is set at runtime before871* calling the method <code>execute</code>.872*873* @return the <code>String</code> object containing the user name that874* is supplied to the data source to create a connection; may be875* <code>null</code> (default value) if not set876* @see #setUsername877*/878public String getUsername() {879return username;880}881882/**883* Sets the username property for this <code>RowSet</code> object884* to the given user name. Because it885* is not serialized, the username property is set at run time before886* calling the method <code>execute</code>.887*888* @param name the <code>String</code> object containing the user name that889* is supplied to the data source to create a connection. It may be null.890* @see #getUsername891*/892public void setUsername(String name) {893if(name == null)894{895username = null;896} else {897username = name;898}899}900901/**902* Returns the password used to create a database connection for this903* <code>RowSet</code> object. Because the password property is not904* serialized, it is set at run time before calling the method905* <code>execute</code>. The default value is <code>null</code>906*907* @return the <code>String</code> object that represents the password908* that must be supplied to the database to create a connection909* @see #setPassword910*/911public String getPassword() {912return password;913}914915/**916* Sets the password used to create a database connection for this917* <code>RowSet</code> object to the given <code>String</code>918* object. Because the password property is not919* serialized, it is set at run time before calling the method920* <code>execute</code>.921*922* @param pass the <code>String</code> object that represents the password923* that is supplied to the database to create a connection. It may be924* null.925* @see #getPassword926*/927public void setPassword(String pass) {928if(pass == null)929{930password = null;931} else {932password = pass;933}934}935936/**937* Sets the type for this <code>RowSet</code> object to the specified type.938* The default type is <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>.939*940* @param type one of the following constants:941* <code>ResultSet.TYPE_FORWARD_ONLY</code>,942* <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or943* <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>944* @throws SQLException if the parameter supplied is not one of the945* following constants:946* <code>ResultSet.TYPE_FORWARD_ONLY</code> or947* <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>948* <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>949* @see #getConcurrency950* @see #getType951*/952public void setType(int type) throws SQLException {953954if ((type != ResultSet.TYPE_FORWARD_ONLY) &&955(type != ResultSet.TYPE_SCROLL_INSENSITIVE) &&956(type != ResultSet.TYPE_SCROLL_SENSITIVE)) {957throw new SQLException("Invalid type of RowSet set. Must be either " +958"ResultSet.TYPE_FORWARD_ONLY or ResultSet.TYPE_SCROLL_INSENSITIVE " +959"or ResultSet.TYPE_SCROLL_SENSITIVE.");960}961this.rowSetType = type;962}963964/**965* Returns the type of this <code>RowSet</code> object. The type is initially966* determined by the statement that created the <code>RowSet</code> object.967* The <code>RowSet</code> object can call the method968* <code>setType</code> at any time to change its969* type. The default is <code>TYPE_SCROLL_INSENSITIVE</code>.970*971* @return the type of this JDBC <code>RowSet</code>972* object, which must be one of the following:973* <code>ResultSet.TYPE_FORWARD_ONLY</code>,974* <code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or975* <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>976* @throws SQLException if an error occurs getting the type of977* of this <code>RowSet</code> object978* @see #setType979*/980public int getType() throws SQLException {981return rowSetType;982}983984/**985* Sets the concurrency for this <code>RowSet</code> object to986* the specified concurrency. The default concurrency for any <code>RowSet</code>987* object (connected or disconnected) is <code>ResultSet.CONCUR_UPDATABLE</code>,988* but this method may be called at any time to change the concurrency.989*990* @param concurrency one of the following constants:991* <code>ResultSet.CONCUR_READ_ONLY</code> or992* <code>ResultSet.CONCUR_UPDATABLE</code>993* @throws SQLException if the parameter supplied is not one of the994* following constants:995* <code>ResultSet.CONCUR_UPDATABLE</code> or996* <code>ResultSet.CONCUR_READ_ONLY</code>997* @see #getConcurrency998* @see #isReadOnly999*/1000public void setConcurrency(int concurrency) throws SQLException {10011002if((concurrency != ResultSet.CONCUR_READ_ONLY) &&1003(concurrency != ResultSet.CONCUR_UPDATABLE)) {1004throw new SQLException("Invalid concurrency set. Must be either " +1005"ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE.");1006}1007this.concurrency = concurrency;1008}10091010/**1011* Returns a <code>boolean</code> indicating whether this1012* <code>RowSet</code> object is read-only.1013* Any attempts to update a read-only <code>RowSet</code> object will result in an1014* <code>SQLException</code> being thrown. By default,1015* rowsets are updatable if updates are possible.1016*1017* @return <code>true</code> if this <code>RowSet</code> object1018* cannot be updated; <code>false</code> otherwise1019* @see #setConcurrency1020* @see #setReadOnly1021*/1022public boolean isReadOnly() {1023return readOnly;1024};10251026/**1027* Sets this <code>RowSet</code> object's readOnly property to the given <code>boolean</code>.1028*1029* @param value <code>true</code> to indicate that this1030* <code>RowSet</code> object is read-only;1031* <code>false</code> to indicate that it is updatable1032*/1033public void setReadOnly(boolean value) {1034readOnly = value;1035}10361037/**1038* Returns the transaction isolation property for this1039* <code>RowSet</code> object's connection. This property represents1040* the transaction isolation level requested for use in transactions.1041* <P>1042* For <code>RowSet</code> implementations such as1043* the <code>CachedRowSet</code> that operate in a disconnected environment,1044* the <code>SyncProvider</code> object1045* offers complementary locking and data integrity options. The1046* options described below are pertinent only to connected <code>RowSet</code>1047* objects (<code>JdbcRowSet</code> objects).1048*1049* @return one of the following constants:1050* <code>Connection.TRANSACTION_NONE</code>,1051* <code>Connection.TRANSACTION_READ_UNCOMMITTED</code>,1052* <code>Connection.TRANSACTION_READ_COMMITTED</code>,1053* <code>Connection.TRANSACTION_REPEATABLE_READ</code>, or1054* <code>Connection.TRANSACTION_SERIALIZABLE</code>1055* @see javax.sql.rowset.spi.SyncFactory1056* @see javax.sql.rowset.spi.SyncProvider1057* @see #setTransactionIsolation10581059*/1060public int getTransactionIsolation() {1061return isolation;1062};10631064/**1065* Sets the transaction isolation property for this JDBC <code>RowSet</code> object to the given1066* constant. The DBMS will use this transaction isolation level for1067* transactions if it can.1068* <p>1069* For <code>RowSet</code> implementations such as1070* the <code>CachedRowSet</code> that operate in a disconnected environment,1071* the <code>SyncProvider</code> object being used1072* offers complementary locking and data integrity options. The1073* options described below are pertinent only to connected <code>RowSet</code>1074* objects (<code>JdbcRowSet</code> objects).1075*1076* @param level one of the following constants, listed in ascending order:1077* <code>Connection.TRANSACTION_NONE</code>,1078* <code>Connection.TRANSACTION_READ_UNCOMMITTED</code>,1079* <code>Connection.TRANSACTION_READ_COMMITTED</code>,1080* <code>Connection.TRANSACTION_REPEATABLE_READ</code>, or1081* <code>Connection.TRANSACTION_SERIALIZABLE</code>1082* @throws SQLException if the given parameter is not one of the Connection1083* constants1084* @see javax.sql.rowset.spi.SyncFactory1085* @see javax.sql.rowset.spi.SyncProvider1086* @see #getTransactionIsolation1087*/1088public void setTransactionIsolation(int level) throws SQLException {1089if ((level != Connection.TRANSACTION_NONE) &&1090(level != Connection.TRANSACTION_READ_COMMITTED) &&1091(level != Connection.TRANSACTION_READ_UNCOMMITTED) &&1092(level != Connection.TRANSACTION_REPEATABLE_READ) &&1093(level != Connection.TRANSACTION_SERIALIZABLE))1094{1095throw new SQLException("Invalid transaction isolation set. Must " +1096"be either " +1097"Connection.TRANSACTION_NONE or " +1098"Connection.TRANSACTION_READ_UNCOMMITTED or " +1099"Connection.TRANSACTION_READ_COMMITTED or " +1100"Connection.TRANSACTION_REPEATABLE_READ or " +1101"Connection.TRANSACTION_SERIALIZABLE");1102}1103this.isolation = level;1104}11051106/**1107* Retrieves the type map associated with the <code>Connection</code>1108* object for this <code>RowSet</code> object.1109* <P>1110* Drivers that support the JDBC 3.0 API will create1111* <code>Connection</code> objects with an associated type map.1112* This type map, which is initially empty, can contain one or more1113* fully-qualified SQL names and <code>Class</code> objects indicating1114* the class to which the named SQL value will be mapped. The type mapping1115* specified in the connection's type map is used for custom type mapping1116* when no other type map supersedes it.1117* <p>1118* If a type map is explicitly supplied to a method that can perform1119* custom mapping, that type map supersedes the connection's type map.1120*1121* @return the <code>java.util.Map</code> object that is the type map1122* for this <code>RowSet</code> object's connection1123*/1124public java.util.Map<String,Class<?>> getTypeMap() {1125return map;1126}11271128/**1129* Installs the given <code>java.util.Map</code> object as the type map1130* associated with the <code>Connection</code> object for this1131* <code>RowSet</code> object. The custom mapping indicated in1132* this type map will be used unless a different type map is explicitly1133* supplied to a method, in which case the type map supplied will be used.1134*1135* @param map a <code>java.util.Map</code> object that contains the1136* mapping from SQL type names for user defined types (UDT) to classes in1137* the Java programming language. Each entry in the <code>Map</code>1138* object consists of the fully qualified SQL name of a UDT and the1139* <code>Class</code> object for the <code>SQLData</code> implementation1140* of that UDT. May be <code>null</code>.1141*/1142public void setTypeMap(java.util.Map<String,Class<?>> map) {1143this.map = map;1144}11451146/**1147* Retrieves the maximum number of bytes that can be used for a column1148* value in this <code>RowSet</code> object.1149* This limit applies only to columns that hold values of the1150* following types: <code>BINARY</code>, <code>VARBINARY</code>,1151* <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>,1152* and <code>LONGVARCHAR</code>. If the limit is exceeded, the excess1153* data is silently discarded.1154*1155* @return an <code>int</code> indicating the current maximum column size1156* limit; zero means that there is no limit1157* @throws SQLException if an error occurs internally determining the1158* maximum limit of the column size1159*/1160public int getMaxFieldSize() throws SQLException {1161return maxFieldSize;1162}11631164/**1165* Sets the maximum number of bytes that can be used for a column1166* value in this <code>RowSet</code> object to the given number.1167* This limit applies only to columns that hold values of the1168* following types: <code>BINARY</code>, <code>VARBINARY</code>,1169* <code>LONGVARBINARY</code>, <code>CHAR</code>, <code>VARCHAR</code>,1170* and <code>LONGVARCHAR</code>. If the limit is exceeded, the excess1171* data is silently discarded. For maximum portability, it is advisable to1172* use values greater than 256.1173*1174* @param max an <code>int</code> indicating the new maximum column size1175* limit; zero means that there is no limit1176* @throws SQLException if (1) an error occurs internally setting the1177* maximum limit of the column size or (2) a size of less than 0 is set1178*/1179public void setMaxFieldSize(int max) throws SQLException {1180if (max < 0) {1181throw new SQLException("Invalid max field size set. Cannot be of " +1182"value: " + max);1183}1184maxFieldSize = max;1185}11861187/**1188* Retrieves the maximum number of rows that this <code>RowSet</code> object may contain. If1189* this limit is exceeded, the excess rows are silently dropped.1190*1191* @return an <code>int</code> indicating the current maximum number of1192* rows; zero means that there is no limit1193* @throws SQLException if an error occurs internally determining the1194* maximum limit of rows that a <code>Rowset</code> object can contain1195*/1196public int getMaxRows() throws SQLException {1197return maxRows;1198}11991200/**1201* Sets the maximum number of rows that this <code>RowSet</code> object may contain to1202* the given number. If this limit is exceeded, the excess rows are1203* silently dropped.1204*1205* @param max an <code>int</code> indicating the current maximum number1206* of rows; zero means that there is no limit1207* @throws SQLException if an error occurs internally setting the1208* maximum limit on the number of rows that a JDBC <code>RowSet</code> object1209* can contain; or if <i>max</i> is less than <code>0</code>; or1210* if <i>max</i> is less than the <code>fetchSize</code> of the1211* <code>RowSet</code>1212*/1213public void setMaxRows(int max) throws SQLException {1214if (max < 0) {1215throw new SQLException("Invalid max row size set. Cannot be of " +1216"value: " + max);1217} else if (max < this.getFetchSize()) {1218throw new SQLException("Invalid max row size set. Cannot be less " +1219"than the fetchSize.");1220}1221this.maxRows = max;1222}12231224/**1225* Sets to the given <code>boolean</code> whether or not the driver will1226* scan for escape syntax and do escape substitution before sending SQL1227* statements to the database. The default is for the driver to do escape1228* processing.1229* <P>1230* Note: Since <code>PreparedStatement</code> objects have usually been1231* parsed prior to making this call, disabling escape processing for1232* prepared statements will likely have no effect.1233*1234* @param enable <code>true</code> to enable escape processing;1235* <code>false</code> to disable it1236* @throws SQLException if an error occurs setting the underlying JDBC1237* technology-enabled driver to process the escape syntax1238*/1239public void setEscapeProcessing(boolean enable) throws SQLException {1240escapeProcessing = enable;1241}12421243/**1244* Retrieves the maximum number of seconds the driver will wait for a1245* query to execute. If the limit is exceeded, an <code>SQLException</code>1246* is thrown.1247*1248* @return the current query timeout limit in seconds; zero means that1249* there is no limit1250* @throws SQLException if an error occurs in determining the query1251* time-out value1252*/1253public int getQueryTimeout() throws SQLException {1254return queryTimeout;1255}12561257/**1258* Sets to the given number the maximum number of seconds the driver will1259* wait for a query to execute. If the limit is exceeded, an1260* <code>SQLException</code> is thrown.1261*1262* @param seconds the new query time-out limit in seconds; zero means that1263* there is no limit; must not be less than zero1264* @throws SQLException if an error occurs setting the query1265* time-out or if the query time-out value is less than 01266*/1267public void setQueryTimeout(int seconds) throws SQLException {1268if (seconds < 0) {1269throw new SQLException("Invalid query timeout value set. Cannot be " +1270"of value: " + seconds);1271}1272this.queryTimeout = seconds;1273}12741275/**1276* Retrieves a <code>boolean</code> indicating whether rows marked1277* for deletion appear in the set of current rows.1278* The default value is <code>false</code>.1279* <P>1280* Note: Allowing deleted rows to remain visible complicates the behavior1281* of some of the methods. However, most <code>RowSet</code> object users1282* can simply ignore this extra detail because only sophisticated1283* applications will likely want to take advantage of this feature.1284*1285* @return <code>true</code> if deleted rows are visible;1286* <code>false</code> otherwise1287* @throws SQLException if an error occurs determining if deleted rows1288* are visible or not1289* @see #setShowDeleted1290*/1291public boolean getShowDeleted() throws SQLException {1292return showDeleted;1293}12941295/**1296* Sets the property <code>showDeleted</code> to the given1297* <code>boolean</code> value, which determines whether1298* rows marked for deletion appear in the set of current rows.1299*1300* @param value <code>true</code> if deleted rows should be shown;1301* <code>false</code> otherwise1302* @throws SQLException if an error occurs setting whether deleted1303* rows are visible or not1304* @see #getShowDeleted1305*/1306public void setShowDeleted(boolean value) throws SQLException {1307showDeleted = value;1308}13091310/**1311* Ascertains whether escape processing is enabled for this1312* <code>RowSet</code> object.1313*1314* @return <code>true</code> if escape processing is turned on;1315* <code>false</code> otherwise1316* @throws SQLException if an error occurs determining if escape1317* processing is enabled or not or if the internal escape1318* processing trigger has not been enabled1319*/1320public boolean getEscapeProcessing() throws SQLException {1321return escapeProcessing;1322}13231324/**1325* Gives the driver a performance hint as to the direction in1326* which the rows in this <code>RowSet</code> object will be1327* processed. The driver may ignore this hint.1328* <P>1329* A <code>RowSet</code> object inherits the default properties of the1330* <code>ResultSet</code> object from which it got its data. That1331* <code>ResultSet</code> object's default fetch direction is set by1332* the <code>Statement</code> object that created it.1333* <P>1334* This method applies to a <code>RowSet</code> object only while it is1335* connected to a database using a JDBC driver.1336* <p>1337* A <code>RowSet</code> object may use this method at any time to change1338* its setting for the fetch direction.1339*1340* @param direction one of <code>ResultSet.FETCH_FORWARD</code>,1341* <code>ResultSet.FETCH_REVERSE</code>, or1342* <code>ResultSet.FETCH_UNKNOWN</code>1343* @throws SQLException if (1) the <code>RowSet</code> type is1344* <code>TYPE_FORWARD_ONLY</code> and the given fetch direction is not1345* <code>FETCH_FORWARD</code> or (2) the given fetch direction is not1346* one of the following:1347* ResultSet.FETCH_FORWARD,1348* ResultSet.FETCH_REVERSE, or1349* ResultSet.FETCH_UNKNOWN1350* @see #getFetchDirection1351*/1352public void setFetchDirection(int direction) throws SQLException {1353// Changed the condition checking to the below as there were two1354// conditions that had to be checked1355// 1. RowSet is TYPE_FORWARD_ONLY and direction is not FETCH_FORWARD1356// 2. Direction is not one of the valid values13571358if (((getType() == ResultSet.TYPE_FORWARD_ONLY) && (direction != ResultSet.FETCH_FORWARD)) ||1359((direction != ResultSet.FETCH_FORWARD) &&1360(direction != ResultSet.FETCH_REVERSE) &&1361(direction != ResultSet.FETCH_UNKNOWN))) {1362throw new SQLException("Invalid Fetch Direction");1363}1364fetchDir = direction;1365}13661367/**1368* Retrieves this <code>RowSet</code> object's current setting for the1369* fetch direction. The default type is <code>ResultSet.FETCH_FORWARD</code>1370*1371* @return one of <code>ResultSet.FETCH_FORWARD</code>,1372* <code>ResultSet.FETCH_REVERSE</code>, or1373* <code>ResultSet.FETCH_UNKNOWN</code>1374* @throws SQLException if an error occurs in determining the1375* current fetch direction for fetching rows1376* @see #setFetchDirection1377*/1378public int getFetchDirection() throws SQLException {13791380//Added the following code to throw a1381//SQL Exception if the fetchDir is not1382//set properly.Bug id:491415513831384// This checking is not necessary!13851386/*1387if((fetchDir != ResultSet.FETCH_FORWARD) &&1388(fetchDir != ResultSet.FETCH_REVERSE) &&1389(fetchDir != ResultSet.FETCH_UNKNOWN)) {1390throw new SQLException("Fetch Direction Invalid");1391}1392*/1393return (fetchDir);1394}13951396/**1397* Sets the fetch size for this <code>RowSet</code> object to the given number of1398* rows. The fetch size gives a JDBC technology-enabled driver ("JDBC driver")1399* a hint as to the1400* number of rows that should be fetched from the database when more rows1401* are needed for this <code>RowSet</code> object. If the fetch size specified1402* is zero, the driver ignores the value and is free to make its own best guess1403* as to what the fetch size should be.1404* <P>1405* A <code>RowSet</code> object inherits the default properties of the1406* <code>ResultSet</code> object from which it got its data. That1407* <code>ResultSet</code> object's default fetch size is set by1408* the <code>Statement</code> object that created it.1409* <P>1410* This method applies to a <code>RowSet</code> object only while it is1411* connected to a database using a JDBC driver.1412* For connected <code>RowSet</code> implementations such as1413* <code>JdbcRowSet</code>, this method has a direct and immediate effect1414* on the underlying JDBC driver.1415* <P>1416* A <code>RowSet</code> object may use this method at any time to change1417* its setting for the fetch size.1418* <p>1419* For <code>RowSet</code> implementations such as1420* <code>CachedRowSet</code>, which operate in a disconnected environment,1421* the <code>SyncProvider</code> object being used1422* may leverage the fetch size to poll the data source and1423* retrieve a number of rows that do not exceed the fetch size and that may1424* form a subset of the actual rows returned by the original query. This is1425* an implementation variance determined by the specific <code>SyncProvider</code>1426* object employed by the disconnected <code>RowSet</code> object.1427*1428* @param rows the number of rows to fetch; <code>0</code> to let the1429* driver decide what the best fetch size is; must not be less1430* than <code>0</code> or more than the maximum number of rows1431* allowed for this <code>RowSet</code> object (the number returned1432* by a call to the method {@link #getMaxRows})1433* @throws SQLException if the specified fetch size is less than <code>0</code>1434* or more than the limit for the maximum number of rows1435* @see #getFetchSize1436*/1437public void setFetchSize(int rows) throws SQLException {1438//Added this checking as maxRows can be 0 when this function is called1439//maxRows = 0 means rowset can hold any number of rows, os this checking1440// is needed to take care of this condition.1441if (getMaxRows() == 0 && rows >= 0) {1442fetchSize = rows;1443return;1444}1445if ((rows < 0) || (rows > getMaxRows())) {1446throw new SQLException("Invalid fetch size set. Cannot be of " +1447"value: " + rows);1448}1449fetchSize = rows;1450}14511452/**1453* Returns the fetch size for this <code>RowSet</code> object. The default1454* value is zero.1455*1456* @return the number of rows suggested as the fetch size when this <code>RowSet</code> object1457* needs more rows from the database1458* @throws SQLException if an error occurs determining the number of rows in the1459* current fetch size1460* @see #setFetchSize1461*/1462public int getFetchSize() throws SQLException {1463return fetchSize;1464}14651466/**1467* Returns the concurrency for this <code>RowSet</code> object.1468* The default is <code>CONCUR_UPDATABLE</code> for both connected and1469* disconnected <code>RowSet</code> objects.1470* <P>1471* An application can call the method <code>setConcurrency</code> at any time1472* to change a <code>RowSet</code> object's concurrency.1473*1474* @return the concurrency type for this <code>RowSet</code>1475* object, which must be one of the following:1476* <code>ResultSet.CONCUR_READ_ONLY</code> or1477* <code>ResultSet.CONCUR_UPDATABLE</code>1478* @throws SQLException if an error occurs getting the concurrency1479* of this <code>RowSet</code> object1480* @see #setConcurrency1481* @see #isReadOnly1482*/1483public int getConcurrency() throws SQLException {1484return concurrency;1485}14861487//-----------------------------------------------------------------------1488// Parameters1489//-----------------------------------------------------------------------14901491/**1492* Checks the given index to see whether it is less than <code>1</code> and1493* throws an <code>SQLException</code> object if it is.1494* <P>1495* This method is called by many methods internally; it is never1496* called by an application directly.1497*1498* @param idx an <code>int</code> indicating which parameter is to be1499* checked; the first parameter is <code>1</code>1500* @throws SQLException if the parameter is less than <code>1</code>1501*/1502private void checkParamIndex(int idx) throws SQLException {1503if ((idx < 1)) {1504throw new SQLException("Invalid Parameter Index");1505}1506}15071508//---------------------------------------------------------------------1509// setter methods for setting the parameters in a <code>RowSet</code> object's command1510//---------------------------------------------------------------------15111512/**1513* Sets the designated parameter to SQL <code>NULL</code>.1514* Note that the parameter's SQL type must be specified using one of the1515* type codes defined in <code>java.sql.Types</code>. This SQL type is1516* specified in the second parameter.1517* <p>1518* Note that the second parameter tells the DBMS the data type of the value being1519* set to <code>NULL</code>. Some DBMSs require this information, so it is required1520* in order to make code more portable.1521* <P>1522* The parameter value set by this method is stored internally and1523* will be supplied as the appropriate parameter in this <code>RowSet</code>1524* object's command when the method <code>execute</code> is called.1525* Methods such as <code>execute</code> and <code>populate</code> must be1526* provided in any class that extends this class and implements one or1527* more of the standard JSR-114 <code>RowSet</code> interfaces.1528* <P>1529* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method1530* as it is undefined in this class.1531* <P>1532* Calls made to the method <code>getParams</code> after this version of1533* <code>setNull</code>1534* has been called will return an <code>Object</code> array containing the parameter values that1535* have been set. In that array, the element that represents the values1536* set with this method will itself be an array. The first element of that array1537* is <code>null</code>.1538* The second element is the value set for <i>sqlType</i>.1539* The parameter number is indicated by an element's position in the array1540* returned by the method <code>getParams</code>,1541* with the first element being the value for the first placeholder parameter, the1542* second element being the value for the second placeholder parameter, and so on.1543* In other words, if the second placeholder parameter is being set to1544* <code>null</code>, the array containing it will be the second element in1545* the array returned by <code>getParams</code>.1546* <P>1547* Note that because the numbering of elements in an array starts at zero,1548* the array element that corresponds to placeholder parameter number1549* <i>parameterIndex</i> is <i>parameterIndex</i> -1.1550*1551* @param parameterIndex the ordinal number of the placeholder parameter1552* in this <code>RowSet</code> object's command that is to be set.1553* The first parameter is 1, the second is 2, and so on; must be1554* <code>1</code> or greater1555* @param sqlType an <code>int</code> that is one of the SQL type codes1556* defined in the class {@link java.sql.Types}. If a non-standard1557* <i>sqlType</i> is supplied, this method will not throw a1558* <code>SQLException</code>. This allows implicit support for1559* non-standard SQL types.1560* @throws SQLException if a database access error occurs or the given1561* parameter index is out of bounds1562* @see #getParams1563*/1564public void setNull(int parameterIndex, int sqlType) throws SQLException {1565Object nullVal[];1566checkParamIndex(parameterIndex);15671568nullVal = new Object[2];1569nullVal[0] = null;1570nullVal[1] = Integer.valueOf(sqlType);15711572if (params == null){1573throw new SQLException("Set initParams() before setNull");1574}15751576params.put(Integer.valueOf(parameterIndex - 1), nullVal);1577}15781579/**1580* Sets the designated parameter to SQL <code>NULL</code>.1581*1582* Although this version of the method <code>setNull</code> is intended1583* for user-defined1584* and <code>REF</code> parameters, this method may be used to set a null1585* parameter for any JDBC type. The following are user-defined types:1586* <code>STRUCT</code>, <code>DISTINCT</code>, and <code>JAVA_OBJECT</code>,1587* and named array types.1588*1589* <P><B>Note:</B> To be portable, applications must give the1590* SQL type code and the fully qualified SQL type name when specifying1591* a <code>NULL</code> user-defined or <code>REF</code> parameter.1592* In the case of a user-defined type, the name is the type name of1593* the parameter itself. For a <code>REF</code> parameter, the name is1594* the type name of the referenced type. If a JDBC technology-enabled1595* driver does not need the type code or type name information,1596* it may ignore it.1597* <P>1598* If the parameter does not have a user-defined or <code>REF</code> type,1599* the given <code>typeName</code> parameter is ignored.1600* <P>1601* The parameter value set by this method is stored internally and1602* will be supplied as the appropriate parameter in this <code>RowSet</code>1603* object's command when the method <code>execute</code> is called.1604* Methods such as <code>execute</code> and <code>populate</code> must be1605* provided in any class that extends this class and implements one or1606* more of the standard JSR-114 <code>RowSet</code> interfaces.1607* <P>1608* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method1609* as it is undefined in this class.1610* <P>1611* Calls made to the method <code>getParams</code> after this version of1612* <code>setNull</code>1613* has been called will return an <code>Object</code> array containing the parameter values that1614* have been set. In that array, the element that represents the values1615* set with this method will itself be an array. The first element of that array1616* is <code>null</code>.1617* The second element is the value set for <i>sqlType</i>, and the third1618* element is the value set for <i>typeName</i>.1619* The parameter number is indicated by an element's position in the array1620* returned by the method <code>getParams</code>,1621* with the first element being the value for the first placeholder parameter, the1622* second element being the value for the second placeholder parameter, and so on.1623* In other words, if the second placeholder parameter is being set to1624* <code>null</code>, the array containing it will be the second element in1625* the array returned by <code>getParams</code>.1626* <P>1627* Note that because the numbering of elements in an array starts at zero,1628* the array element that corresponds to placeholder parameter number1629* <i>parameterIndex</i> is <i>parameterIndex</i> -1.1630*1631* @param parameterIndex the ordinal number of the placeholder parameter1632* in this <code>RowSet</code> object's command that is to be set.1633* The first parameter is 1, the second is 2, and so on; must be1634* <code>1</code> or greater1635* @param sqlType a value from <code>java.sql.Types</code>1636* @param typeName the fully qualified name of an SQL user-defined type,1637* which is ignored if the parameter is not a user-defined1638* type or <code>REF</code> value1639* @throws SQLException if an error occurs or the given parameter index1640* is out of bounds1641* @see #getParams1642*/1643public void setNull(int parameterIndex, int sqlType, String typeName)1644throws SQLException {16451646Object nullVal[];1647checkParamIndex(parameterIndex);16481649nullVal = new Object[3];1650nullVal[0] = null;1651nullVal[1] = Integer.valueOf(sqlType);1652nullVal[2] = typeName;16531654if(params == null){1655throw new SQLException("Set initParams() before setNull");1656}16571658params.put(Integer.valueOf(parameterIndex - 1), nullVal);1659}166016611662/**1663* Sets the designated parameter to the given <code>boolean</code> in the1664* Java programming language. The driver converts this to an SQL1665* <code>BIT</code> value when it sends it to the database.1666* <P>1667* The parameter value set by this method is stored internally and1668* will be supplied as the appropriate parameter in this <code>RowSet</code>1669* object's command when the method <code>execute</code> is called.1670* Methods such as <code>execute</code>, <code>populate</code> must be1671* provided in any class that extends this class and implements one or1672* more of the standard JSR-114 <code>RowSet</code> interfaces.1673* <p>1674* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method1675* as it is undefined in this class.1676*1677* @param parameterIndex the ordinal number of the placeholder parameter1678* in this <code>RowSet</code> object's command that is to be set.1679* The first parameter is 1, the second is 2, and so on; must be1680* <code>1</code> or greater1681* @param x the parameter value1682* @throws SQLException if an error occurs or the1683* parameter index is out of bounds1684* @see #getParams1685*/1686public void setBoolean(int parameterIndex, boolean x) throws SQLException {1687checkParamIndex(parameterIndex);16881689if(params == null){1690throw new SQLException("Set initParams() before setNull");1691}16921693params.put(Integer.valueOf(parameterIndex - 1), Boolean.valueOf(x));1694}16951696/**1697* Sets the designated parameter to the given <code>byte</code> in the Java1698* programming language. The driver converts this to an SQL1699* <code>TINYINT</code> value when it sends it to the database.1700* <P>1701* The parameter value set by this method is stored internally and1702* will be supplied as the appropriate parameter in this <code>RowSet</code>1703* object's command when the method <code>execute</code> is called.1704* Methods such as <code>execute</code> and <code>populate</code> must be1705* provided in any class that extends this class and implements one or1706* more of the standard JSR-114 <code>RowSet</code> interfaces.1707* <p>1708* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method1709* as it is undefined in this class.1710*1711* @param parameterIndex the ordinal number of the placeholder parameter1712* in this <code>RowSet</code> object's command that is to be set.1713* The first parameter is 1, the second is 2, and so on; must be1714* <code>1</code> or greater1715* @param x the parameter value1716* @throws SQLException if an error occurs or the1717* parameter index is out of bounds1718* @see #getParams1719*/1720public void setByte(int parameterIndex, byte x) throws SQLException {1721checkParamIndex(parameterIndex);17221723if(params == null){1724throw new SQLException("Set initParams() before setByte");1725}17261727params.put(Integer.valueOf(parameterIndex - 1), Byte.valueOf(x));1728}17291730/**1731* Sets the designated parameter to the given <code>short</code> in the1732* Java programming language. The driver converts this to an SQL1733* <code>SMALLINT</code> value when it sends it to the database.1734* <P>1735* The parameter value set by this method is stored internally and1736* will be supplied as the appropriate parameter in this <code>RowSet</code>1737* object's command when the method <code>execute</code> is called.1738* Methods such as <code>execute</code> and <code>populate</code> must be1739* provided in any class that extends this class and implements one or1740* more of the standard JSR-114 <code>RowSet</code> interfaces.1741* <p>1742* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method1743* as it is undefined in this class.1744*1745* @param parameterIndex the ordinal number of the placeholder parameter1746* in this <code>RowSet</code> object's command that is to be set.1747* The first parameter is 1, the second is 2, and so on; must be1748* <code>1</code> or greater1749* @param x the parameter value1750* @throws SQLException if an error occurs or the1751* parameter index is out of bounds1752* @see #getParams1753*/1754public void setShort(int parameterIndex, short x) throws SQLException {1755checkParamIndex(parameterIndex);17561757if(params == null){1758throw new SQLException("Set initParams() before setShort");1759}17601761params.put(Integer.valueOf(parameterIndex - 1), Short.valueOf(x));1762}17631764/**1765* Sets the designated parameter to an <code>int</code> in the Java1766* programming language. The driver converts this to an SQL1767* <code>INTEGER</code> value when it sends it to the database.1768* <P>1769* The parameter value set by this method is stored internally and1770* will be supplied as the appropriate parameter in this <code>RowSet</code>1771* object's command when the method <code>execute</code> is called.1772* Methods such as <code>execute</code> and <code>populate</code> must be1773* provided in any class that extends this class and implements one or1774* more of the standard JSR-114 <code>RowSet</code> interfaces.1775* <P>1776* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method1777* as it is undefined in this class.1778*1779* @param parameterIndex the ordinal number of the placeholder parameter1780* in this <code>RowSet</code> object's command that is to be set.1781* The first parameter is 1, the second is 2, and so on; must be1782* <code>1</code> or greater1783* @param x the parameter value1784* @throws SQLException if an error occurs or the1785* parameter index is out of bounds1786* @see #getParams1787*/1788public void setInt(int parameterIndex, int x) throws SQLException {1789checkParamIndex(parameterIndex);1790if(params == null){1791throw new SQLException("Set initParams() before setInt");1792}1793params.put(Integer.valueOf(parameterIndex - 1), Integer.valueOf(x));1794}17951796/**1797* Sets the designated parameter to the given <code>long</code> in the Java1798* programming language. The driver converts this to an SQL1799* <code>BIGINT</code> value when it sends it to the database.1800* <P>1801* The parameter value set by this method is stored internally and1802* will be supplied as the appropriate parameter in this <code>RowSet</code>1803* object's command when the method <code>execute</code> is called.1804* Methods such as <code>execute</code> and <code>populate</code> must be1805* provided in any class that extends this class and implements one or1806* more of the standard JSR-114 <code>RowSet</code> interfaces.1807* <P>1808* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method1809* as it is undefined in this class.1810*1811* @param parameterIndex the ordinal number of the placeholder parameter1812* in this <code>RowSet</code> object's command that is to be set.1813* The first parameter is 1, the second is 2, and so on; must be1814* <code>1</code> or greater1815* @param x the parameter value1816* @throws SQLException if an error occurs or the1817* parameter index is out of bounds1818* @see #getParams1819*/1820public void setLong(int parameterIndex, long x) throws SQLException {1821checkParamIndex(parameterIndex);1822if(params == null){1823throw new SQLException("Set initParams() before setLong");1824}1825params.put(Integer.valueOf(parameterIndex - 1), Long.valueOf(x));1826}18271828/**1829* Sets the designated parameter to the given <code>float</code> in the1830* Java programming language. The driver converts this to an SQL1831* <code>FLOAT</code> value when it sends it to the database.1832* <P>1833* The parameter value set by this method is stored internally and1834* will be supplied as the appropriate parameter in this <code>RowSet</code>1835* object's command when the method <code>execute</code> is called.1836* Methods such as <code>execute</code> and <code>populate</code> must be1837* provided in any class that extends this class and implements one or1838* more of the standard JSR-114 <code>RowSet</code> interfaces.1839* <P>1840* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method1841* as it is undefined in this class.1842*1843* @param parameterIndex the ordinal number of the placeholder parameter1844* in this <code>RowSet</code> object's command that is to be set.1845* The first parameter is 1, the second is 2, and so on; must be1846* <code>1</code> or greater1847* @param x the parameter value1848* @throws SQLException if an error occurs or the1849* parameter index is out of bounds1850* @see #getParams1851*/1852public void setFloat(int parameterIndex, float x) throws SQLException {1853checkParamIndex(parameterIndex);1854if(params == null){1855throw new SQLException("Set initParams() before setFloat");1856}1857params.put(Integer.valueOf(parameterIndex - 1), Float.valueOf(x));1858}18591860/**1861* Sets the designated parameter to the given <code>double</code> in the1862* Java programming language. The driver converts this to an SQL1863* <code>DOUBLE</code> value when it sends it to the database.1864* <P>1865* The parameter value set by this method is stored internally and1866* will be supplied as the appropriate parameter in this <code>RowSet</code>1867* object's command when the method <code>execute</code> is called.1868* Methods such as <code>execute</code> and <code>populate</code> must be1869* provided in any class that extends this class and implements one or1870* more of the standard JSR-114 <code>RowSet</code> interfaces.1871* <P>1872* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method1873* as it is undefined in this class.1874*1875* @param parameterIndex the ordinal number of the placeholder parameter1876* in this <code>RowSet</code> object's command that is to be set.1877* The first parameter is 1, the second is 2, and so on; must be1878* <code>1</code> or greater1879* @param x the parameter value1880* @throws SQLException if an error occurs or the1881* parameter index is out of bounds1882* @see #getParams1883*/1884public void setDouble(int parameterIndex, double x) throws SQLException {1885checkParamIndex(parameterIndex);1886if(params == null){1887throw new SQLException("Set initParams() before setDouble");1888}1889params.put(Integer.valueOf(parameterIndex - 1), Double.valueOf(x));1890}18911892/**1893* Sets the designated parameter to the given1894* <code>java.lang.BigDecimal</code> value. The driver converts this to1895* an SQL <code>NUMERIC</code> value when it sends it to the database.1896* <P>1897* The parameter value set by this method is stored internally and1898* will be supplied as the appropriate parameter in this <code>RowSet</code>1899* object's command when the method <code>execute</code> is called.1900* Methods such as <code>execute</code> and <code>populate</code> must be1901* provided in any class that extends this class and implements one or1902* more of the standard JSR-114 <code>RowSet</code> interfaces.1903* <P>1904* Note: <code>JdbcRowSet</code> does not require the <code>populate</code> method1905* as it is undefined in this class.1906*1907* @param parameterIndex the ordinal number of the placeholder parameter1908* in this <code>RowSet</code> object's command that is to be set.1909* The first parameter is 1, the second is 2, and so on; must be1910* <code>1</code> or greater1911* @param x the parameter value1912* @throws SQLException if an error occurs or the1913* parameter index is out of bounds1914* @see #getParams1915*/1916public void setBigDecimal(int parameterIndex, java.math.BigDecimal x) throws SQLException {1917checkParamIndex(parameterIndex);1918if(params == null){1919throw new SQLException("Set initParams() before setBigDecimal");1920}1921params.put(Integer.valueOf(parameterIndex - 1), x);1922}19231924/**1925* Sets the designated parameter to the given <code>String</code>1926* value. The driver converts this to an SQL1927* <code>VARCHAR</code> or <code>LONGVARCHAR</code> value1928* (depending on the argument's size relative to the driver's limits1929* on <code>VARCHAR</code> values) when it sends it to the database.1930* <P>1931* The parameter value set by this method is stored internally and1932* will be supplied as the appropriate parameter in this <code>RowSet</code>1933* object's command when the method <code>execute</code> is called.1934* Methods such as <code>execute</code> and <code>populate</code> must be1935* provided in any class that extends this class and implements one or1936* more of the standard JSR-114 <code>RowSet</code> interfaces.1937* <p>1938* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method1939* as it is undefined in this class.1940*1941* @param parameterIndex the ordinal number of the placeholder parameter1942* in this <code>RowSet</code> object's command that is to be set.1943* The first parameter is 1, the second is 2, and so on; must be1944* <code>1</code> or greater1945* @param x the parameter value1946* @throws SQLException if an error occurs or the1947* parameter index is out of bounds1948* @see #getParams1949*/1950public void setString(int parameterIndex, String x) throws SQLException {1951checkParamIndex(parameterIndex);1952if(params == null){1953throw new SQLException("Set initParams() before setString");1954}1955params.put(Integer.valueOf(parameterIndex - 1), x);1956}19571958/**1959* Sets the designated parameter to the given array of bytes.1960* The driver converts this to an SQL1961* <code>VARBINARY</code> or <code>LONGVARBINARY</code> value1962* (depending on the argument's size relative to the driver's limits1963* on <code>VARBINARY</code> values) when it sends it to the database.1964* <P>1965* The parameter value set by this method is stored internally and1966* will be supplied as the appropriate parameter in this <code>RowSet</code>1967* object's command when the method <code>execute</code> is called.1968* Methods such as <code>execute</code> and <code>populate</code> must be1969* provided in any class that extends this class and implements one or1970* more of the standard JSR-114 <code>RowSet</code> interfaces.1971* <p>1972* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method1973* as it is undefined in this class.1974*1975* @param parameterIndex the ordinal number of the placeholder parameter1976* in this <code>RowSet</code> object's command that is to be set.1977* The first parameter is 1, the second is 2, and so on; must be1978* <code>1</code> or greater1979* @param x the parameter value1980* @throws SQLException if an error occurs or the1981* parameter index is out of bounds1982* @see #getParams1983*/1984public void setBytes(int parameterIndex, byte x[]) throws SQLException {1985checkParamIndex(parameterIndex);1986if(params == null){1987throw new SQLException("Set initParams() before setBytes");1988}1989params.put(Integer.valueOf(parameterIndex - 1), x);1990}19911992/**1993* Sets the designated parameter to the given <code>java.sql.Date</code>1994* value. The driver converts this to an SQL1995* <code>DATE</code> value when it sends it to the database.1996* <P>1997* The parameter value set by this method is stored internally and1998* will be supplied as the appropriate parameter in this <code>RowSet</code>1999* object's command when the method <code>execute</code> is called.2000* Methods such as <code>execute</code> and <code>populate</code> must be2001* provided in any class that extends this class and implements one or2002* more of the standard JSR-114 <code>RowSet</code> interfaces.2003* <P>2004* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2005* as it is undefined in this class.2006* <P>2007* Calls made to the method <code>getParams</code> after this version2008* of <code>setDate</code>2009* has been called will return an array with the value to be set for2010* placeholder parameter number <i>parameterIndex</i> being the <code>Date</code>2011* object supplied as the second parameter.2012* Note that because the numbering of elements in an array starts at zero,2013* the array element that corresponds to placeholder parameter number2014* <i>parameterIndex</i> is <i>parameterIndex</i> -1.2015*2016* @param parameterIndex the ordinal number of the placeholder parameter2017* in this <code>RowSet</code> object's command that is to be set.2018* The first parameter is 1, the second is 2, and so on; must be2019* <code>1</code> or greater2020* @param x the parameter value2021* @throws SQLException if an error occurs or the2022* parameter index is out of bounds2023* @see #getParams2024*/2025public void setDate(int parameterIndex, java.sql.Date x) throws SQLException {2026checkParamIndex(parameterIndex);20272028if(params == null){2029throw new SQLException("Set initParams() before setDate");2030}2031params.put(Integer.valueOf(parameterIndex - 1), x);2032}20332034/**2035* Sets the designated parameter to the given <code>java.sql.Time</code>2036* value. The driver converts this to an SQL <code>TIME</code> value2037* when it sends it to the database.2038* <P>2039* The parameter value set by this method is stored internally and2040* will be supplied as the appropriate parameter in this <code>RowSet</code>2041* object's command when the method <code>execute</code> is called.2042* Methods such as <code>execute</code> and <code>populate</code> must be2043* provided in any class that extends this class and implements one or2044* more of the standard JSR-114 <code>RowSet</code> interfaces.2045* <P>2046* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2047* as it is undefined in this class.2048* <P>2049* Calls made to the method <code>getParams</code> after this version2050* of the method <code>setTime</code>2051* has been called will return an array of the parameters that have been set.2052* The parameter to be set for parameter placeholder number <i>parameterIndex</i>2053* will be the <code>Time</code> object that was set as the second parameter2054* to this method.2055* <P>2056* Note that because the numbering of elements in an array starts at zero,2057* the array element that corresponds to placeholder parameter number2058* <i>parameterIndex</i> is <i>parameterIndex</i> -1.2059*2060* @param parameterIndex the ordinal number of the placeholder parameter2061* in this <code>RowSet</code> object's command that is to be set.2062* The first parameter is 1, the second is 2, and so on; must be2063* <code>1</code> or greater2064* @param x a <code>java.sql.Time</code> object, which is to be set as the value2065* for placeholder parameter <i>parameterIndex</i>2066* @throws SQLException if an error occurs or the2067* parameter index is out of bounds2068* @see #getParams2069*/2070public void setTime(int parameterIndex, java.sql.Time x) throws SQLException {2071checkParamIndex(parameterIndex);2072if(params == null){2073throw new SQLException("Set initParams() before setTime");2074}20752076params.put(Integer.valueOf(parameterIndex - 1), x);2077}20782079/**2080* Sets the designated parameter to the given2081* <code>java.sql.Timestamp</code> value.2082* The driver converts this to an SQL <code>TIMESTAMP</code> value when it2083* sends it to the database.2084* <P>2085* The parameter value set by this method is stored internally and2086* will be supplied as the appropriate parameter in this <code>RowSet</code>2087* object's command when the method <code>execute</code> is called.2088* Methods such as <code>execute</code> and <code>populate</code> must be2089* provided in any class that extends this class and implements one or2090* more of the standard JSR-114 <code>RowSet</code> interfaces.2091* <P>2092* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2093* as it is undefined in this class.2094* <P>2095* Calls made to the method <code>getParams</code> after this version of2096* <code>setTimestamp</code>2097* has been called will return an array with the value for parameter placeholder2098* number <i>parameterIndex</i> being the <code>Timestamp</code> object that was2099* supplied as the second parameter to this method.2100* Note that because the numbering of elements in an array starts at zero,2101* the array element that corresponds to placeholder parameter number2102* <i>parameterIndex</i> is <i>parameterIndex</i> -1.2103*2104* @param parameterIndex the ordinal number of the placeholder parameter2105* in this <code>RowSet</code> object's command that is to be set.2106* The first parameter is 1, the second is 2, and so on; must be2107* <code>1</code> or greater2108* @param x a <code>java.sql.Timestamp</code> object2109* @throws SQLException if an error occurs or the2110* parameter index is out of bounds2111* @see #getParams2112*/2113public void setTimestamp(int parameterIndex, java.sql.Timestamp x) throws SQLException {2114checkParamIndex(parameterIndex);2115if(params == null){2116throw new SQLException("Set initParams() before setTimestamp");2117}21182119params.put(Integer.valueOf(parameterIndex - 1), x);2120}21212122/**2123* Sets the designated parameter to the given2124* <code>java.io.InputStream</code> object,2125* which will have the specified number of bytes.2126* The contents of the stream will be read and sent to the database.2127* This method throws an <code>SQLException</code> object if the number of bytes2128* read and sent to the database is not equal to <i>length</i>.2129* <P>2130* When a very large ASCII value is input to a <code>LONGVARCHAR</code>2131* parameter, it may be more practical to send it via a2132* <code>java.io.InputStream</code> object. A JDBC technology-enabled2133* driver will read the data from the stream as needed until it reaches2134* end-of-file. The driver will do any necessary conversion from ASCII to2135* the database <code>CHAR</code> format.2136*2137* <P><B>Note:</B> This stream object can be either a standard2138* Java stream object or your own subclass that implements the2139* standard interface.2140* <P>2141* The parameter value set by this method is stored internally and2142* will be supplied as the appropriate parameter in this <code>RowSet</code>2143* object's command when the method <code>execute</code> is called.2144* Methods such as <code>execute</code> and <code>populate</code> must be2145* provided in any class that extends this class and implements one or2146* more of the standard JSR-114 <code>RowSet</code> interfaces.2147* <P>2148* Note: <code>JdbcRowSet</code> does not require the <code>populate</code> method2149* as it is undefined in this class.2150* <P>2151* Calls made to the method <code>getParams</code> after <code>setAsciiStream</code>2152* has been called will return an array containing the parameter values that2153* have been set. The element in the array that represents the values2154* set with this method will itself be an array. The first element of that array2155* is the given <code>java.io.InputStream</code> object.2156* The second element is the value set for <i>length</i>.2157* The third element is an internal <code>BaseRowSet</code> constant2158* specifying that the stream passed to this method is an ASCII stream.2159* The parameter number is indicated by an element's position in the array2160* returned by the method <code>getParams</code>,2161* with the first element being the value for the first placeholder parameter, the2162* second element being the value for the second placeholder parameter, and so on.2163* In other words, if the input stream being set is the value for the second2164* placeholder parameter, the array containing it will be the second element in2165* the array returned by <code>getParams</code>.2166* <P>2167* Note that because the numbering of elements in an array starts at zero,2168* the array element that corresponds to placeholder parameter number2169* <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.2170*2171* @param parameterIndex the ordinal number of the placeholder parameter2172* in this <code>RowSet</code> object's command that is to be set.2173* The first parameter is 1, the second is 2, and so on; must be2174* <code>1</code> or greater2175* @param x the Java input stream that contains the ASCII parameter value2176* @param length the number of bytes in the stream. This is the number of bytes2177* the driver will send to the DBMS; lengths of 0 or less are2178* are undefined but will cause an invalid length exception to be2179* thrown in the underlying JDBC driver.2180* @throws SQLException if an error occurs, the parameter index is out of bounds,2181* or when connected to a data source, the number of bytes the driver reads2182* and sends to the database is not equal to the number of bytes specified2183* in <i>length</i>2184* @see #getParams2185*/2186public void setAsciiStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException {2187Object asciiStream[];2188checkParamIndex(parameterIndex);21892190asciiStream = new Object[3];2191asciiStream[0] = x;2192asciiStream[1] = Integer.valueOf(length);2193asciiStream[2] = Integer.valueOf(ASCII_STREAM_PARAM);21942195if(params == null){2196throw new SQLException("Set initParams() before setAsciiStream");2197}21982199params.put(Integer.valueOf(parameterIndex - 1), asciiStream);2200}22012202/**2203* Sets the designated parameter in this <code>RowSet</code> object's command2204* to the given input stream.2205* When a very large ASCII value is input to a <code>LONGVARCHAR</code>2206* parameter, it may be more practical to send it via a2207* <code>java.io.InputStream</code>. Data will be read from the stream2208* as needed until end-of-file is reached. The JDBC driver will2209* do any necessary conversion from ASCII to the database char format.2210*2211* <P><B>Note:</B> This stream object can either be a standard2212* Java stream object or your own subclass that implements the2213* standard interface.2214* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2215* it might be more efficient to use a version of2216* <code>setAsciiStream</code> which takes a length parameter.2217*2218* @param parameterIndex the first parameter is 1, the second is 2, ...2219* @param x the Java input stream that contains the ASCII parameter value2220* @exception SQLException if a database access error occurs or2221* this method is called on a closed <code>PreparedStatement</code>2222* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2223* @since 1.62224*/2225public void setAsciiStream(int parameterIndex, java.io.InputStream x)2226throws SQLException {2227throw new SQLFeatureNotSupportedException("Feature not supported");2228}22292230/**2231* Sets the designated parameter to the given <code>java.io.InputStream</code>2232* object, which will have the specified number of bytes.2233* The contents of the stream will be read and sent to the database.2234* This method throws an <code>SQLException</code> object if the number of bytes2235* read and sent to the database is not equal to <i>length</i>.2236* <P>2237* When a very large binary value is input to a2238* <code>LONGVARBINARY</code> parameter, it may be more practical2239* to send it via a <code>java.io.InputStream</code> object.2240* A JDBC technology-enabled driver will read the data from the2241* stream as needed until it reaches end-of-file.2242*2243* <P><B>Note:</B> This stream object can be either a standard2244* Java stream object or your own subclass that implements the2245* standard interface.2246* <P>2247* The parameter value set by this method is stored internally and2248* will be supplied as the appropriate parameter in this <code>RowSet</code>2249* object's command when the method <code>execute</code> is called.2250* Methods such as <code>execute</code> and <code>populate</code> must be2251* provided in any class that extends this class and implements one or2252* more of the standard JSR-114 <code>RowSet</code> interfaces.2253*<P>2254* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2255* as it is undefined in this class.2256* <P>2257* Calls made to the method <code>getParams</code> after <code>setBinaryStream</code>2258* has been called will return an array containing the parameter values that2259* have been set. In that array, the element that represents the values2260* set with this method will itself be an array. The first element of that array2261* is the given <code>java.io.InputStream</code> object.2262* The second element is the value set for <i>length</i>.2263* The third element is an internal <code>BaseRowSet</code> constant2264* specifying that the stream passed to this method is a binary stream.2265* The parameter number is indicated by an element's position in the array2266* returned by the method <code>getParams</code>,2267* with the first element being the value for the first placeholder parameter, the2268* second element being the value for the second placeholder parameter, and so on.2269* In other words, if the input stream being set is the value for the second2270* placeholder parameter, the array containing it will be the second element in2271* the array returned by <code>getParams</code>.2272* <P>2273* Note that because the numbering of elements in an array starts at zero,2274* the array element that corresponds to placeholder parameter number2275* <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.2276*2277* @param parameterIndex the ordinal number of the placeholder parameter2278* in this <code>RowSet</code> object's command that is to be set.2279* The first parameter is 1, the second is 2, and so on; must be2280* <code>1</code> or greater2281* @param x the input stream that contains the binary value to be set2282* @param length the number of bytes in the stream; lengths of 0 or less are2283* are undefined but will cause an invalid length exception to be2284* thrown in the underlying JDBC driver.2285* @throws SQLException if an error occurs, the parameter index is out of bounds,2286* or when connected to a data source, the number of bytes the driver2287* reads and sends to the database is not equal to the number of bytes2288* specified in <i>length</i>2289* @see #getParams2290*/2291public void setBinaryStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException {2292Object binaryStream[];2293checkParamIndex(parameterIndex);22942295binaryStream = new Object[3];2296binaryStream[0] = x;2297binaryStream[1] = Integer.valueOf(length);2298binaryStream[2] = Integer.valueOf(BINARY_STREAM_PARAM);2299if(params == null){2300throw new SQLException("Set initParams() before setBinaryStream");2301}23022303params.put(Integer.valueOf(parameterIndex - 1), binaryStream);2304}230523062307/**2308* Sets the designated parameter in this <code>RowSet</code> object's command2309* to the given input stream.2310* When a very large binary value is input to a <code>LONGVARBINARY</code>2311* parameter, it may be more practical to send it via a2312* <code>java.io.InputStream</code> object. The data will be read from the2313* stream as needed until end-of-file is reached.2314*2315* <P><B>Note:</B> This stream object can either be a standard2316* Java stream object or your own subclass that implements the2317* standard interface.2318* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2319* it might be more efficient to use a version of2320* <code>setBinaryStream</code> which takes a length parameter.2321*2322* @param parameterIndex the first parameter is 1, the second is 2, ...2323* @param x the java input stream which contains the binary parameter value2324* @exception SQLException if a database access error occurs or2325* this method is called on a closed <code>PreparedStatement</code>2326* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2327* @since 1.62328*/2329public void setBinaryStream(int parameterIndex, java.io.InputStream x)2330throws SQLException {2331throw new SQLFeatureNotSupportedException("Feature not supported");2332}233323342335/**2336* Sets the designated parameter to the given2337* <code>java.io.InputStream</code> object, which will have the specified2338* number of bytes. The contents of the stream will be read and sent2339* to the database.2340* This method throws an <code>SQLException</code> if the number of bytes2341* read and sent to the database is not equal to <i>length</i>.2342* <P>2343* When a very large Unicode value is input to a2344* <code>LONGVARCHAR</code> parameter, it may be more practical2345* to send it via a <code>java.io.InputStream</code> object.2346* A JDBC technology-enabled driver will read the data from the2347* stream as needed, until it reaches end-of-file.2348* The driver will do any necessary conversion from Unicode to the2349* database <code>CHAR</code> format.2350* The byte format of the Unicode stream must be Java UTF-8, as2351* defined in the Java Virtual Machine Specification.2352*2353* <P><B>Note:</B> This stream object can be either a standard2354* Java stream object or your own subclass that implements the2355* standard interface.2356* <P>2357* This method is deprecated; the method <code>getCharacterStream</code>2358* should be used in its place.2359* <P>2360* The parameter value set by this method is stored internally and2361* will be supplied as the appropriate parameter in this <code>RowSet</code>2362* object's command when the method <code>execute</code> is called.2363* Calls made to the method <code>getParams</code> after <code>setUnicodeStream</code>2364* has been called will return an array containing the parameter values that2365* have been set. In that array, the element that represents the values2366* set with this method will itself be an array. The first element of that array2367* is the given <code>java.io.InputStream</code> object.2368* The second element is the value set for <i>length</i>.2369* The third element is an internal <code>BaseRowSet</code> constant2370* specifying that the stream passed to this method is a Unicode stream.2371* The parameter number is indicated by an element's position in the array2372* returned by the method <code>getParams</code>,2373* with the first element being the value for the first placeholder parameter, the2374* second element being the value for the second placeholder parameter, and so on.2375* In other words, if the input stream being set is the value for the second2376* placeholder parameter, the array containing it will be the second element in2377* the array returned by <code>getParams</code>.2378* <P>2379* Note that because the numbering of elements in an array starts at zero,2380* the array element that corresponds to placeholder parameter number2381* <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.2382*2383* @param parameterIndex the ordinal number of the placeholder parameter2384* in this <code>RowSet</code> object's command that is to be set.2385* The first parameter is 1, the second is 2, and so on; must be2386* <code>1</code> or greater2387* @param x the <code>java.io.InputStream</code> object that contains the2388* UNICODE parameter value2389* @param length the number of bytes in the input stream2390* @throws SQLException if an error occurs, the parameter index is out of bounds,2391* or the number of bytes the driver reads and sends to the database is2392* not equal to the number of bytes specified in <i>length</i>2393* @deprecated getCharacterStream should be used in its place2394* @see #getParams2395*/2396@Deprecated2397public void setUnicodeStream(int parameterIndex, java.io.InputStream x, int length) throws SQLException {2398Object unicodeStream[];2399checkParamIndex(parameterIndex);24002401unicodeStream = new Object[3];2402unicodeStream[0] = x;2403unicodeStream[1] = Integer.valueOf(length);2404unicodeStream[2] = Integer.valueOf(UNICODE_STREAM_PARAM);2405if(params == null){2406throw new SQLException("Set initParams() before setUnicodeStream");2407}2408params.put(Integer.valueOf(parameterIndex - 1), unicodeStream);2409}24102411/**2412* Sets the designated parameter to the given <code>java.io.Reader</code>2413* object, which will have the specified number of characters. The2414* contents of the reader will be read and sent to the database.2415* This method throws an <code>SQLException</code> if the number of bytes2416* read and sent to the database is not equal to <i>length</i>.2417* <P>2418* When a very large Unicode value is input to a2419* <code>LONGVARCHAR</code> parameter, it may be more practical2420* to send it via a <code>Reader</code> object.2421* A JDBC technology-enabled driver will read the data from the2422* stream as needed until it reaches end-of-file.2423* The driver will do any necessary conversion from Unicode to the2424* database <code>CHAR</code> format.2425* The byte format of the Unicode stream must be Java UTF-8, as2426* defined in the Java Virtual Machine Specification.2427*2428* <P><B>Note:</B> This stream object can be either a standard2429* Java stream object or your own subclass that implements the2430* standard interface.2431* <P>2432* The parameter value set by this method is stored internally and2433* will be supplied as the appropriate parameter in this <code>RowSet</code>2434* object's command when the method <code>execute</code> is called.2435* Methods such as <code>execute</code> and <code>populate</code> must be2436* provided in any class that extends this class and implements one or2437* more of the standard JSR-114 <code>RowSet</code> interfaces.2438* <P>2439* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2440* as it is undefined in this class.2441* <P>2442* Calls made to the method <code>getParams</code> after2443* <code>setCharacterStream</code>2444* has been called will return an array containing the parameter values that2445* have been set. In that array, the element that represents the values2446* set with this method will itself be an array. The first element of that array2447* is the given <code>java.io.Reader</code> object.2448* The second element is the value set for <i>length</i>.2449* The parameter number is indicated by an element's position in the array2450* returned by the method <code>getParams</code>,2451* with the first element being the value for the first placeholder parameter, the2452* second element being the value for the second placeholder parameter, and so on.2453* In other words, if the reader being set is the value for the second2454* placeholder parameter, the array containing it will be the second element in2455* the array returned by <code>getParams</code>.2456* <P>2457* Note that because the numbering of elements in an array starts at zero,2458* the array element that corresponds to placeholder parameter number2459* <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.2460*2461* @param parameterIndex the ordinal number of the placeholder parameter2462* in this <code>RowSet</code> object's command that is to be set.2463* The first parameter is 1, the second is 2, and so on; must be2464* <code>1</code> or greater2465* @param reader the <code>Reader</code> object that contains the2466* Unicode data2467* @param length the number of characters in the stream; lengths of 0 or2468* less are undefined but will cause an invalid length exception to2469* be thrown in the underlying JDBC driver.2470* @throws SQLException if an error occurs, the parameter index is out of bounds,2471* or when connected to a data source, the number of bytes the driver2472* reads and sends to the database is not equal to the number of bytes2473* specified in <i>length</i>2474* @see #getParams2475*/2476public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException {2477Object charStream[];2478checkParamIndex(parameterIndex);24792480charStream = new Object[2];2481charStream[0] = reader;2482charStream[1] = Integer.valueOf(length);2483if(params == null){2484throw new SQLException("Set initParams() before setCharacterStream");2485}2486params.put(Integer.valueOf(parameterIndex - 1), charStream);2487}24882489/**2490* Sets the designated parameter in this <code>RowSet</code> object's command2491* to the given <code>Reader</code>2492* object.2493* When a very large UNICODE value is input to a <code>LONGVARCHAR</code>2494* parameter, it may be more practical to send it via a2495* <code>java.io.Reader</code> object. The data will be read from the stream2496* as needed until end-of-file is reached. The JDBC driver will2497* do any necessary conversion from UNICODE to the database char format.2498*2499* <P><B>Note:</B> This stream object can either be a standard2500* Java stream object or your own subclass that implements the2501* standard interface.2502* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2503* it might be more efficient to use a version of2504* <code>setCharacterStream</code> which takes a length parameter.2505*2506* @param parameterIndex the first parameter is 1, the second is 2, ...2507* @param reader the <code>java.io.Reader</code> object that contains the2508* Unicode data2509* @exception SQLException if a database access error occurs or2510* this method is called on a closed <code>PreparedStatement</code>2511* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2512* @since 1.62513*/2514public void setCharacterStream(int parameterIndex,2515java.io.Reader reader) throws SQLException {2516throw new SQLFeatureNotSupportedException("Feature not supported");2517}25182519/**2520* Sets the designated parameter to an <code>Object</code> in the Java2521* programming language. The second parameter must be an2522* <code>Object</code> type. For integral values, the2523* <code>java.lang</code> equivalent2524* objects should be used. For example, use the class <code>Integer</code>2525* for an <code>int</code>.2526* <P>2527* The driver converts this object to the specified2528* target SQL type before sending it to the database.2529* If the object has a custom mapping (is of a class implementing2530* <code>SQLData</code>), the driver should call the method2531* <code>SQLData.writeSQL</code> to write the object to the SQL2532* data stream. If, on the other hand, the object is of a class2533* implementing <code>Ref</code>, <code>Blob</code>, <code>Clob</code>,2534* <code>Struct</code>, or <code>Array</code>,2535* the driver should pass it to the database as a value of the2536* corresponding SQL type.2537*2538* <p>Note that this method may be used to pass database-2539* specific abstract data types.2540* <P>2541* The parameter value set by this method is stored internally and2542* will be supplied as the appropriate parameter in this <code>RowSet</code>2543* object's command when the method <code>execute</code> is called.2544* Methods such as <code>execute</code> and <code>populate</code> must be2545* provided in any class that extends this class and implements one or2546* more of the standard JSR-114 <code>RowSet</code> interfaces.2547* <P>2548* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2549* as it is undefined in this class.2550* <P>2551* Calls made to the method <code>getParams</code> after this version of2552* <code>setObject</code>2553* has been called will return an array containing the parameter values that2554* have been set. In that array, the element that represents the values2555* set with this method will itself be an array. The first element of that array2556* is the given <code>Object</code> instance, and the2557* second element is the value set for <i>targetSqlType</i>. The2558* third element is the value set for <i>scale</i>, which the driver will2559* ignore if the type of the object being set is not2560* <code>java.sql.Types.NUMERIC</code> or <code>java.sql.Types.DECIMAL</code>.2561* The parameter number is indicated by an element's position in the array2562* returned by the method <code>getParams</code>,2563* with the first element being the value for the first placeholder parameter, the2564* second element being the value for the second placeholder parameter, and so on.2565* In other words, if the object being set is the value for the second2566* placeholder parameter, the array containing it will be the second element in2567* the array returned by <code>getParams</code>.2568*<P>2569* Note that because the numbering of elements in an array starts at zero,2570* the array element that corresponds to placeholder parameter number2571* <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.2572*2573*2574* @param parameterIndex the ordinal number of the placeholder parameter2575* in this <code>RowSet</code> object's command that is to be set.2576* The first parameter is 1, the second is 2, and so on; must be2577* <code>1</code> or greater2578* @param x the <code>Object</code> containing the input parameter value;2579* must be an <code>Object</code> type2580* @param targetSqlType the SQL type (as defined in <code>java.sql.Types</code>)2581* to be sent to the database. The <code>scale</code> argument may2582* further qualify this type. If a non-standard <i>targetSqlType</i>2583* is supplied, this method will not throw a <code>SQLException</code>.2584* This allows implicit support for non-standard SQL types.2585* @param scale for the types <code>java.sql.Types.DECIMAL</code> and2586* <code>java.sql.Types.NUMERIC</code>, this is the number2587* of digits after the decimal point. For all other types, this2588* value will be ignored.2589* @throws SQLException if an error occurs or the parameter index is out of bounds2590* @see #getParams2591*/2592public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException {2593Object obj[];2594checkParamIndex(parameterIndex);25952596obj = new Object[3];2597obj[0] = x;2598obj[1] = Integer.valueOf(targetSqlType);2599obj[2] = Integer.valueOf(scale);2600if(params == null){2601throw new SQLException("Set initParams() before setObject");2602}2603params.put(Integer.valueOf(parameterIndex - 1), obj);2604}26052606/**2607* Sets the value of the designated parameter with the given2608* <code>Object</code> value.2609* This method is like <code>setObject(int parameterIndex, Object x, int2610* targetSqlType, int scale)</code> except that it assumes a scale of zero.2611* <P>2612* The parameter value set by this method is stored internally and2613* will be supplied as the appropriate parameter in this <code>RowSet</code>2614* object's command when the method <code>execute</code> is called.2615* Methods such as <code>execute</code> and <code>populate</code> must be2616* provided in any class that extends this class and implements one or2617* more of the standard JSR-114 <code>RowSet</code> interfaces.2618* <P>2619* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2620* as it is undefined in this class.2621* <P>2622* Calls made to the method <code>getParams</code> after this version of2623* <code>setObject</code>2624* has been called will return an array containing the parameter values that2625* have been set. In that array, the element that represents the values2626* set with this method will itself be an array. The first element of that array2627* is the given <code>Object</code> instance.2628* The second element is the value set for <i>targetSqlType</i>.2629* The parameter number is indicated by an element's position in the array2630* returned by the method <code>getParams</code>,2631* with the first element being the value for the first placeholder parameter, the2632* second element being the value for the second placeholder parameter, and so on.2633* In other words, if the object being set is the value for the second2634* placeholder parameter, the array containing it will be the second element in2635* the array returned by <code>getParams</code>.2636* <P>2637* Note that because the numbering of elements in an array starts at zero,2638* the array element that corresponds to placeholder parameter number2639* <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.2640*2641* @param parameterIndex the ordinal number of the placeholder parameter2642* in this <code>RowSet</code> object's command that is to be set.2643* The first parameter is 1, the second is 2, and so on; must be2644* <code>1</code> or greater2645* @param x the <code>Object</code> containing the input parameter value;2646* must be an <code>Object</code> type2647* @param targetSqlType the SQL type (as defined in <code>java.sql.Types</code>)2648* to be sent to the database. If a non-standard <i>targetSqlType</i>2649* is supplied, this method will not throw a <code>SQLException</code>.2650* This allows implicit support for non-standard SQL types.2651* @throws SQLException if an error occurs or the parameter index2652* is out of bounds2653* @see #getParams2654*/2655public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException {2656Object obj[];2657checkParamIndex(parameterIndex);26582659obj = new Object[2];2660obj[0] = x;2661obj[1] = Integer.valueOf(targetSqlType);2662if (params == null){2663throw new SQLException("Set initParams() before setObject");2664}2665params.put(Integer.valueOf(parameterIndex - 1), obj);2666}26672668/**2669* Sets the designated parameter to an <code>Object</code> in the Java2670* programming language. The second parameter must be an2671* <code>Object</code>2672* type. For integral values, the <code>java.lang</code> equivalent2673* objects should be used. For example, use the class <code>Integer</code>2674* for an <code>int</code>.2675* <P>2676* The JDBC specification defines a standard mapping from2677* Java <code>Object</code> types to SQL types. The driver will2678* use this standard mapping to convert the given object2679* to its corresponding SQL type before sending it to the database.2680* If the object has a custom mapping (is of a class implementing2681* <code>SQLData</code>), the driver should call the method2682* <code>SQLData.writeSQL</code> to write the object to the SQL2683* data stream.2684* <P>2685* If, on the other hand, the object is of a class2686* implementing <code>Ref</code>, <code>Blob</code>, <code>Clob</code>,2687* <code>Struct</code>, or <code>Array</code>,2688* the driver should pass it to the database as a value of the2689* corresponding SQL type.2690* <P>2691* This method throws an exception if there2692* is an ambiguity, for example, if the object is of a class2693* implementing more than one interface.2694* <P>2695* Note that this method may be used to pass database-specific2696* abstract data types.2697* <P>2698* The parameter value set by this method is stored internally and2699* will be supplied as the appropriate parameter in this <code>RowSet</code>2700* object's command when the method <code>execute</code> is called.2701* Methods such as <code>execute</code> and <code>populate</code> must be2702* provided in any class that extends this class and implements one or2703* more of the standard JSR-114 <code>RowSet</code> interfaces.2704* <p>2705* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2706* as it is undefined in this class.2707* <P>2708* After this method has been called, a call to the2709* method <code>getParams</code>2710* will return an object array of the current command parameters, which will2711* include the <code>Object</code> set for placeholder parameter number2712* <code>parameterIndex</code>.2713* Note that because the numbering of elements in an array starts at zero,2714* the array element that corresponds to placeholder parameter number2715* <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.2716*2717* @param parameterIndex the ordinal number of the placeholder parameter2718* in this <code>RowSet</code> object's command that is to be set.2719* The first parameter is 1, the second is 2, and so on; must be2720* <code>1</code> or greater2721* @param x the object containing the input parameter value2722* @throws SQLException if an error occurs the2723* parameter index is out of bounds, or there2724* is ambiguity in the implementation of the2725* object being set2726* @see #getParams2727*/2728public void setObject(int parameterIndex, Object x) throws SQLException {2729checkParamIndex(parameterIndex);2730if (params == null) {2731throw new SQLException("Set initParams() before setObject");2732}2733params.put(Integer.valueOf(parameterIndex - 1), x);2734}27352736/**2737* Sets the designated parameter to the given <code>Ref</code> object in2738* the Java programming language. The driver converts this to an SQL2739* <code>REF</code> value when it sends it to the database. Internally, the2740* <code>Ref</code> is represented as a <code>SerialRef</code> to ensure2741* serializability.2742* <P>2743* The parameter value set by this method is stored internally and2744* will be supplied as the appropriate parameter in this <code>RowSet</code>2745* object's command when the method <code>execute</code> is called.2746* Methods such as <code>execute</code> and <code>populate</code> must be2747* provided in any class that extends this class and implements one or2748* more of the standard JSR-114 <code>RowSet</code> interfaces.2749* <p>2750* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2751* as it is undefined in this class.2752* <p>2753* After this method has been called, a call to the2754* method <code>getParams</code>2755* will return an object array of the current command parameters, which will2756* include the <code>Ref</code> object set for placeholder parameter number2757* <code>parameterIndex</code>.2758* Note that because the numbering of elements in an array starts at zero,2759* the array element that corresponds to placeholder parameter number2760* <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.2761*2762* @param parameterIndex the ordinal number of the placeholder parameter2763* in this <code>RowSet</code> object's command that is to be set.2764* The first parameter is 1, the second is 2, and so on; must be2765* <code>1</code> or greater2766* @param ref a <code>Ref</code> object representing an SQL <code>REF</code>2767* value; cannot be null2768* @throws SQLException if an error occurs; the parameter index is out of2769* bounds or the <code>Ref</code> object is <code>null</code>; or2770* the <code>Ref</code> object returns a <code>null</code> base type2771* name.2772* @see #getParams2773* @see javax.sql.rowset.serial.SerialRef2774*/2775public void setRef (int parameterIndex, Ref ref) throws SQLException {2776checkParamIndex(parameterIndex);2777if (params == null) {2778throw new SQLException("Set initParams() before setRef");2779}2780params.put(Integer.valueOf(parameterIndex - 1), new SerialRef(ref));2781}27822783/**2784* Sets the designated parameter to the given <code>Blob</code> object in2785* the Java programming language. The driver converts this to an SQL2786* <code>BLOB</code> value when it sends it to the database. Internally,2787* the <code>Blob</code> is represented as a <code>SerialBlob</code>2788* to ensure serializability.2789* <P>2790* The parameter value set by this method is stored internally and2791* will be supplied as the appropriate parameter in this <code>RowSet</code>2792* object's command when the method <code>execute</code> is called.2793* Methods such as <code>execute</code> and <code>populate</code> must be2794* provided in any class that extends this class and implements one or2795* more of the standard JSR-114 <code>RowSet</code> interfaces.2796* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2797* as it is undefined in this class.2798* <p>2799* After this method has been called, a call to the2800* method <code>getParams</code>2801* will return an object array of the current command parameters, which will2802* include the <code>Blob</code> object set for placeholder parameter number2803* <code>parameterIndex</code>.2804* Note that because the numbering of elements in an array starts at zero,2805* the array element that corresponds to placeholder parameter number2806* <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.2807*2808* @param parameterIndex the ordinal number of the placeholder parameter2809* in this <code>RowSet</code> object's command that is to be set.2810* The first parameter is 1, the second is 2, and so on; must be2811* <code>1</code> or greater2812* @param x a <code>Blob</code> object representing an SQL2813* <code>BLOB</code> value2814* @throws SQLException if an error occurs or the2815* parameter index is out of bounds2816* @see #getParams2817* @see javax.sql.rowset.serial.SerialBlob2818*/2819public void setBlob (int parameterIndex, Blob x) throws SQLException {2820checkParamIndex(parameterIndex);2821if(params == null){2822throw new SQLException("Set initParams() before setBlob");2823}2824params.put(Integer.valueOf(parameterIndex - 1), new SerialBlob(x));2825}28262827/**2828* Sets the designated parameter to the given <code>Clob</code> object in2829* the Java programming language. The driver converts this to an SQL2830* <code>CLOB</code> value when it sends it to the database. Internally, the2831* <code>Clob</code> is represented as a <code>SerialClob</code> to ensure2832* serializability.2833* <P>2834* The parameter value set by this method is stored internally and2835* will be supplied as the appropriate parameter in this <code>RowSet</code>2836* object's command when the method <code>execute</code> is called.2837* Methods such as <code>execute</code> and <code>populate</code> must be2838* provided in any class that extends this class and implements one or2839* more of the standard JSR-114 <code>RowSet</code> interfaces.2840* <p>2841* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2842* as it is undefined in this class.2843* <p>2844* After this method has been called, a call to the2845* method <code>getParams</code>2846* will return an object array of the current command parameters, which will2847* include the <code>Clob</code> object set for placeholder parameter number2848* <code>parameterIndex</code>.2849* Note that because the numbering of elements in an array starts at zero,2850* the array element that corresponds to placeholder parameter number2851* <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.2852*2853* @param parameterIndex the ordinal number of the placeholder parameter2854* in this <code>RowSet</code> object's command that is to be set.2855* The first parameter is 1, the second is 2, and so on; must be2856* <code>1</code> or greater2857* @param x a <code>Clob</code> object representing an SQL2858* <code>CLOB</code> value; cannot be null2859* @throws SQLException if an error occurs; the parameter index is out of2860* bounds or the <code>Clob</code> is null2861* @see #getParams2862* @see javax.sql.rowset.serial.SerialBlob2863*/2864public void setClob (int parameterIndex, Clob x) throws SQLException {2865checkParamIndex(parameterIndex);2866if(params == null){2867throw new SQLException("Set initParams() before setClob");2868}2869params.put(Integer.valueOf(parameterIndex - 1), new SerialClob(x));2870}28712872/**2873* Sets the designated parameter to an <code>Array</code> object in the2874* Java programming language. The driver converts this to an SQL2875* <code>ARRAY</code> value when it sends it to the database. Internally,2876* the <code>Array</code> is represented as a <code>SerialArray</code>2877* to ensure serializability.2878* <P>2879* The parameter value set by this method is stored internally and2880* will be supplied as the appropriate parameter in this <code>RowSet</code>2881* object's command when the method <code>execute</code> is called.2882* Methods such as <code>execute</code> and <code>populate</code> must be2883* provided in any class that extends this class and implements one or2884* more of the standard JSR-114 <code>RowSet</code> interfaces.2885* <P>2886* Note: <code>JdbcRowSet</code> does not require the <code>populate</code> method2887* as it is undefined in this class.2888* <p>2889* After this method has been called, a call to the2890* method <code>getParams</code>2891* will return an object array of the current command parameters, which will2892* include the <code>Array</code> object set for placeholder parameter number2893* <code>parameterIndex</code>.2894* Note that because the numbering of elements in an array starts at zero,2895* the array element that corresponds to placeholder parameter number2896* <i>parameterIndex</i> is element number <i>parameterIndex</i> -1.2897*2898* @param parameterIndex the ordinal number of the placeholder parameter2899* in this <code>RowSet</code> object's command that is to be set.2900* The first parameter is 1, the second is 2, and so on; must be2901* <code>1</code> or greater2902* @param array an <code>Array</code> object representing an SQL2903* <code>ARRAY</code> value; cannot be null. The <code>Array</code> object2904* passed to this method must return a non-null Object for all2905* <code>getArray()</code> method calls. A null value will cause a2906* <code>SQLException</code> to be thrown.2907* @throws SQLException if an error occurs; the parameter index is out of2908* bounds or the <code>ARRAY</code> is null2909* @see #getParams2910* @see javax.sql.rowset.serial.SerialArray2911*/2912public void setArray (int parameterIndex, Array array) throws SQLException {2913checkParamIndex(parameterIndex);2914if (params == null){2915throw new SQLException("Set initParams() before setArray");2916}2917params.put(Integer.valueOf(parameterIndex - 1), new SerialArray(array));2918}29192920/**2921* Sets the designated parameter to the given <code>java.sql.Date</code>2922* object.2923* When the DBMS does not store time zone information, the driver will use2924* the given <code>Calendar</code> object to construct the SQL <code>DATE</code>2925* value to send to the database. With a2926* <code>Calendar</code> object, the driver can calculate the date2927* taking into account a custom time zone. If no <code>Calendar</code>2928* object is specified, the driver uses the time zone of the Virtual Machine2929* that is running the application.2930* <P>2931* The parameter value set by this method is stored internally and2932* will be supplied as the appropriate parameter in this <code>RowSet</code>2933* object's command when the method <code>execute</code> is called.2934* Methods such as <code>execute</code> and <code>populate</code> must be2935* provided in any class that extends this class and implements one or2936* more of the standard JSR-114 <code>RowSet</code> interfaces.2937* <P>2938* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method2939* as it is undefined in this class.2940* <P>2941* Calls made to the method <code>getParams</code> after this version of2942* <code>setDate</code>2943* has been called will return an array containing the parameter values that2944* have been set. In that array, the element that represents the values2945* set with this method will itself be an array. The first element of that array2946* is the given <code>java.sql.Date</code> object.2947* The second element is the value set for <i>cal</i>.2948* The parameter number is indicated by an element's position in the array2949* returned by the method <code>getParams</code>,2950* with the first element being the value for the first placeholder parameter, the2951* second element being the value for the second placeholder parameter, and so on.2952* In other words, if the date being set is the value for the second2953* placeholder parameter, the array containing it will be the second element in2954* the array returned by <code>getParams</code>.2955* <P>2956* Note that because the numbering of elements in an array starts at zero,2957* the array element that corresponds to placeholder parameter number2958* <i>parameterIndex</i> is <i>parameterIndex</i> -1.2959*2960* @param parameterIndex the ordinal number of the placeholder parameter2961* in this <code>RowSet</code> object's command that is to be set.2962* The first parameter is 1, the second is 2, and so on; must be2963* <code>1</code> or greater2964* @param x a <code>java.sql.Date</code> object representing an SQL2965* <code>DATE</code> value2966* @param cal a <code>java.util.Calendar</code> object to use when2967* when constructing the date2968* @throws SQLException if an error occurs or the2969* parameter index is out of bounds2970* @see #getParams2971*/2972public void setDate(int parameterIndex, java.sql.Date x, Calendar cal) throws SQLException {2973Object date[];2974checkParamIndex(parameterIndex);29752976date = new Object[2];2977date[0] = x;2978date[1] = cal;2979if(params == null){2980throw new SQLException("Set initParams() before setDate");2981}2982params.put(Integer.valueOf(parameterIndex - 1), date);2983}29842985/**2986* Sets the designated parameter to the given <code>java.sql.Time</code>2987* object. The driver converts this2988* to an SQL <code>TIME</code> value when it sends it to the database.2989* <P>2990* When the DBMS does not store time zone information, the driver will use2991* the given <code>Calendar</code> object to construct the SQL <code>TIME</code>2992* value to send to the database. With a2993* <code>Calendar</code> object, the driver can calculate the date2994* taking into account a custom time zone. If no <code>Calendar</code>2995* object is specified, the driver uses the time zone of the Virtual Machine2996* that is running the application.2997* <P>2998* The parameter value set by this method is stored internally and2999* will be supplied as the appropriate parameter in this <code>RowSet</code>3000* object's command when the method <code>execute</code> is called.3001* Methods such as <code>execute</code> and <code>populate</code> must be3002* provided in any class that extends this class and implements one or3003* more of the standard JSR-114 <code>RowSet</code> interfaces.3004* <P>3005* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method3006* as it is undefined in this class.3007* <P>3008* Calls made to the method <code>getParams</code> after this version of3009* <code>setTime</code>3010* has been called will return an array containing the parameter values that3011* have been set. In that array, the element that represents the values3012* set with this method will itself be an array. The first element of that array3013* is the given <code>java.sql.Time</code> object.3014* The second element is the value set for <i>cal</i>.3015* The parameter number is indicated by an element's position in the array3016* returned by the method <code>getParams</code>,3017* with the first element being the value for the first placeholder parameter, the3018* second element being the value for the second placeholder parameter, and so on.3019* In other words, if the time being set is the value for the second3020* placeholder parameter, the array containing it will be the second element in3021* the array returned by <code>getParams</code>.3022* <P>3023* Note that because the numbering of elements in an array starts at zero,3024* the array element that corresponds to placeholder parameter number3025* <i>parameterIndex</i> is <i>parameterIndex</i> -1.3026*3027* @param parameterIndex the ordinal number of the placeholder parameter3028* in this <code>RowSet</code> object's command that is to be set.3029* The first parameter is 1, the second is 2, and so on; must be3030* <code>1</code> or greater3031* @param x a <code>java.sql.Time</code> object3032* @param cal the <code>java.util.Calendar</code> object the driver can use to3033* construct the time3034* @throws SQLException if an error occurs or the3035* parameter index is out of bounds3036* @see #getParams3037*/3038public void setTime(int parameterIndex, java.sql.Time x, Calendar cal) throws SQLException {3039Object time[];3040checkParamIndex(parameterIndex);30413042time = new Object[2];3043time[0] = x;3044time[1] = cal;3045if(params == null){3046throw new SQLException("Set initParams() before setTime");3047}3048params.put(Integer.valueOf(parameterIndex - 1), time);3049}30503051/**3052* Sets the designated parameter to the given3053* <code>java.sql.Timestamp</code> object. The driver converts this3054* to an SQL <code>TIMESTAMP</code> value when it sends it to the database.3055* <P>3056* When the DBMS does not store time zone information, the driver will use3057* the given <code>Calendar</code> object to construct the SQL <code>TIMESTAMP</code>3058* value to send to the database. With a3059* <code>Calendar</code> object, the driver can calculate the timestamp3060* taking into account a custom time zone. If no <code>Calendar</code>3061* object is specified, the driver uses the time zone of the Virtual Machine3062* that is running the application.3063* <P>3064* The parameter value set by this method is stored internally and3065* will be supplied as the appropriate parameter in this <code>RowSet</code>3066* object's command when the method <code>execute</code> is called.3067* Methods such as <code>execute</code> and <code>populate</code> must be3068* provided in any class that extends this class and implements one or3069* more of the standard JSR-114 <code>RowSet</code> interfaces.3070* <P>3071* NOTE: <code>JdbcRowSet</code> does not require the <code>populate</code> method3072* as it is undefined in this class.3073* <P>3074* Calls made to the method <code>getParams</code> after this version of3075* <code>setTimestamp</code>3076* has been called will return an array containing the parameter values that3077* have been set. In that array, the element that represents the values3078* set with this method will itself be an array. The first element of that array3079* is the given <code>java.sql.Timestamp</code> object.3080* The second element is the value set for <i>cal</i>.3081* The parameter number is indicated by an element's position in the array3082* returned by the method <code>getParams</code>,3083* with the first element being the value for the first placeholder parameter, the3084* second element being the value for the second placeholder parameter, and so on.3085* In other words, if the timestamp being set is the value for the second3086* placeholder parameter, the array containing it will be the second element in3087* the array returned by <code>getParams</code>.3088* <P>3089* Note that because the numbering of elements in an array starts at zero,3090* the array element that corresponds to placeholder parameter number3091* <i>parameterIndex</i> is <i>parameterIndex</i> -1.3092*3093* @param parameterIndex the ordinal number of the placeholder parameter3094* in this <code>RowSet</code> object's command that is to be set.3095* The first parameter is 1, the second is 2, and so on; must be3096* <code>1</code> or greater3097* @param x a <code>java.sql.Timestamp</code> object3098* @param cal the <code>java.util.Calendar</code> object the driver can use to3099* construct the timestamp3100* @throws SQLException if an error occurs or the3101* parameter index is out of bounds3102* @see #getParams3103*/3104public void setTimestamp(int parameterIndex, java.sql.Timestamp x, Calendar cal) throws SQLException {3105Object timestamp[];3106checkParamIndex(parameterIndex);31073108timestamp = new Object[2];3109timestamp[0] = x;3110timestamp[1] = cal;3111if(params == null){3112throw new SQLException("Set initParams() before setTimestamp");3113}3114params.put(Integer.valueOf(parameterIndex - 1), timestamp);3115}31163117/**3118* Clears all of the current parameter values in this <code>RowSet</code>3119* object's internal representation of the parameters to be set in3120* this <code>RowSet</code> object's command when it is executed.3121* <P>3122* In general, parameter values remain in force for repeated use in3123* this <code>RowSet</code> object's command. Setting a parameter value with the3124* setter methods automatically clears the value of the3125* designated parameter and replaces it with the new specified value.3126* <P>3127* This method is called internally by the <code>setCommand</code>3128* method to clear all of the parameters set for the previous command.3129* <P>3130* Furthermore, this method differs from the <code>initParams</code>3131* method in that it maintains the schema of the <code>RowSet</code> object.3132*3133* @throws SQLException if an error occurs clearing the parameters3134*/3135public void clearParameters() throws SQLException {3136params.clear();3137}31383139/**3140* Retrieves an array containing the parameter values (both Objects and3141* primitives) that have been set for this3142* <code>RowSet</code> object's command and throws an <code>SQLException</code> object3143* if all parameters have not been set. Before the command is sent to the3144* DBMS to be executed, these parameters will be substituted3145* for placeholder parameters in the <code>PreparedStatement</code> object3146* that is the command for a <code>RowSet</code> implementation extending3147* the <code>BaseRowSet</code> class.3148* <P>3149* Each element in the array that is returned is an <code>Object</code> instance3150* that contains the values of the parameters supplied to a setter method.3151* The order of the elements is determined by the value supplied for3152* <i>parameterIndex</i>. If the setter method takes only the parameter index3153* and the value to be set (possibly null), the array element will contain the value to be set3154* (which will be expressed as an <code>Object</code>). If there are additional3155* parameters, the array element will itself be an array containing the value to be set3156* plus any additional parameter values supplied to the setter method. If the method3157* sets a stream, the array element includes the type of stream being supplied to the3158* method. These additional parameters are for the use of the driver or the DBMS and may or3159* may not be used.3160* <P>3161* NOTE: Stored parameter values of types <code>Array</code>, <code>Blob</code>,3162* <code>Clob</code> and <code>Ref</code> are returned as <code>SerialArray</code>,3163* <code>SerialBlob</code>, <code>SerialClob</code> and <code>SerialRef</code>3164* respectively.3165*3166* @return an array of <code>Object</code> instances that includes the3167* parameter values that may be set in this <code>RowSet</code> object's3168* command; an empty array if no parameters have been set3169* @throws SQLException if an error occurs retrieving the object array of3170* parameters of this <code>RowSet</code> object or if not all parameters have3171* been set3172*/3173public Object[] getParams() throws SQLException {3174if (params == null) {31753176initParams();3177Object [] paramsArray = new Object[params.size()];3178return paramsArray;31793180} else {3181// The parameters may be set in random order3182// but all must be set, check to verify all3183// have been set till the last parameter3184// else throw exception.31853186Object[] paramsArray = new Object[params.size()];3187for (int i = 0; i < params.size(); i++) {3188paramsArray[i] = params.get(Integer.valueOf(i));3189if (paramsArray[i] == null) {3190throw new SQLException("missing parameter: " + (i + 1));3191} //end if3192} //end for3193return paramsArray;31943195} //end if31963197} //end getParams319831993200/**3201* Sets the designated parameter to SQL <code>NULL</code>.3202*3203* <P><B>Note:</B> You must specify the parameter's SQL type.3204*3205* @param parameterName the name of the parameter3206* @param sqlType the SQL type code defined in <code>java.sql.Types</code>3207* @exception SQLException if a database access error occurs or3208* this method is called on a closed <code>CallableStatement</code>3209* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3210* this method3211*/3212public void setNull(String parameterName, int sqlType) throws SQLException {3213throw new SQLFeatureNotSupportedException("Feature not supported");3214}32153216/**3217* Sets the designated parameter to SQL <code>NULL</code>.3218* This version of the method <code>setNull</code> should3219* be used for user-defined types and REF type parameters. Examples3220* of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and3221* named array types.3222*3223* <P><B>Note:</B> To be portable, applications must give the3224* SQL type code and the fully-qualified SQL type name when specifying3225* a NULL user-defined or REF parameter. In the case of a user-defined type3226* the name is the type name of the parameter itself. For a REF3227* parameter, the name is the type name of the referenced type. If3228* a JDBC driver does not need the type code or type name information,3229* it may ignore it.3230*3231* Although it is intended for user-defined and Ref parameters,3232* this method may be used to set a null parameter of any JDBC type.3233* If the parameter does not have a user-defined or REF type, the given3234* typeName is ignored.3235*3236*3237* @param parameterName the name of the parameter3238* @param sqlType a value from <code>java.sql.Types</code>3239* @param typeName the fully-qualified name of an SQL user-defined type;3240* ignored if the parameter is not a user-defined type or3241* SQL <code>REF</code> value3242* @exception SQLException if a database access error occurs or3243* this method is called on a closed <code>CallableStatement</code>3244* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3245* this method3246*/3247public void setNull (String parameterName, int sqlType, String typeName)3248throws SQLException{3249throw new SQLFeatureNotSupportedException("Feature not supported");3250}32513252/**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*/3265public void setBoolean(String parameterName, boolean x) throws SQLException{3266throw new SQLFeatureNotSupportedException("Feature not supported");3267}32683269/**3270* Sets the designated parameter to the given Java <code>byte</code> value.3271* The driver converts this3272* to an SQL <code>TINYINT</code> value when it sends it to the database.3273*3274* @param parameterName the name of the parameter3275* @param x the parameter value3276* @exception SQLException if a database access error occurs or3277* this method is called on a closed <code>CallableStatement</code>3278* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3279* this method3280* @see #getParams3281*/3282public void setByte(String parameterName, byte x) throws SQLException{3283throw new SQLFeatureNotSupportedException("Feature not supported");3284}32853286/**3287* Sets the designated parameter to the given Java <code>short</code> value.3288* The driver converts this3289* to an SQL <code>SMALLINT</code> value when it sends it to the database.3290*3291* @param parameterName the name of the parameter3292* @param x the parameter value3293* @exception SQLException if a database access error occurs or3294* this method is called on a closed <code>CallableStatement</code>3295* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3296* this method3297* @see #getParams3298*/3299public void setShort(String parameterName, short x) throws SQLException{3300throw new SQLFeatureNotSupportedException("Feature not supported");3301}33023303/**3304* Sets the designated parameter to the given Java <code>int</code> value.3305* The driver converts this3306* to an SQL <code>INTEGER</code> value when it sends it to the database.3307*3308* @param parameterName the name of the parameter3309* @param x the parameter value3310* @exception SQLException if a database access error occurs or3311* this method is called on a closed <code>CallableStatement</code>3312* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3313* this method3314* @see #getParams3315*/3316public void setInt(String parameterName, int x) throws SQLException{3317throw new SQLFeatureNotSupportedException("Feature not supported");3318}331933203321/**3322* Sets the designated parameter to the given Java <code>long</code> value.3323* The driver converts this3324* to an SQL <code>BIGINT</code> value when it sends it to the database.3325*3326* @param parameterName the name of the parameter3327* @param x the parameter value3328* @exception SQLException if a database access error occurs or3329* this method is called on a closed <code>CallableStatement</code>3330* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3331* this method3332* @see #getParams3333*/3334public void setLong(String parameterName, long x) throws SQLException{3335throw new SQLFeatureNotSupportedException("Feature not supported");3336}33373338/**3339* Sets the designated parameter to the given Java <code>float</code> value.3340* The driver converts this3341* to an SQL <code>FLOAT</code> value when it sends it to the database.3342*3343* @param parameterName the name of the parameter3344* @param x the parameter value3345* @exception SQLException if a database access error occurs or3346* this method is called on a closed <code>CallableStatement</code>3347* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3348* this method3349* @see #getParams3350*/3351public void setFloat(String parameterName, float x) throws SQLException{3352throw new SQLFeatureNotSupportedException("Feature not supported");3353}33543355/**3356* Sets the designated parameter to the given Java <code>double</code> value.3357* The driver converts this3358* to an SQL <code>DOUBLE</code> value when it sends it to the database.3359*3360* @param parameterName the name of the parameter3361* @param x the parameter value3362* @exception SQLException if a database access error occurs or3363* this method is called on a closed <code>CallableStatement</code>3364* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3365* this method3366* @see #getParams3367*/3368public void setDouble(String parameterName, double x) throws SQLException{3369throw new SQLFeatureNotSupportedException("Feature not supported");3370}33713372/**3373* Sets the designated parameter to the given3374* <code>java.math.BigDecimal</code> value.3375* The driver converts this to an SQL <code>NUMERIC</code> value when3376* it sends it to the database.3377*3378* @param parameterName the name of the parameter3379* @param x the parameter value3380* @exception SQLException if a database access error occurs or3381* this method is called on a closed <code>CallableStatement</code>3382* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3383* this method3384* @see #getParams3385*/3386public void setBigDecimal(String parameterName, BigDecimal x) throws SQLException{3387throw new SQLFeatureNotSupportedException("Feature not supported");3388}33893390/**3391* Sets the designated parameter to the given Java <code>String</code> value.3392* The driver converts this3393* to an SQL <code>VARCHAR</code> or <code>LONGVARCHAR</code> value3394* (depending on the argument's3395* size relative to the driver's limits on <code>VARCHAR</code> values)3396* when it sends it to the database.3397*3398* @param parameterName the name of the parameter3399* @param x the parameter value3400* @exception SQLException if a database access error occurs or3401* this method is called on a closed <code>CallableStatement</code>3402* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3403* this method3404* @see #getParams3405*/3406public void setString(String parameterName, String x) throws SQLException{3407throw new SQLFeatureNotSupportedException("Feature not supported");3408}34093410/**3411* Sets the designated parameter to the given Java array of bytes.3412* The driver converts this to an SQL <code>VARBINARY</code> or3413* <code>LONGVARBINARY</code> (depending on the argument's size relative3414* to the driver's limits on <code>VARBINARY</code> values) when it sends3415* 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*/3425public void setBytes(String parameterName, byte x[]) throws SQLException{3426throw new SQLFeatureNotSupportedException("Feature not supported");3427}34283429/**3430* Sets the designated parameter to the given <code>java.sql.Timestamp</code> value.3431* The driver3432* converts this to an SQL <code>TIMESTAMP</code> value when it sends it to the3433* database.3434*3435* @param parameterName the name of the parameter3436* @param x the parameter value3437* @exception SQLException if a database access error occurs or3438* this method is called on a closed <code>CallableStatement</code>3439* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3440* this method3441* @see #getParams3442*/3443public void setTimestamp(String parameterName, java.sql.Timestamp x)3444throws SQLException{3445throw new SQLFeatureNotSupportedException("Feature not supported");3446}34473448/**3449* Sets the designated parameter to the given input stream, which will have3450* the specified number of bytes.3451* When a very large ASCII value is input to a <code>LONGVARCHAR</code>3452* parameter, it may be more practical to send it via a3453* <code>java.io.InputStream</code>. Data will be read from the stream3454* as needed until end-of-file is reached. The JDBC driver will3455* do any necessary conversion from ASCII to the database char format.3456*3457* <P><B>Note:</B> This stream object can either be a standard3458* Java stream object or your own subclass that implements the3459* standard interface.3460*3461* @param parameterName the name of the parameter3462* @param x the Java input stream that contains the ASCII parameter value3463* @param length the number of bytes in the stream3464* @exception SQLException if a database access error occurs or3465* this method is called on a closed <code>CallableStatement</code>3466* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3467* this method3468*/3469public void setAsciiStream(String parameterName, java.io.InputStream x, int length)3470throws SQLException{3471throw new SQLFeatureNotSupportedException("Feature not supported");3472}34733474/**3475* Sets the designated parameter to the given input stream, which will have3476* the specified number of bytes.3477* When a very large binary value is input to a <code>LONGVARBINARY</code>3478* parameter, it may be more practical to send it via a3479* <code>java.io.InputStream</code> object. The data will be read from the stream3480* as needed until end-of-file is reached.3481*3482* <P><B>Note:</B> This stream object can either be a standard3483* Java stream object or your own subclass that implements the3484* standard interface.3485*3486* @param parameterName the name of the parameter3487* @param x the java input stream which contains the binary parameter value3488* @param length the number of bytes in the stream3489* @exception SQLException if a database access error occurs or3490* this method is called on a closed <code>CallableStatement</code>3491* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3492* this method3493*/3494public void setBinaryStream(String parameterName, java.io.InputStream x,3495int length) throws SQLException{3496throw new SQLFeatureNotSupportedException("Feature not supported");3497}34983499/**3500* Sets the designated parameter to the given <code>Reader</code>3501* object, which is the given number of characters long.3502* When a very large UNICODE value is input to a <code>LONGVARCHAR</code>3503* parameter, it may be more practical to send it via a3504* <code>java.io.Reader</code> object. The data will be read from the stream3505* as needed until end-of-file is reached. The JDBC driver will3506* do any necessary conversion from UNICODE to the database char format.3507*3508* <P><B>Note:</B> This stream object can either be a standard3509* Java stream object or your own subclass that implements the3510* standard interface.3511*3512* @param parameterName the name of the parameter3513* @param reader the <code>java.io.Reader</code> object that3514* contains the UNICODE data used as the designated parameter3515* @param length the number of characters in the stream3516* @exception SQLException if a database access error occurs or3517* this method is called on a closed <code>CallableStatement</code>3518* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3519* this method3520*/3521public void setCharacterStream(String parameterName,3522java.io.Reader reader,3523int length) throws SQLException{3524throw new SQLFeatureNotSupportedException("Feature not supported");3525}35263527/**3528* Sets the designated parameter to the given input stream.3529* When a very large ASCII value is input to a <code>LONGVARCHAR</code>3530* parameter, it may be more practical to send it via a3531* <code>java.io.InputStream</code>. Data will be read from the stream3532* as needed until end-of-file is reached. The JDBC driver will3533* do any necessary conversion from ASCII to the database char format.3534*3535* <P><B>Note:</B> This stream object can either be a standard3536* Java stream object or your own subclass that implements the3537* standard interface.3538* <P><B>Note:</B> Consult your JDBC driver documentation to determine if3539* it might be more efficient to use a version of3540* <code>setAsciiStream</code> which takes a length parameter.3541*3542* @param parameterName the name of the parameter3543* @param x the Java input stream that contains the ASCII parameter value3544* @exception SQLException if a database access error occurs or3545* this method is called on a closed <code>CallableStatement</code>3546* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method3547* @since 1.63548*/3549public void setAsciiStream(String parameterName, java.io.InputStream x)3550throws SQLException{3551throw new SQLFeatureNotSupportedException("Feature not supported");3552}35533554/**3555* Sets the designated parameter to the given input stream.3556* When a very large binary value is input to a <code>LONGVARBINARY</code>3557* parameter, it may be more practical to send it via a3558* <code>java.io.InputStream</code> object. The data will be read from the3559* stream as needed until end-of-file is reached.3560*3561* <P><B>Note:</B> This stream object can either be a standard3562* Java stream object or your own subclass that implements the3563* standard interface.3564* <P><B>Note:</B> Consult your JDBC driver documentation to determine if3565* it might be more efficient to use a version of3566* <code>setBinaryStream</code> which takes a length parameter.3567*3568* @param parameterName the name of the parameter3569* @param x the java input stream which contains the binary parameter value3570* @exception SQLException if a database access error occurs or3571* this method is called on a closed <code>CallableStatement</code>3572* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method3573* @since 1.63574*/3575public void setBinaryStream(String parameterName, java.io.InputStream x)3576throws SQLException{3577throw new SQLFeatureNotSupportedException("Feature not supported");3578}35793580/**3581* Sets the designated parameter to the given <code>Reader</code>3582* object.3583* When a very large UNICODE value is input to a <code>LONGVARCHAR</code>3584* parameter, it may be more practical to send it via a3585* <code>java.io.Reader</code> object. The data will be read from the stream3586* as needed until end-of-file is reached. The JDBC driver will3587* do any necessary conversion from UNICODE to the database char format.3588*3589* <P><B>Note:</B> This stream object can either be a standard3590* Java stream object or your own subclass that implements the3591* standard interface.3592* <P><B>Note:</B> Consult your JDBC driver documentation to determine if3593* it might be more efficient to use a version of3594* <code>setCharacterStream</code> which takes a length parameter.3595*3596* @param parameterName the name of the parameter3597* @param reader the <code>java.io.Reader</code> object that contains the3598* Unicode data3599* @exception SQLException if a database access error occurs or3600* this method is called on a closed <code>CallableStatement</code>3601* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method3602* @since 1.63603*/3604public void setCharacterStream(String parameterName,3605java.io.Reader reader) throws SQLException{3606throw new SQLFeatureNotSupportedException("Feature not supported");3607}36083609/**3610* Sets the designated parameter in this <code>RowSet</code> object's command3611* to a <code>Reader</code> object. The3612* <code>Reader</code> reads the data till end-of-file is reached. The3613* driver does the necessary conversion from Java character format to3614* the national character set in the database.3615*3616* <P><B>Note:</B> This stream object can either be a standard3617* Java stream object or your own subclass that implements the3618* standard interface.3619* <P><B>Note:</B> Consult your JDBC driver documentation to determine if3620* it might be more efficient to use a version of3621* <code>setNCharacterStream</code> which takes a length parameter.3622*3623* @param parameterIndex of the first parameter is 1, the second is 2, ...3624* @param value the parameter value3625* @throws SQLException if the driver does not support national3626* character sets; if the driver can detect that a data conversion3627* error could occur ; if a database access error occurs; or3628* this method is called on a closed <code>PreparedStatement</code>3629* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method3630* @since 1.63631*/3632public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException{3633throw new SQLFeatureNotSupportedException("Feature not supported");3634}36353636/**3637* Sets the value of the designated parameter with the given object. The second3638* argument must be an object type; for integral values, the3639* <code>java.lang</code> equivalent objects should be used.3640*3641* <p>The given Java object will be converted to the given targetSqlType3642* before being sent to the database.3643*3644* If the object has a custom mapping (is of a class implementing the3645* interface <code>SQLData</code>),3646* the JDBC driver should call the method <code>SQLData.writeSQL</code> to write it3647* to the SQL data stream.3648* If, on the other hand, the object is of a class implementing3649* <code>Ref</code>, <code>Blob</code>, <code>Clob</code>, <code>NClob</code>,3650* <code>Struct</code>, <code>java.net.URL</code>,3651* or <code>Array</code>, the driver should pass it to the database as a3652* value of the corresponding SQL type.3653* <P>3654* Note that this method may be used to pass database-3655* specific abstract data types.3656*3657* @param parameterName the name of the parameter3658* @param x the object containing the input parameter value3659* @param targetSqlType the SQL type (as defined in java.sql.Types) to be3660* sent to the database. The scale argument may further qualify this type.3661* @param scale for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types,3662* this is the number of digits after the decimal point. For all other3663* types, this value will be ignored.3664* @exception SQLException if a database access error occurs or3665* this method is called on a closed <code>CallableStatement</code>3666* @exception SQLFeatureNotSupportedException if <code>targetSqlType</code> is3667* a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,3668* <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,3669* <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,3670* <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>3671* or <code>STRUCT</code> data type and the JDBC driver does not support3672* this data type3673* @see Types3674* @see #getParams3675*/3676public void setObject(String parameterName, Object x, int targetSqlType, int scale)3677throws SQLException{3678throw new SQLFeatureNotSupportedException("Feature not supported");3679}36803681/**3682* Sets the value of the designated parameter with the given object.3683* This method is like the method <code>setObject</code>3684* above, except that it assumes a scale of zero.3685*3686* @param parameterName the name of the parameter3687* @param x the object containing the input parameter value3688* @param targetSqlType the SQL type (as defined in java.sql.Types) to be3689* sent to the database3690* @exception SQLException if a database access error occurs or3691* this method is called on a closed <code>CallableStatement</code>3692* @exception SQLFeatureNotSupportedException if <code>targetSqlType</code> is3693* a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,3694* <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,3695* <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,3696* <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>3697* or <code>STRUCT</code> data type and the JDBC driver does not support3698* this data type3699* @see #getParams3700*/3701public void setObject(String parameterName, Object x, int targetSqlType)3702throws SQLException{3703throw new SQLFeatureNotSupportedException("Feature not supported");3704}37053706/**3707* Sets the value of the designated parameter with the given object.3708* The second parameter must be of type <code>Object</code>; therefore, the3709* <code>java.lang</code> equivalent objects should be used for built-in types.3710*3711* <p>The JDBC specification specifies a standard mapping from3712* Java <code>Object</code> types to SQL types. The given argument3713* will be converted to the corresponding SQL type before being3714* sent to the database.3715*3716* <p>Note that this method may be used to pass database-3717* specific abstract data types, by using a driver-specific Java3718* type.3719*3720* If the object is of a class implementing the interface <code>SQLData</code>,3721* the JDBC driver should call the method <code>SQLData.writeSQL</code>3722* to write it to the SQL data stream.3723* If, on the other hand, the object is of a class implementing3724* <code>Ref</code>, <code>Blob</code>, <code>Clob</code>, <code>NClob</code>,3725* <code>Struct</code>, <code>java.net.URL</code>,3726* or <code>Array</code>, the driver should pass it to the database as a3727* value of the corresponding SQL type.3728* <P>3729* This method throws an exception if there is an ambiguity, for example, if the3730* object is of a class implementing more than one of the interfaces named above.3731*3732* @param parameterName the name of the parameter3733* @param x the object containing the input parameter value3734* @exception SQLException if a database access error occurs,3735* this method is called on a closed <code>CallableStatement</code> or if the given3736* <code>Object</code> parameter is ambiguous3737* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3738* this method3739* @see #getParams3740*/3741public void setObject(String parameterName, Object x) throws SQLException{3742throw new SQLFeatureNotSupportedException("Feature not supported");3743}37443745/**3746* Sets the designated parameter to a <code>InputStream</code> object.3747* The <code>InputStream</code> must contain the number3748* of characters specified by length otherwise a <code>SQLException</code> will be3749* generated when the <code>PreparedStatement</code> is executed.3750* This method differs from the <code>setBinaryStream (int, InputStream, int)</code>3751* method because it informs the driver that the parameter value should be3752* sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used,3753* the driver may have to do extra work to determine whether the parameter3754* data should be sent to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>3755* @param parameterIndex index of the first parameter is 1,3756* the second is 2, ...3757* @param inputStream An object that contains the data to set the parameter3758* value to.3759* @param length the number of bytes in the parameter data.3760* @throws SQLException if a database access error occurs,3761* this method is called on a closed <code>PreparedStatement</code>,3762* if parameterIndex does not correspond3763* to a parameter marker in the SQL statement, if the length specified3764* is less than zero or if the number of bytes in the3765* <code>InputStream</code> does not match the specified length.3766* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method3767*3768* @since 1.63769*/3770public void setBlob(int parameterIndex, InputStream inputStream, long length)3771throws SQLException{3772throw new SQLFeatureNotSupportedException("Feature not supported");3773}37743775/**3776* Sets the designated parameter to a <code>InputStream</code> object.3777* This method differs from the <code>setBinaryStream (int, InputStream)</code>3778* method because it informs the driver that the parameter value should be3779* sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used,3780* the driver may have to do extra work to determine whether the parameter3781* data should be sent to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>3782*3783* <P><B>Note:</B> Consult your JDBC driver documentation to determine if3784* it might be more efficient to use a version of3785* <code>setBlob</code> which takes a length parameter.3786*3787* @param parameterIndex index of the first parameter is 1,3788* the second is 2, ...3789* @param inputStream An object that contains the data to set the parameter3790* value to.3791* @throws SQLException if a database access error occurs,3792* this method is called on a closed <code>PreparedStatement</code> or3793* if parameterIndex does not correspond3794* to a parameter marker in the SQL statement,3795* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method3796*3797* @since 1.63798*/3799public void setBlob(int parameterIndex, InputStream inputStream)3800throws SQLException{3801throw new SQLFeatureNotSupportedException("Feature not supported");3802}38033804/**3805* Sets the designated parameter to a <code>InputStream</code> object.3806* The <code>Inputstream</code> must contain the number3807* of characters specified by length, otherwise a <code>SQLException</code> will be3808* generated when the <code>CallableStatement</code> is executed.3809* This method differs from the <code>setBinaryStream (int, InputStream, int)</code>3810* method because it informs the driver that the parameter value should be3811* sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used,3812* the driver may have to do extra work to determine whether the parameter3813* data should be sent to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>3814*3815* @param parameterName the name of the parameter to be set3816* the second is 2, ...3817*3818* @param inputStream An object that contains the data to set the parameter3819* value to.3820* @param length the number of bytes in the parameter data.3821* @throws SQLException if parameterIndex does not correspond3822* to a parameter marker in the SQL statement, or if the length specified3823* is less than zero; if the number of bytes in the <code>InputStream</code> does not match3824* the specified length; if a database access error occurs or3825* this method is called on a closed <code>CallableStatement</code>3826* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3827* this method3828*3829* @since 1.63830*/3831public void setBlob(String parameterName, InputStream inputStream, long length)3832throws SQLException{3833throw new SQLFeatureNotSupportedException("Feature not supported");3834}38353836/**3837* Sets the designated parameter to the given <code>java.sql.Blob</code> object.3838* The driver converts this to an SQL <code>BLOB</code> value when it3839* sends it to the database.3840*3841* @param parameterName the name of the parameter3842* @param x a <code>Blob</code> object that maps an SQL <code>BLOB</code> value3843* @exception SQLException if a database access error occurs or3844* this method is called on a closed <code>CallableStatement</code>3845* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3846* this method3847* @since 1.63848*/3849public void setBlob (String parameterName, Blob x) throws SQLException{3850throw new SQLFeatureNotSupportedException("Feature not supported");3851}38523853/**3854* Sets the designated parameter to a <code>InputStream</code> object.3855* This method differs from the <code>setBinaryStream (int, InputStream)</code>3856* method because it informs the driver that the parameter value should be3857* sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used,3858* the driver may have to do extra work to determine whether the parameter3859* data should be send to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>3860*3861* <P><B>Note:</B> Consult your JDBC driver documentation to determine if3862* it might be more efficient to use a version of3863* <code>setBlob</code> which takes a length parameter.3864*3865* @param parameterName the name of the parameter3866* @param inputStream An object that contains the data to set the parameter3867* value to.3868* @throws SQLException if a database access error occurs or3869* this method is called on a closed <code>CallableStatement</code>3870* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method3871*3872* @since 1.63873*/3874public void setBlob(String parameterName, InputStream inputStream)3875throws SQLException{3876throw new SQLFeatureNotSupportedException("Feature not supported");3877}38783879/**3880* Sets the designated parameter to a <code>Reader</code> object.3881* The reader must contain the number3882* of characters specified by length otherwise a <code>SQLException</code> will be3883* generated when the <code>PreparedStatement</code> is executed.3884* This method differs from the <code>setCharacterStream (int, Reader, int)</code> method3885* because it informs the driver that the parameter value should be sent to3886* the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the3887* driver may have to do extra work to determine whether the parameter3888* data should be sent to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>3889* @param parameterIndex index of the first parameter is 1, the second is 2, ...3890* @param reader An object that contains the data to set the parameter value to.3891* @param length the number of characters in the parameter data.3892* @throws SQLException if a database access error occurs, this method is called on3893* a closed <code>PreparedStatement</code>, if parameterIndex does not correspond to a parameter3894* marker in the SQL statement, or if the length specified is less than zero.3895*3896* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method3897* @since 1.63898*/3899public void setClob(int parameterIndex, Reader reader, long length)3900throws SQLException{3901throw new SQLFeatureNotSupportedException("Feature not supported");3902}39033904/**3905* Sets the designated parameter to a <code>Reader</code> object.3906* This method differs from the <code>setCharacterStream (int, Reader)</code> method3907* because it informs the driver that the parameter value should be sent to3908* the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the3909* driver may have to do extra work to determine whether the parameter3910* data should be sent to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>3911*3912* <P><B>Note:</B> Consult your JDBC driver documentation to determine if3913* it might be more efficient to use a version of3914* <code>setClob</code> which takes a length parameter.3915*3916* @param parameterIndex index of the first parameter is 1, the second is 2, ...3917* @param reader An object that contains the data to set the parameter value to.3918* @throws SQLException if a database access error occurs, this method is called on3919* a closed <code>PreparedStatement</code>or if parameterIndex does not correspond to a parameter3920* marker in the SQL statement3921*3922* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method3923* @since 1.63924*/3925public void setClob(int parameterIndex, Reader reader)3926throws SQLException{3927throw new SQLFeatureNotSupportedException("Feature not supported");3928}39293930/**3931* Sets the designated parameter to a <code>Reader</code> object.3932* The <code>reader</code> must contain the number3933* of characters specified by length otherwise a <code>SQLException</code> will be3934* generated when the <code>CallableStatement</code> is executed.3935* This method differs from the <code>setCharacterStream (int, Reader, int)</code> method3936* because it informs the driver that the parameter value should be sent to3937* the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the3938* driver may have to do extra work to determine whether the parameter3939* data should be send to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>3940* @param parameterName the name of the parameter to be set3941* @param reader An object that contains the data to set the parameter value to.3942* @param length the number of characters in the parameter data.3943* @throws SQLException if parameterIndex does not correspond to a parameter3944* marker in the SQL statement; if the length specified is less than zero;3945* a database access error occurs or3946* this method is called on a closed <code>CallableStatement</code>3947* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3948* this method3949*3950* @since 1.63951*/3952public void setClob(String parameterName, Reader reader, long length)3953throws SQLException {3954throw new SQLFeatureNotSupportedException("Feature not supported");3955}39563957/**3958* Sets the designated parameter to the given <code>java.sql.Clob</code> object.3959* The driver converts this to an SQL <code>CLOB</code> value when it3960* sends it to the database.3961*3962* @param parameterName the name of the parameter3963* @param x a <code>Clob</code> object that maps an SQL <code>CLOB</code> value3964* @exception SQLException if a database access error occurs or3965* this method is called on a closed <code>CallableStatement</code>3966* @exception SQLFeatureNotSupportedException if the JDBC driver does not support3967* this method3968* @since 1.63969*/3970public void setClob (String parameterName, Clob x) throws SQLException {3971throw new SQLFeatureNotSupportedException("Feature not supported");3972}39733974/**3975* Sets the designated parameter to a <code>Reader</code> object.3976* This method differs from the <code>setCharacterStream (int, Reader)</code> method3977* because it informs the driver that the parameter value should be sent to3978* the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the3979* driver may have to do extra work to determine whether the parameter3980* data should be send to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>3981*3982* <P><B>Note:</B> Consult your JDBC driver documentation to determine if3983* it might be more efficient to use a version of3984* <code>setClob</code> which takes a length parameter.3985*3986* @param parameterName the name of the parameter3987* @param reader An object that contains the data to set the parameter value to.3988* @throws SQLException if a database access error occurs or this method is called on3989* a closed <code>CallableStatement</code>3990*3991* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method3992* @since 1.63993*/3994public void setClob(String parameterName, Reader reader) throws SQLException {3995throw new SQLFeatureNotSupportedException("Feature not supported");3996}39973998/**3999* Sets the designated parameter to the given <code>java.sql.Date</code> value4000* using the default time zone of the virtual machine that is running4001* the application.4002* The driver converts this4003* to an SQL <code>DATE</code> value when it sends it to the database.4004*4005* @param parameterName the name of the parameter4006* @param x the parameter value4007* @exception SQLException if a database access error occurs or4008* this method is called on a closed <code>CallableStatement</code>4009* @exception SQLFeatureNotSupportedException if the JDBC driver does not support4010* this method4011* @see #getParams4012*/4013public void setDate(String parameterName, java.sql.Date x)4014throws SQLException {4015throw new SQLFeatureNotSupportedException("Feature not supported");4016}40174018/**4019* Sets the designated parameter to the given <code>java.sql.Date</code> value,4020* using the given <code>Calendar</code> object. The driver uses4021* the <code>Calendar</code> object to construct an SQL <code>DATE</code> value,4022* which the driver then sends to the database. With a4023* a <code>Calendar</code> object, the driver can calculate the date4024* taking into account a custom timezone. If no4025* <code>Calendar</code> object is specified, the driver uses the default4026* timezone, which is that of the virtual machine running the application.4027*4028* @param parameterName the name of the parameter4029* @param x the parameter value4030* @param cal the <code>Calendar</code> object the driver will use4031* to construct the date4032* @exception SQLException if a database access error occurs or4033* this method is called on a closed <code>CallableStatement</code>4034* @exception SQLFeatureNotSupportedException if the JDBC driver does not support4035* this method4036* @see #getParams4037*/4038public void setDate(String parameterName, java.sql.Date x, Calendar cal)4039throws SQLException {4040throw new SQLFeatureNotSupportedException("Feature not supported");4041}40424043/**4044* Sets the designated parameter to the given <code>java.sql.Time</code> value.4045* The driver converts this4046* to an SQL <code>TIME</code> value when it sends it to the database.4047*4048* @param parameterName the name of the parameter4049* @param x the parameter value4050* @exception SQLException if a database access error occurs or4051* this method is called on a closed <code>CallableStatement</code>4052* @exception SQLFeatureNotSupportedException if the JDBC driver does not support4053* this method4054* @see #getParams4055*/4056public void setTime(String parameterName, java.sql.Time x)4057throws SQLException {4058throw new SQLFeatureNotSupportedException("Feature not supported");4059}40604061/**4062* Sets the designated parameter to the given <code>java.sql.Time</code> value,4063* using the given <code>Calendar</code> object. The driver uses4064* the <code>Calendar</code> object to construct an SQL <code>TIME</code> value,4065* which the driver then sends to the database. With a4066* a <code>Calendar</code> object, the driver can calculate the time4067* taking into account a custom timezone. If no4068* <code>Calendar</code> object is specified, the driver uses the default4069* timezone, which is that of the virtual machine running the application.4070*4071* @param parameterName the name of the parameter4072* @param x the parameter value4073* @param cal the <code>Calendar</code> object the driver will use4074* to construct the time4075* @exception SQLException if a database access error occurs or4076* this method is called on a closed <code>CallableStatement</code>4077* @exception SQLFeatureNotSupportedException if the JDBC driver does not support4078* this method4079* @see #getParams4080*/4081public void setTime(String parameterName, java.sql.Time x, Calendar cal)4082throws SQLException {4083throw new SQLFeatureNotSupportedException("Feature not supported");4084}40854086/**4087* Sets the designated parameter to the given <code>java.sql.Timestamp</code> value,4088* using the given <code>Calendar</code> object. The driver uses4089* the <code>Calendar</code> object to construct an SQL <code>TIMESTAMP</code> value,4090* which the driver then sends to the database. With a4091* a <code>Calendar</code> object, the driver can calculate the timestamp4092* taking into account a custom timezone. If no4093* <code>Calendar</code> object is specified, the driver uses the default4094* timezone, which is that of the virtual machine running the application.4095*4096* @param parameterName the name of the parameter4097* @param x the parameter value4098* @param cal the <code>Calendar</code> object the driver will use4099* to construct the timestamp4100* @exception SQLException if a database access error occurs or4101* this method is called on a closed <code>CallableStatement</code>4102* @exception SQLFeatureNotSupportedException if the JDBC driver does not support4103* this method4104* @see #getParams4105*/4106public void setTimestamp(String parameterName, java.sql.Timestamp x, Calendar cal)4107throws SQLException {4108throw new SQLFeatureNotSupportedException("Feature not supported");4109}41104111/**4112* Sets the designated parameter to the given <code>java.sql.SQLXML</code> object. The driver converts this to an4113* SQL <code>XML</code> value when it sends it to the database.4114* @param parameterIndex index of the first parameter is 1, the second is 2, ...4115* @param xmlObject a <code>SQLXML</code> object that maps an SQL <code>XML</code> value4116* @throws SQLException if a database access error occurs, this method4117* is called on a closed result set,4118* the <code>java.xml.transform.Result</code>,4119* <code>Writer</code> or <code>OutputStream</code> has not been closed4120* for the <code>SQLXML</code> object or4121* if there is an error processing the XML value. The <code>getCause</code> method4122* of the exception may provide a more detailed exception, for example, if the4123* stream does not contain valid XML.4124* @throws SQLFeatureNotSupportedException if the JDBC driver does not4125* support this method4126* @since 1.64127*/4128public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException {4129throw new SQLFeatureNotSupportedException("Feature not supported");4130}41314132/**4133* Sets the designated parameter to the given <code>java.sql.SQLXML</code> object. The driver converts this to an4134* <code>SQL XML</code> value when it sends it to the database.4135* @param parameterName the name of the parameter4136* @param xmlObject a <code>SQLXML</code> object that maps an <code>SQL XML</code> value4137* @throws SQLException if a database access error occurs, this method4138* is called on a closed result set,4139* the <code>java.xml.transform.Result</code>,4140* <code>Writer</code> or <code>OutputStream</code> has not been closed4141* for the <code>SQLXML</code> object or4142* if there is an error processing the XML value. The <code>getCause</code> method4143* of the exception may provide a more detailed exception, for example, if the4144* stream does not contain valid XML.4145* @throws SQLFeatureNotSupportedException if the JDBC driver does not4146* support this method4147* @since 1.64148*/4149public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException {4150throw new SQLFeatureNotSupportedException("Feature not supported");4151}41524153/**4154* Sets the designated parameter to the given <code>java.sql.RowId</code> object. The4155* driver converts this to a SQL <code>ROWID</code> value when it sends it4156* to the database4157*4158* @param parameterIndex the first parameter is 1, the second is 2, ...4159* @param x the parameter value4160* @throws SQLException if a database access error occurs4161* @throws SQLFeatureNotSupportedException if the JDBC driver does not4162* support this method4163*4164* @since 1.64165*/4166public void setRowId(int parameterIndex, RowId x) throws SQLException {4167throw new SQLFeatureNotSupportedException("Feature not supported");4168}41694170/**4171* Sets the designated parameter to the given <code>java.sql.RowId</code> object. The4172* driver converts this to a SQL <code>ROWID</code> when it sends it to the4173* database.4174*4175* @param parameterName the name of the parameter4176* @param x the parameter value4177* @throws SQLException if a database access error occurs4178* @throws SQLFeatureNotSupportedException if the JDBC driver does not4179* support this method4180* @since 1.64181*/4182public void setRowId(String parameterName, RowId x) throws SQLException {4183throw new SQLFeatureNotSupportedException("Feature not supported");4184}41854186/**4187* Sets the designated parameter to the given <code>String</code> object.4188* The driver converts this to a SQL <code>NCHAR</code> or4189* <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value4190* (depending on the argument's4191* size relative to the driver's limits on <code>NVARCHAR</code> values)4192* when it sends it to the database.4193*4194* @param parameterIndex of the first parameter is 1, the second is 2, ...4195* @param value the parameter value4196* @throws SQLException if the driver does not support national4197* character sets; if the driver can detect that a data conversion4198* error could occur ; or if a database access error occurs4199* @throws SQLFeatureNotSupportedException if the JDBC driver does not4200* support this method4201* @since 1.64202*/4203public void setNString(int parameterIndex, String value) throws SQLException {4204throw new SQLFeatureNotSupportedException("Feature not supported");4205}42064207/**4208* Sets the designated parameter to the given <code>String</code> object.4209* The driver converts this to a SQL <code>NCHAR</code> or4210* <code>NVARCHAR</code> or <code>LONGNVARCHAR</code>4211* @param parameterName the name of the column to be set4212* @param value the parameter value4213* @throws SQLException if the driver does not support national4214* character sets; if the driver can detect that a data conversion4215* error could occur; or if a database access error occurs4216* @throws SQLFeatureNotSupportedException if the JDBC driver does not4217* support this method4218* @since 1.64219*/4220public void setNString(String parameterName, String value) throws SQLException {4221throw new SQLFeatureNotSupportedException("Feature not supported");4222}42234224/**4225* Sets the designated parameter to a <code>Reader</code> object. The4226* <code>Reader</code> reads the data till end-of-file is reached. The4227* driver does the necessary conversion from Java character format to4228* the national character set in the database.4229* @param parameterIndex of the first parameter is 1, the second is 2, ...4230* @param value the parameter value4231* @param length the number of characters in the parameter data.4232* @throws SQLException if the driver does not support national4233* character sets; if the driver can detect that a data conversion4234* error could occur ; or if a database access error occurs4235* @throws SQLFeatureNotSupportedException if the JDBC driver does not4236* support this method4237* @since 1.64238*/4239public void setNCharacterStream(int parameterIndex, Reader value, long length)4240throws SQLException {4241throw new SQLFeatureNotSupportedException("Feature not supported");4242}42434244/**4245* Sets the designated parameter to a <code>Reader</code> object. The4246* <code>Reader</code> reads the data till end-of-file is reached. The4247* driver does the necessary conversion from Java character format to4248* the national character set in the database.4249* @param parameterName the name of the column to be set4250* @param value the parameter value4251* @param length the number of characters in the parameter data.4252* @throws SQLException if the driver does not support national4253* character sets; if the driver can detect that a data conversion4254* error could occur; or if a database access error occurs4255* @throws SQLFeatureNotSupportedException if the JDBC driver does not4256* support this method4257* @since 1.64258*/4259public void setNCharacterStream(String parameterName, Reader value, long length)4260throws SQLException {4261throw new SQLFeatureNotSupportedException("Feature not supported");4262}42634264/**4265* Sets the designated parameter to a <code>Reader</code> object. The4266* <code>Reader</code> reads the data till end-of-file is reached. The4267* driver does the necessary conversion from Java character format to4268* the national character set in the database.4269* <P><B>Note:</B> This stream object can either be a standard4270* Java stream object or your own subclass that implements the4271* standard interface.4272* <P><B>Note:</B> Consult your JDBC driver documentation to determine if4273* it might be more efficient to use a version of4274* <code>setNCharacterStream</code> which takes a length parameter.4275*4276* @param parameterName the name of the parameter4277* @param value the parameter value4278* @throws SQLException if the driver does not support national4279* character sets; if the driver can detect that a data conversion4280* error could occur ; if a database access error occurs; or4281* this method is called on a closed <code>CallableStatement</code>4282* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method4283* @since 1.64284*/4285public void setNCharacterStream(String parameterName, Reader value)4286throws SQLException {4287throw new SQLFeatureNotSupportedException("Feature not supported");4288}42894290/**4291* Sets the designated parameter to a <code>java.sql.NClob</code> object. The object4292* implements the <code>java.sql.NClob</code> interface. This <code>NClob</code>4293* object maps to a SQL <code>NCLOB</code>.4294* @param parameterName the name of the column to be set4295* @param value the parameter value4296* @throws SQLException if the driver does not support national4297* character sets; if the driver can detect that a data conversion4298* error could occur; or if a database access error occurs4299* @throws SQLFeatureNotSupportedException if the JDBC driver does not4300* support this method4301* @since 1.64302*/4303public void setNClob(String parameterName, NClob value) throws SQLException {4304throw new SQLFeatureNotSupportedException("Feature not supported");4305}43064307/**4308* Sets the designated parameter to a <code>Reader</code> object. The <code>reader</code> must contain4309* the number4310* of characters specified by length otherwise a <code>SQLException</code> will be4311* generated when the <code>CallableStatement</code> is executed.4312* This method differs from the <code>setCharacterStream (int, Reader, int)</code> method4313* because it informs the driver that the parameter value should be sent to4314* the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the4315* driver may have to do extra work to determine whether the parameter4316* data should be send to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>4317*4318* @param parameterName the name of the parameter to be set4319* @param reader An object that contains the data to set the parameter value to.4320* @param length the number of characters in the parameter data.4321* @throws SQLException if parameterIndex does not correspond to a parameter4322* marker in the SQL statement; if the length specified is less than zero;4323* if the driver does not support national4324* character sets; if the driver can detect that a data conversion4325* error could occur; if a database access error occurs or4326* this method is called on a closed <code>CallableStatement</code>4327* @exception SQLFeatureNotSupportedException if the JDBC driver does not support4328* this method4329* @since 1.64330*/4331public void setNClob(String parameterName, Reader reader, long length)4332throws SQLException {4333throw new SQLFeatureNotSupportedException("Feature not supported");4334}43354336/**4337* Sets the designated parameter to a <code>Reader</code> object.4338* This method differs from the <code>setCharacterStream (int, Reader)</code> method4339* because it informs the driver that the parameter value should be sent to4340* the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the4341* driver may have to do extra work to determine whether the parameter4342* data should be send to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>4343* <P><B>Note:</B> Consult your JDBC driver documentation to determine if4344* it might be more efficient to use a version of4345* <code>setNClob</code> which takes a length parameter.4346*4347* @param parameterName the name of the parameter4348* @param reader An object that contains the data to set the parameter value to.4349* @throws SQLException if the driver does not support national character sets;4350* if the driver can detect that a data conversion4351* error could occur; if a database access error occurs or4352* this method is called on a closed <code>CallableStatement</code>4353* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method4354*4355* @since 1.64356*/4357public void setNClob(String parameterName, Reader reader) throws SQLException {4358throw new SQLFeatureNotSupportedException("Feature not supported");4359}43604361/**4362* Sets the designated parameter to a <code>Reader</code> object. The reader must contain the number4363* of characters specified by length otherwise a <code>SQLException</code> will be4364* generated when the <code>PreparedStatement</code> is executed.4365* This method differs from the <code>setCharacterStream (int, Reader, int)</code> method4366* because it informs the driver that the parameter value should be sent to4367* the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the4368* driver may have to do extra work to determine whether the parameter4369* data should be sent to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>4370* @param parameterIndex index of the first parameter is 1, the second is 2, ...4371* @param reader An object that contains the data to set the parameter value to.4372* @param length the number of characters in the parameter data.4373* @throws SQLException if parameterIndex does not correspond to a parameter4374* marker in the SQL statement; if the length specified is less than zero;4375* if the driver does not support national character sets;4376* if the driver can detect that a data conversion4377* error could occur; if a database access error occurs or4378* this method is called on a closed <code>PreparedStatement</code>4379* @throws SQLFeatureNotSupportedException if the JDBC driver does not4380* support this method4381*4382* @since 1.64383*/4384public void setNClob(int parameterIndex, Reader reader, long length)4385throws SQLException {4386throw new SQLFeatureNotSupportedException("Feature not supported");4387}43884389/**4390* Sets the designated parameter to a <code>java.sql.NClob</code> object. The driver converts this oa4391* SQL <code>NCLOB</code> value when it sends it to the database.4392* @param parameterIndex of the first parameter is 1, the second is 2, ...4393* @param value the parameter value4394* @throws SQLException if the driver does not support national4395* character sets; if the driver can detect that a data conversion4396* error could occur ; or if a database access error occurs4397* @throws SQLFeatureNotSupportedException if the JDBC driver does not4398* support this method4399* @since 1.64400*/4401public void setNClob(int parameterIndex, NClob value) throws SQLException {4402throw new SQLFeatureNotSupportedException("Feature not supported");4403}44044405/**4406* Sets the designated parameter to a <code>Reader</code> object.4407* This method differs from the <code>setCharacterStream (int, Reader)</code> method4408* because it informs the driver that the parameter value should be sent to4409* the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the4410* driver may have to do extra work to determine whether the parameter4411* data should be sent to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>4412* <P><B>Note:</B> Consult your JDBC driver documentation to determine if4413* it might be more efficient to use a version of4414* <code>setNClob</code> which takes a length parameter.4415*4416* @param parameterIndex index of the first parameter is 1, the second is 2, ...4417* @param reader An object that contains the data to set the parameter value to.4418* @throws SQLException if parameterIndex does not correspond to a parameter4419* marker in the SQL statement;4420* if the driver does not support national character sets;4421* if the driver can detect that a data conversion4422* error could occur; if a database access error occurs or4423* this method is called on a closed <code>PreparedStatement</code>4424* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method4425*4426* @since 1.64427*/4428public void setNClob(int parameterIndex, Reader reader)throws SQLException {4429throw new SQLFeatureNotSupportedException("Feature not supported");4430}44314432/**4433* Sets the designated parameter to the given <code>java.net.URL</code> value.4434* The driver converts this to an SQL <code>DATALINK</code> value4435* when it sends it to the database.4436*4437* @param parameterIndex the first parameter is 1, the second is 2, ...4438* @param x the <code>java.net.URL</code> object to be set4439* @exception SQLException if a database access error occurs or4440* this method is called on a closed <code>PreparedStatement</code>4441* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method4442*/4443public void setURL(int parameterIndex, java.net.URL x) throws SQLException {4444throw new SQLFeatureNotSupportedException("Feature not supported");4445}44464447static final long serialVersionUID = 4886719666485113312L;44484449} //end class445044514452