Path: blob/master/src/java.sql/share/classes/javax/sql/RowSet.java
41152 views
/*1* Copyright (c) 2000, 2020, 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;2627import java.sql.*;28import java.io.*;29import java.math.*;30import java.util.*;3132/**33* The interface that adds support to the JDBC API for the34* JavaBeans component model.35* A rowset, which can be used as a JavaBeans component in36* a visual Bean development environment, can be created and37* configured at design time and executed at run time.38* <P>39* The {@code RowSet}40* interface provides a set of JavaBeans properties that allow a {@code RowSet}41* instance to be configured to connect to a JDBC data source and read42* some data from the data source. A group of setter methods ({@code setInt},43* {@code setBytes}, {@code setString}, and so on)44* provide a way to pass input parameters to a rowset's command property.45* This command is the SQL query the rowset uses when it gets its data from46* a relational database, which is generally the case.47* <P>48* The {@code RowSet}49* interface supports JavaBeans events, allowing other components in an50* application to be notified when an event occurs on a rowset,51* such as a change in its value.52*53* <P>The {@code RowSet} interface is unique in that it is intended to be54* implemented using the rest of the JDBC API. In other words, a55* {@code RowSet} implementation is a layer of software that executes "on top"56* of a JDBC driver. Implementations of the {@code RowSet} interface can57* be provided by anyone, including JDBC driver vendors who want to58* provide a {@code RowSet} implementation as part of their JDBC products.59* <P>60* A {@code RowSet} object may make a connection with a data source and61* maintain that connection throughout its life cycle, in which case it is62* called a <i>connected</i> rowset. A rowset may also make a connection with63* a data source, get data from it, and then close the connection. Such a rowset64* is called a <i>disconnected</i> rowset. A disconnected rowset may make65* changes to its data while it is disconnected and then send the changes back66* to the original source of the data, but it must reestablish a connection to do so.67* <P>68* A disconnected rowset may have a {@code Reader} (a {@code RowSetReader} object)69* and a writer (a {@code RowSetWriter} object) associated with it.70* The {@code Reader} may be implemented in many different ways to populate a rowset71* with data, including getting data from a non-relational data source. The72* writer can also be implemented in many different ways to propagate changes73* made to the rowset's data back to the underlying data source.74* <P>75* Rowsets are easy to use. The {@code RowSet} interface extends the standard76* {@code java.sql.ResultSet} interface. The {@code RowSetMetaData}77* interface extends the {@code java.sql.ResultSetMetaData} interface.78* Thus, developers familiar79* with the JDBC API will have to learn a minimal number of new APIs to80* use rowsets. In addition, third-party software tools that work with81* JDBC {@code ResultSet} objects will also easily be made to work with rowsets.82*83* @since 1.484*/8586public interface RowSet extends ResultSet {8788//-----------------------------------------------------------------------89// Properties90//-----------------------------------------------------------------------9192//-----------------------------------------------------------------------93// The following properties may be used to create a Connection.94//-----------------------------------------------------------------------9596/**97* Retrieves the url property this {@code RowSet} object will use to98* create a connection if it uses the {@code DriverManager}99* instead of a {@code DataSource} object to establish the connection.100* The default value is {@code null}.101*102* @return a string url103* @throws SQLException if a database access error occurs104* @see #setUrl105*/106String getUrl() throws SQLException;107108/**109* Sets the URL this {@code RowSet} object will use when it uses the110* {@code DriverManager} to create a connection.111*112* Setting this property is optional. If a URL is used, a JDBC driver113* that accepts the URL must be loaded before the114* rowset is used to connect to a database. The rowset will use the URL115* internally to create a database connection when reading or writing116* data. Either a URL or a data source name is used to create a117* connection, whichever was set to non null value most recently.118*119* @param url a string value; may be {@code null}120* @throws SQLException if a database access error occurs121* @see #getUrl122*/123void setUrl(String url) throws SQLException;124125/**126* Retrieves the logical name that identifies the data source for this127* {@code RowSet} object.128*129* @return a data source name130* @see #setDataSourceName131* @see #setUrl132*/133String getDataSourceName();134135/**136* Sets the data source name property for this {@code RowSet} object to the137* given {@code String}.138* <P>139* The value of the data source name property can be used to do a lookup of140* a {@code DataSource} object that has been registered with a naming141* service. After being retrieved, the {@code DataSource} object can be142* used to create a connection to the data source that it represents.143*144* @param name the logical name of the data source for this {@code RowSet}145* object; may be {@code null}146* @throws SQLException if a database access error occurs147* @see #getDataSourceName148*/149void setDataSourceName(String name) throws SQLException;150151/**152* Retrieves the username used to create a database connection for this153* {@code RowSet} object.154* The username property is set at run time before calling the method155* {@code execute}. It is156* not usually part of the serialized state of a {@code RowSet} object.157*158* @return the username property159* @see #setUsername160*/161String getUsername();162163/**164* Sets the username property for this {@code RowSet} object to the165* given {@code String}.166*167* @param name a user name168* @throws SQLException if a database access error occurs169* @see #getUsername170*/171void setUsername(String name) throws SQLException;172173/**174* Retrieves the password used to create a database connection.175* The password property is set at run time before calling the method176* {@code execute}. It is not usually part of the serialized state177* of a {@code RowSet} object.178*179* @return the password for making a database connection180* @see #setPassword181*/182String getPassword();183184/**185* Sets the database password for this {@code RowSet} object to186* the given {@code String}.187*188* @param password the password string189* @throws SQLException if a database access error occurs190* @see #getPassword191*/192void setPassword(String password) throws SQLException;193194/**195* Retrieves the transaction isolation level set for this196* {@code RowSet} object.197*198* @return the transaction isolation level; one of199* {@code Connection.TRANSACTION_READ_UNCOMMITTED},200* {@code Connection.TRANSACTION_READ_COMMITTED},201* {@code Connection.TRANSACTION_REPEATABLE_READ}, or202* {@code Connection.TRANSACTION_SERIALIZABLE}203* @see #setTransactionIsolation204*/205int getTransactionIsolation();206207/**208* Sets the transaction isolation level for this {@code RowSet} object.209*210* @param level the transaction isolation level; one of211* {@code Connection.TRANSACTION_READ_UNCOMMITTED},212* {@code Connection.TRANSACTION_READ_COMMITTED},213* {@code Connection.TRANSACTION_REPEATABLE_READ}, or214* {@code Connection.TRANSACTION_SERIALIZABLE}215* @throws SQLException if a database access error occurs216* @see #getTransactionIsolation217*/218void setTransactionIsolation(int level) throws SQLException;219220/**221* Retrieves the {@code Map} object associated with this222* {@code RowSet} object, which specifies the custom mapping223* of SQL user-defined types, if any. The default is for the224* type map to be empty.225*226* @return a {@code java.util.Map} object containing the names of227* SQL user-defined types and the Java classes to which they are228* to be mapped229*230* @throws SQLException if a database access error occurs231* @see #setTypeMap232*/233java.util.Map<String,Class<?>> getTypeMap() throws SQLException;234235/**236* Installs the given {@code java.util.Map} object as the default237* type map for this {@code RowSet} object. This type map will be238* used unless another type map is supplied as a method parameter.239*240* @param map a {@code java.util.Map} object containing the names of241* SQL user-defined types and the Java classes to which they are242* to be mapped243* @throws SQLException if a database access error occurs244* @see #getTypeMap245*/246void setTypeMap(java.util.Map<String,Class<?>> map) throws SQLException;247248//-----------------------------------------------------------------------249// The following properties may be used to create a Statement.250//-----------------------------------------------------------------------251252/**253* Retrieves this {@code RowSet} object's command property.254*255* The command property contains a command string, which must be an SQL256* query, that can be executed to fill the rowset with data.257* The default value is {@code null}.258*259* @return the command string; may be {@code null}260* @see #setCommand261*/262String getCommand();263264/**265* Sets this {@code RowSet} object's command property to the given266* SQL query.267*268* This property is optional269* when a rowset gets its data from a data source that does not support270* commands, such as a spreadsheet.271*272* @param cmd the SQL query that will be used to get the data for this273* {@code RowSet} object; may be {@code null}274* @throws SQLException if a database access error occurs275* @see #getCommand276*/277void setCommand(String cmd) throws SQLException;278279/**280* Retrieves whether this {@code RowSet} object is read-only.281* If updates are possible, the default is for a rowset to be282* updatable.283* <P>284* Attempts to update a read-only rowset will result in an285* {@code SQLException} being thrown.286*287* @return {@code true} if this {@code RowSet} object is288* read-only; {@code false} if it is updatable289* @see #setReadOnly290*/291boolean isReadOnly();292293/**294* Sets whether this {@code RowSet} object is read-only to the295* given {@code boolean}.296*297* @param value {@code true} if read-only; {@code false} if298* updatable299* @throws SQLException if a database access error occurs300* @see #isReadOnly301*/302void setReadOnly(boolean value) throws SQLException;303304/**305* Retrieves the maximum number of bytes that may be returned306* for certain column values.307* This limit applies only to {@code BINARY},308* {@code VARBINARY}, {@code LONGVARBINARYBINARY}, {@code CHAR},309* {@code VARCHAR}, {@code LONGVARCHAR}, {@code NCHAR}310* and {@code NVARCHAR} columns.311* If the limit is exceeded, the excess data is silently discarded.312*313* @return the current maximum column size limit; zero means that there314* is no limit315* @throws SQLException if a database access error occurs316* @see #setMaxFieldSize317*/318int getMaxFieldSize() throws SQLException;319320/**321* Sets the maximum number of bytes that can be returned for a column322* value to the given number of bytes.323* This limit applies only to {@code BINARY},324* {@code VARBINARY}, {@code LONGVARBINARYBINARY}, {@code CHAR},325* {@code VARCHAR}, {@code LONGVARCHAR}, {@code NCHAR}326* and {@code NVARCHAR} columns.327* If the limit is exceeded, the excess data is silently discarded.328* For maximum portability, use values greater than 256.329*330* @param max the new max column size limit in bytes; zero means unlimited331* @throws SQLException if a database access error occurs332* @see #getMaxFieldSize333*/334void setMaxFieldSize(int max) throws SQLException;335336/**337* Retrieves the maximum number of rows that this {@code RowSet}338* object can contain.339* If the limit is exceeded, the excess rows are silently dropped.340*341* @return the current maximum number of rows that this {@code RowSet}342* object can contain; zero means unlimited343* @throws SQLException if a database access error occurs344* @see #setMaxRows345*/346int getMaxRows() throws SQLException;347348/**349* Sets the maximum number of rows that this {@code RowSet}350* object can contain to the specified number.351* If the limit is exceeded, the excess rows are silently dropped.352*353* @param max the new maximum number of rows; zero means unlimited354* @throws SQLException if a database access error occurs355* @see #getMaxRows356*/357void setMaxRows(int max) throws SQLException;358359/**360* Retrieves whether escape processing is enabled for this361* {@code RowSet} object.362* If escape scanning is enabled, which is the default, the driver will do363* escape substitution before sending an SQL statement to the database.364*365* @return {@code true} if escape processing is enabled;366* {@code false} if it is disabled367* @throws SQLException if a database access error occurs368* @see #setEscapeProcessing369*/370boolean getEscapeProcessing() throws SQLException;371372/**373* Sets escape processing for this {@code RowSet} object on or374* off. If escape scanning is on (the default), the driver will do375* escape substitution before sending an SQL statement to the database.376*377* @param enable {@code true} to enable escape processing;378* {@code false} to disable it379* @throws SQLException if a database access error occurs380* @see #getEscapeProcessing381*/382void setEscapeProcessing(boolean enable) throws SQLException;383384/**385* Retrieves the maximum number of seconds the driver will wait for386* a statement to execute.387* If this limit is exceeded, an {@code SQLException} is thrown.388*389* @return the current query timeout limit in seconds; zero means390* unlimited391* @throws SQLException if a database access error occurs392* @see #setQueryTimeout393*/394int getQueryTimeout() throws SQLException;395396/**397* Sets the maximum time the driver will wait for398* a statement to execute to the given number of seconds.399* If this limit is exceeded, an {@code SQLException} is thrown.400*401* @param seconds the new query timeout limit in seconds; zero means402* that there is no limit403* @throws SQLException if a database access error occurs404* @see #getQueryTimeout405*/406void setQueryTimeout(int seconds) throws SQLException;407408/**409* Sets the type of this {@code RowSet} object to the given type.410* This method is used to change the type of a rowset, which is by411* default read-only and non-scrollable.412*413* @param type one of the {@code ResultSet} constants specifying a type:414* {@code ResultSet.TYPE_FORWARD_ONLY},415* {@code ResultSet.TYPE_SCROLL_INSENSITIVE}, or416* {@code ResultSet.TYPE_SCROLL_SENSITIVE}417* @throws SQLException if a database access error occurs418* @see java.sql.ResultSet#getType419*/420void setType(int type) throws SQLException;421422/**423* Sets the concurrency of this {@code RowSet} object to the given424* concurrency level. This method is used to change the concurrency level425* of a rowset, which is by default {@code ResultSet.CONCUR_READ_ONLY}426*427* @param concurrency one of the {@code ResultSet} constants specifying a428* concurrency level: {@code ResultSet.CONCUR_READ_ONLY} or429* {@code ResultSet.CONCUR_UPDATABLE}430* @throws SQLException if a database access error occurs431* @see ResultSet#getConcurrency432*/433void setConcurrency(int concurrency) throws SQLException;434435//-----------------------------------------------------------------------436// Parameters437//-----------------------------------------------------------------------438439/**440* The {@code RowSet} setter methods are used to set any input parameters441* needed by the {@code RowSet} object's command.442* Parameters are set at run time, as opposed to design time.443*/444445/**446* Sets the designated parameter in this {@code RowSet} object's SQL447* command to SQL {@code NULL}.448*449* <P><B>Note:</B> You must specify the parameter's SQL type.450*451* @param parameterIndex the first parameter is 1, the second is 2, ...452* @param sqlType a SQL type code defined by {@code java.sql.Types}453* @throws SQLException if a database access error occurs454*/455void setNull(int parameterIndex, int sqlType) throws SQLException;456457/**458* Sets the designated parameter to SQL {@code NULL}.459*460* <P><B>Note:</B> You must specify the parameter's SQL type.461*462* @param parameterName the name of the parameter463* @param sqlType the SQL type code defined in {@code java.sql.Types}464* @throws SQLException if a database access error occurs or465* this method is called on a closed {@code CallableStatement}466* @throws SQLFeatureNotSupportedException if the JDBC driver does not support467* this method468* @since 1.4469*/470void setNull(String parameterName, int sqlType) throws SQLException;471472/**473* Sets the designated parameter in this {@code RowSet} object's SQL474* command to SQL {@code NULL}. This version of the method {@code setNull}475* should be used for SQL user-defined types (UDTs) and {@code REF} type476* parameters. Examples of UDTs include: {@code STRUCT}, {@code DISTINCT},477* {@code JAVA_OBJECT}, and named array types.478*479* <P><B>Note:</B> To be portable, applications must give the480* SQL type code and the fully qualified SQL type name when specifying481* a NULL UDT or {@code REF} parameter. In the case of a UDT,482* the name is the type name of the parameter itself. For a {@code REF}483* parameter, the name is the type name of the referenced type. If484* a JDBC driver does not need the type code or type name information,485* it may ignore it.486*487* Although it is intended for UDT and {@code REF} parameters,488* this method may be used to set a null parameter of any JDBC type.489* If the parameter does not have a user-defined or {@code REF} type,490* the typeName parameter is ignored.491*492*493* @param paramIndex the first parameter is 1, the second is 2, ...494* @param sqlType a value from {@code java.sql.Types}495* @param typeName the fully qualified name of an SQL UDT or the type496* name of the SQL structured type being referenced by a {@code REF}497* type; ignored if the parameter is not a UDT or {@code REF} type498* @throws SQLException if a database access error occurs499*/500void setNull (int paramIndex, int sqlType, String typeName)501throws SQLException;502503/**504* Sets the designated parameter to SQL {@code NULL}.505* This version of the method {@code setNull} should506* be used for user-defined types and REF type parameters. Examples507* of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and508* named array types.509*510* <P><B>Note:</B> To be portable, applications must give the511* SQL type code and the fully-qualified SQL type name when specifying512* a NULL user-defined or REF parameter. In the case of a user-defined type513* the name is the type name of the parameter itself. For a REF514* parameter, the name is the type name of the referenced type. If515* a JDBC driver does not need the type code or type name information,516* it may ignore it.517*518* Although it is intended for user-defined and Ref parameters,519* this method may be used to set a null parameter of any JDBC type.520* If the parameter does not have a user-defined or REF type, the given521* typeName is ignored.522*523*524* @param parameterName the name of the parameter525* @param sqlType a value from {@code java.sql.Types}526* @param typeName the fully-qualified name of an SQL user-defined type;527* ignored if the parameter is not a user-defined type or528* SQL {@code REF} value529* @throws SQLException if a database access error occurs or530* this method is called on a closed {@code CallableStatement}531* @throws SQLFeatureNotSupportedException if the JDBC driver does not support532* this method533* @since 1.4534*/535void setNull (String parameterName, int sqlType, String typeName)536throws SQLException;537538/**539* Sets the designated parameter in this {@code RowSet} object's command540* to the given Java {@code boolean} value. The driver converts this to541* an SQL {@code BIT} value before sending it to the database.542*543* @param parameterIndex the first parameter is 1, the second is 2, ...544* @param x the parameter value545* @throws SQLException if a database access error occurs546*/547void setBoolean(int parameterIndex, boolean x) throws SQLException;548549/**550* Sets the designated parameter to the given Java {@code boolean} value.551* The driver converts this552* to an SQL {@code BIT} or {@code BOOLEAN} value when it sends it to the database.553*554* @param parameterName the name of the parameter555* @param x the parameter value556* @throws SQLException if a database access error occurs or557* this method is called on a closed {@code CallableStatement}558* @see #getBoolean559* @throws SQLFeatureNotSupportedException if the JDBC driver does not support560* this method561* @since 1.4562*/563void setBoolean(String parameterName, boolean x) throws SQLException;564565/**566* Sets the designated parameter in this {@code RowSet} object's command567* to the given Java {@code byte} value. The driver converts this to568* an SQL {@code TINYINT} value before sending it to the database.569*570* @param parameterIndex the first parameter is 1, the second is 2, ...571* @param x the parameter value572* @throws SQLException if a database access error occurs573*/574void setByte(int parameterIndex, byte x) throws SQLException;575576/**577* Sets the designated parameter to the given Java {@code byte} value.578* The driver converts this579* to an SQL {@code TINYINT} value when it sends it to the database.580*581* @param parameterName the name of the parameter582* @param x the parameter value583* @throws SQLException if a database access error occurs or584* this method is called on a closed {@code CallableStatement}585* @throws SQLFeatureNotSupportedException if the JDBC driver does not support586* this method587* @see #getByte588* @since 1.4589*/590void setByte(String parameterName, byte x) throws SQLException;591592/**593* Sets the designated parameter in this {@code RowSet} object's command594* to the given Java {@code short} value. The driver converts this to595* an SQL {@code SMALLINT} value before sending it to the database.596*597* @param parameterIndex the first parameter is 1, the second is 2, ...598* @param x the parameter value599* @throws SQLException if a database access error occurs600*/601void setShort(int parameterIndex, short x) throws SQLException;602603/**604* Sets the designated parameter to the given Java {@code short} value.605* The driver converts this606* to an SQL {@code SMALLINT} value when it sends it to the database.607*608* @param parameterName the name of the parameter609* @param x the parameter value610* @throws SQLException if a database access error occurs or611* this method is called on a closed {@code CallableStatement}612* @throws SQLFeatureNotSupportedException if the JDBC driver does not support613* this method614* @see #getShort615* @since 1.4616*/617void setShort(String parameterName, short x) throws SQLException;618619/**620* Sets the designated parameter in this {@code RowSet} object's command621* to the given Java {@code int} value. The driver converts this to622* an SQL {@code INTEGER} value before sending it to the database.623*624* @param parameterIndex the first parameter is 1, the second is 2, ...625* @param x the parameter value626* @throws SQLException if a database access error occurs627*/628void setInt(int parameterIndex, int x) throws SQLException;629630/**631* Sets the designated parameter to the given Java {@code int} value.632* The driver converts this633* to an SQL {@code INTEGER} value when it sends it to the database.634*635* @param parameterName the name of the parameter636* @param x the parameter value637* @throws SQLException if a database access error occurs or638* this method is called on a closed {@code CallableStatement}639* @throws SQLFeatureNotSupportedException if the JDBC driver does not support640* this method641* @see #getInt642* @since 1.4643*/644void setInt(String parameterName, int x) throws SQLException;645646/**647* Sets the designated parameter in this {@code RowSet} object's command648* to the given Java {@code long} value. The driver converts this to649* an SQL {@code BIGINT} value before sending it to the database.650*651* @param parameterIndex the first parameter is 1, the second is 2, ...652* @param x the parameter value653* @throws SQLException if a database access error occurs654*/655void setLong(int parameterIndex, long x) throws SQLException;656657/**658* Sets the designated parameter to the given Java {@code long} value.659* The driver converts this660* to an SQL {@code BIGINT} value when it sends it to the database.661*662* @param parameterName the name of the parameter663* @param x the parameter value664* @throws SQLException if a database access error occurs or665* this method is called on a closed {@code CallableStatement}666* @throws SQLFeatureNotSupportedException if the JDBC driver does not support667* this method668* @see #getLong669* @since 1.4670*/671void setLong(String parameterName, long x) throws SQLException;672673/**674* Sets the designated parameter in this {@code RowSet} object's command675* to the given Java {@code float} value. The driver converts this to676* an SQL {@code REAL} value before sending it to the database.677*678* @param parameterIndex the first parameter is 1, the second is 2, ...679* @param x the parameter value680* @throws SQLException if a database access error occurs681*/682void setFloat(int parameterIndex, float x) throws SQLException;683684/**685* Sets the designated parameter to the given Java {@code float} value.686* The driver converts this687* to an SQL {@code FLOAT} value when it sends it to the database.688*689* @param parameterName the name of the parameter690* @param x the parameter value691* @throws SQLException if a database access error occurs or692* this method is called on a closed {@code CallableStatement}693* @throws SQLFeatureNotSupportedException if the JDBC driver does not support694* this method695* @see #getFloat696* @since 1.4697*/698void setFloat(String parameterName, float x) throws SQLException;699700/**701* Sets the designated parameter in this {@code RowSet} object's command702* to the given Java {@code double} value. The driver converts this to703* an SQL {@code DOUBLE} value before sending it to the database.704*705* @param parameterIndex the first parameter is 1, the second is 2, ...706* @param x the parameter value707* @throws SQLException if a database access error occurs708*/709void setDouble(int parameterIndex, double x) throws SQLException;710711/**712* Sets the designated parameter to the given Java {@code double} value.713* The driver converts this714* to an SQL {@code DOUBLE} value when it sends it to the database.715*716* @param parameterName the name of the parameter717* @param x the parameter value718* @throws SQLException if a database access error occurs or719* this method is called on a closed {@code CallableStatement}720* @throws SQLFeatureNotSupportedException if the JDBC driver does not support721* this method722* @see #getDouble723* @since 1.4724*/725void setDouble(String parameterName, double x) throws SQLException;726727/**728* Sets the designated parameter in this {@code RowSet} object's command729* to the given {@code java.math.BigDecimal} value.730* The driver converts this to731* an SQL {@code NUMERIC} value before sending it to the database.732*733* @param parameterIndex the first parameter is 1, the second is 2, ...734* @param x the parameter value735* @throws SQLException if a database access error occurs736*/737void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException;738739/**740* Sets the designated parameter to the given741* {@code java.math.BigDecimal} value.742* The driver converts this to an SQL {@code NUMERIC} value when743* it sends it to the database.744*745* @param parameterName the name of the parameter746* @param x the parameter value747* @throws SQLException if a database access error occurs or748* this method is called on a closed {@code CallableStatement}749* @throws SQLFeatureNotSupportedException if the JDBC driver does not support750* this method751* @see #getBigDecimal752* @since 1.4753*/754void setBigDecimal(String parameterName, BigDecimal x) throws SQLException;755756/**757* Sets the designated parameter in this {@code RowSet} object's command758* to the given Java {@code String} value. Before sending it to the759* database, the driver converts this to an SQL {@code VARCHAR} or760* {@code LONGVARCHAR} value, depending on the argument's size relative761* to the driver's limits on {@code VARCHAR} values.762*763* @param parameterIndex the first parameter is 1, the second is 2, ...764* @param x the parameter value765* @throws SQLException if a database access error occurs766*/767void setString(int parameterIndex, String x) throws SQLException;768769/**770* Sets the designated parameter to the given Java {@code String} value.771* The driver converts this772* to an SQL {@code VARCHAR} or {@code LONGVARCHAR} value773* (depending on the argument's774* size relative to the driver's limits on {@code VARCHAR} values)775* when it sends it to the database.776*777* @param parameterName the name of the parameter778* @param x the parameter value779* @throws SQLException if a database access error occurs or780* this method is called on a closed {@code CallableStatement}781* @throws SQLFeatureNotSupportedException if the JDBC driver does not support782* this method783* @see #getString784* @since 1.4785*/786void setString(String parameterName, String x) throws SQLException;787788/**789* Sets the designated parameter in this {@code RowSet} object's command790* to the given Java array of {@code byte} values. Before sending it to the791* database, the driver converts this to an SQL {@code VARBINARY} or792* {@code LONGVARBINARY} value, depending on the argument's size relative793* to the driver's limits on {@code VARBINARY} values.794*795* @param parameterIndex the first parameter is 1, the second is 2, ...796* @param x the parameter value797* @throws SQLException if a database access error occurs798*/799void setBytes(int parameterIndex, byte x[]) throws SQLException;800801/**802* Sets the designated parameter to the given Java array of bytes.803* The driver converts this to an SQL {@code VARBINARY} or804* {@code LONGVARBINARY} (depending on the argument's size relative805* to the driver's limits on {@code VARBINARY} values) when it sends806* it to the database.807*808* @param parameterName the name of the parameter809* @param x the parameter value810* @throws SQLException if a database access error occurs or811* this method is called on a closed {@code CallableStatement}812* @throws SQLFeatureNotSupportedException if the JDBC driver does not support813* this method814* @see #getBytes815* @since 1.4816*/817void setBytes(String parameterName, byte x[]) throws SQLException;818819/**820* Sets the designated parameter in this {@code RowSet} object's command821* to the given {@code java.sql.Date} value. The driver converts this to822* an SQL {@code DATE} value before sending it to the database, using the823* default {@code java.util.Calendar} to calculate the date.824*825* @param parameterIndex the first parameter is 1, the second is 2, ...826* @param x the parameter value827* @throws SQLException if a database access error occurs828*/829void setDate(int parameterIndex, java.sql.Date x) throws SQLException;830831/**832* Sets the designated parameter in this {@code RowSet} object's command833* to the given {@code java.sql.Time} value. The driver converts this to834* an SQL {@code TIME} value before sending it to the database, using the835* default {@code java.util.Calendar} to calculate it.836*837* @param parameterIndex the first parameter is 1, the second is 2, ...838* @param x the parameter value839* @throws SQLException if a database access error occurs840*/841void setTime(int parameterIndex, java.sql.Time x) throws SQLException;842843/**844* Sets the designated parameter in this {@code RowSet} object's command845* to the given {@code java.sql.Timestamp} value. The driver converts this to846* an SQL {@code TIMESTAMP} value before sending it to the database, using the847* default {@code java.util.Calendar} to calculate it.848*849* @param parameterIndex the first parameter is 1, the second is 2, ...850* @param x the parameter value851* @throws SQLException if a database access error occurs852*/853void setTimestamp(int parameterIndex, java.sql.Timestamp x)854throws SQLException;855856/**857* Sets the designated parameter to the given {@code java.sql.Timestamp} value.858* The driver859* converts this to an SQL {@code TIMESTAMP} value when it sends it to the860* database.861*862* @param parameterName the name of the parameter863* @param x the parameter value864* @throws SQLException if a database access error occurs or865* this method is called on a closed {@code CallableStatement}866* @throws SQLFeatureNotSupportedException if the JDBC driver does not support867* this method868* @see #getTimestamp869* @since 1.4870*/871void setTimestamp(String parameterName, java.sql.Timestamp x)872throws SQLException;873874/**875* Sets the designated parameter in this {@code RowSet} object's command876* to the given {@code java.io.InputStream} value.877* It may be more practical to send a very large ASCII value via a878* {@code java.io.InputStream} rather than as a {@code LONGVARCHAR}879* parameter. The driver will read the data from the stream880* as needed until it reaches end-of-file.881*882* <P><B>Note:</B> This stream object can either be a standard883* Java stream object or your own subclass that implements the884* standard interface.885*886* @param parameterIndex the first parameter is 1, the second is 2, ...887* @param x the Java input stream that contains the ASCII parameter value888* @param length the number of bytes in the stream889* @throws SQLException if a database access error occurs890*/891void setAsciiStream(int parameterIndex, java.io.InputStream x, int length)892throws SQLException;893894/**895* Sets the designated parameter to the given input stream, which will have896* the specified number of bytes.897* When a very large ASCII value is input to a {@code LONGVARCHAR}898* parameter, it may be more practical to send it via a899* {@code java.io.InputStream}. Data will be read from the stream900* as needed until end-of-file is reached. The JDBC driver will901* do any necessary conversion from ASCII to the database char format.902*903* <P><B>Note:</B> This stream object can either be a standard904* Java stream object or your own subclass that implements the905* standard interface.906*907* @param parameterName the name of the parameter908* @param x the Java input stream that contains the ASCII parameter value909* @param length the number of bytes in the stream910* @throws SQLException if a database access error occurs or911* this method is called on a closed {@code CallableStatement}912* @throws SQLFeatureNotSupportedException if the JDBC driver does not support913* this method914* @since 1.4915*/916void setAsciiStream(String parameterName, java.io.InputStream x, int length)917throws SQLException;918919/**920* Sets the designated parameter in this {@code RowSet} object's command921* to the given {@code java.io.InputStream} value.922* It may be more practical to send a very large binary value via a923* {@code java.io.InputStream} rather than as a {@code LONGVARBINARY}924* parameter. The driver will read the data from the stream925* as needed until it reaches end-of-file.926*927* <P><B>Note:</B> This stream object can either be a standard928* Java stream object or your own subclass that implements the929* standard interface.930*931* @param parameterIndex the first parameter is 1, the second is 2, ...932* @param x the java input stream which contains the binary parameter value933* @param length the number of bytes in the stream934* @throws SQLException if a database access error occurs935*/936void setBinaryStream(int parameterIndex, java.io.InputStream x,937int length) throws SQLException;938939/**940* Sets the designated parameter to the given input stream, which will have941* the specified number of bytes.942* When a very large binary value is input to a {@code LONGVARBINARY}943* parameter, it may be more practical to send it via a944* {@code java.io.InputStream} object. The data will be read from the stream945* as needed until end-of-file is reached.946*947* <P><B>Note:</B> This stream object can either be a standard948* Java stream object or your own subclass that implements the949* standard interface.950*951* @param parameterName the name of the parameter952* @param x the java input stream which contains the binary parameter value953* @param length the number of bytes in the stream954* @throws SQLException if a database access error occurs or955* this method is called on a closed {@code CallableStatement}956* @throws SQLFeatureNotSupportedException if the JDBC driver does not support957* this method958* @since 1.4959*/960void setBinaryStream(String parameterName, java.io.InputStream x,961int length) throws SQLException;962963/**964* Sets the designated parameter in this {@code RowSet} object's command965* to the given {@code java.io.Reader} value.966* It may be more practical to send a very large UNICODE value via a967* {@code java.io.Reader} rather than as a {@code LONGVARCHAR}968* parameter. The driver will read the data from the stream969* as needed until it reaches end-of-file.970*971* <P><B>Note:</B> This stream object can either be a standard972* Java stream object or your own subclass that implements the973* standard interface.974*975* @param parameterIndex the first parameter is 1, the second is 2, ...976* @param reader the {@code Reader} object that contains the UNICODE data977* to be set978* @param length the number of characters in the stream979* @throws SQLException if a database access error occurs980*/981void setCharacterStream(int parameterIndex,982Reader reader,983int length) throws SQLException;984985/**986* Sets the designated parameter to the given {@code Reader}987* object, which is the given number of characters long.988* When a very large UNICODE value is input to a {@code LONGVARCHAR}989* parameter, it may be more practical to send it via a990* {@code java.io.Reader} object. The data will be read from the stream991* as needed until end-of-file is reached. The JDBC driver will992* do any necessary conversion from UNICODE to the database char format.993*994* <P><B>Note:</B> This stream object can either be a standard995* Java stream object or your own subclass that implements the996* standard interface.997*998* @param parameterName the name of the parameter999* @param reader the {@code java.io.Reader} object that1000* contains the UNICODE data used as the designated parameter1001* @param length the number of characters in the stream1002* @throws SQLException if a database access error occurs or1003* this method is called on a closed {@code CallableStatement}1004* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1005* this method1006* @since 1.41007*/1008void setCharacterStream(String parameterName,1009java.io.Reader reader,1010int length) throws SQLException;10111012/**1013* Sets the designated parameter in this {@code RowSet} object's command1014* to the given input stream.1015* When a very large ASCII value is input to a {@code LONGVARCHAR}1016* parameter, it may be more practical to send it via a1017* {@code java.io.InputStream}. Data will be read from the stream1018* as needed until end-of-file is reached. The JDBC driver will1019* do any necessary conversion from ASCII to the database char format.1020*1021* <P><B>Note:</B> This stream object can either be a standard1022* Java stream object or your own subclass that implements the1023* standard interface.1024* <P><B>Note:</B> Consult your JDBC driver documentation to determine if1025* it might be more efficient to use a version of1026* {@code setAsciiStream} which takes a length parameter.1027*1028* @param parameterIndex the first parameter is 1, the second is 2, ...1029* @param x the Java input stream that contains the ASCII parameter value1030* @throws SQLException if a database access error occurs or1031* this method is called on a closed {@code PreparedStatement}1032* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method1033* @since 1.61034*/1035void setAsciiStream(int parameterIndex, java.io.InputStream x)1036throws SQLException;10371038/**1039* Sets the designated parameter to the given input stream.1040* When a very large ASCII value is input to a {@code LONGVARCHAR}1041* parameter, it may be more practical to send it via a1042* {@code java.io.InputStream}. Data will be read from the stream1043* as needed until end-of-file is reached. The JDBC driver will1044* do any necessary conversion from ASCII to the database char format.1045*1046* <P><B>Note:</B> This stream object can either be a standard1047* Java stream object or your own subclass that implements the1048* standard interface.1049* <P><B>Note:</B> Consult your JDBC driver documentation to determine if1050* it might be more efficient to use a version of1051* {@code setAsciiStream} which takes a length parameter.1052*1053* @param parameterName the name of the parameter1054* @param x the Java input stream that contains the ASCII parameter value1055* @throws SQLException if a database access error occurs or1056* this method is called on a closed {@code CallableStatement}1057* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method1058* @since 1.61059*/1060void setAsciiStream(String parameterName, java.io.InputStream x)1061throws SQLException;10621063/**1064* Sets the designated parameter in this {@code RowSet} object's command1065* to the given input stream.1066* When a very large binary value is input to a {@code LONGVARBINARY}1067* parameter, it may be more practical to send it via a1068* {@code java.io.InputStream} object. The data will be read from the1069* stream as needed until end-of-file is reached.1070*1071* <P><B>Note:</B> This stream object can either be a standard1072* Java stream object or your own subclass that implements the1073* standard interface.1074* <P><B>Note:</B> Consult your JDBC driver documentation to determine if1075* it might be more efficient to use a version of1076* {@code setBinaryStream} which takes a length parameter.1077*1078* @param parameterIndex the first parameter is 1, the second is 2, ...1079* @param x the java input stream which contains the binary parameter value1080* @throws SQLException if a database access error occurs or1081* this method is called on a closed {@code PreparedStatement}1082* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method1083* @since 1.61084*/1085void setBinaryStream(int parameterIndex, java.io.InputStream x)1086throws SQLException;10871088/**1089* Sets the designated parameter to the given input stream.1090* When a very large binary value is input to a {@code LONGVARBINARY}1091* parameter, it may be more practical to send it via a1092* {@code java.io.InputStream} object. The data will be read from the1093* stream as needed until end-of-file is reached.1094*1095* <P><B>Note:</B> This stream object can either be a standard1096* Java stream object or your own subclass that implements the1097* standard interface.1098* <P><B>Note:</B> Consult your JDBC driver documentation to determine if1099* it might be more efficient to use a version of1100* {@code setBinaryStream} which takes a length parameter.1101*1102* @param parameterName the name of the parameter1103* @param x the java input stream which contains the binary parameter value1104* @throws SQLException if a database access error occurs or1105* this method is called on a closed {@code CallableStatement}1106* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method1107* @since 1.61108*/1109void setBinaryStream(String parameterName, java.io.InputStream x)1110throws SQLException;11111112/**1113* Sets the designated parameter in this {@code RowSet} object's command1114* to the given {@code Reader}1115* object.1116* When a very large UNICODE value is input to a {@code LONGVARCHAR}1117* parameter, it may be more practical to send it via a1118* {@code java.io.Reader} object. The data will be read from the stream1119* as needed until end-of-file is reached. The JDBC driver will1120* do any necessary conversion from UNICODE to the database char format.1121*1122* <P><B>Note:</B> This stream object can either be a standard1123* Java stream object or your own subclass that implements the1124* standard interface.1125* <P><B>Note:</B> Consult your JDBC driver documentation to determine if1126* it might be more efficient to use a version of1127* {@code setCharacterStream} which takes a length parameter.1128*1129* @param parameterIndex the first parameter is 1, the second is 2, ...1130* @param reader the {@code java.io.Reader} object that contains the1131* Unicode data1132* @throws SQLException if a database access error occurs or1133* this method is called on a closed {@code PreparedStatement}1134* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method1135* @since 1.61136*/1137void setCharacterStream(int parameterIndex,1138java.io.Reader reader) throws SQLException;11391140/**1141* Sets the designated parameter to the given {@code Reader}1142* object.1143* When a very large UNICODE value is input to a {@code LONGVARCHAR}1144* parameter, it may be more practical to send it via a1145* {@code java.io.Reader} object. The data will be read from the stream1146* as needed until end-of-file is reached. The JDBC driver will1147* do any necessary conversion from UNICODE to the database char format.1148*1149* <P><B>Note:</B> This stream object can either be a standard1150* Java stream object or your own subclass that implements the1151* standard interface.1152* <P><B>Note:</B> Consult your JDBC driver documentation to determine if1153* it might be more efficient to use a version of1154* {@code setCharacterStream} which takes a length parameter.1155*1156* @param parameterName the name of the parameter1157* @param reader the {@code java.io.Reader} object that contains the1158* Unicode data1159* @throws SQLException if a database access error occurs or1160* this method is called on a closed {@code CallableStatement}1161* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method1162* @since 1.61163*/1164void setCharacterStream(String parameterName,1165java.io.Reader reader) throws SQLException;11661167/**1168* Sets the designated parameter in this {@code RowSet} object's command1169* to a {@code Reader} object. The1170* {@code Reader} reads the data till end-of-file is reached. The1171* driver does the necessary conversion from Java character format to1172* the national character set in the database.11731174* <P><B>Note:</B> This stream object can either be a standard1175* Java stream object or your own subclass that implements the1176* standard interface.1177* <P><B>Note:</B> Consult your JDBC driver documentation to determine if1178* it might be more efficient to use a version of1179* {@code setNCharacterStream} which takes a length parameter.1180*1181* @param parameterIndex of the first parameter is 1, the second is 2, ...1182* @param value the parameter value1183* @throws SQLException if the driver does not support national1184* character sets; if the driver can detect that a data conversion1185* error could occur ; if a database access error occurs; or1186* this method is called on a closed {@code PreparedStatement}1187* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method1188* @since 1.61189*/1190void setNCharacterStream(int parameterIndex, Reader value) throws SQLException;1191119211931194/**1195* Sets the designated parameter in this {@code RowSet} object's command1196* with the given Java {@code Object}. For integral values, the1197* {@code java.lang} equivalent objects should be used (for example,1198* an instance of the class {@code Integer} for an {@code int}).1199*1200* If the second argument is an {@code InputStream} then the stream must contain1201* the number of bytes specified by scaleOrLength. If the second argument is a1202* {@code Reader} then the {@code Reader} must contain the number of characters specified1203* by scaleOrLength. If these conditions are not true the driver will generate a1204* {@code SQLException} when the prepared statement is executed.1205*1206* <p>The given Java object will be converted to the targetSqlType1207* before being sent to the database.1208* <P>1209* If the object is of a class implementing {@code SQLData},1210* the rowset should call the method {@code SQLData.writeSQL}1211* to write the object to an {@code SQLOutput} data stream.1212* If, on the other hand, the object is of a class implementing1213* {@code Ref}, {@code Blob}, {@code Clob}, {@code NClob},1214* {@code Struct}, {@code java.net.URL},1215* or {@code Array}, the driver should pass it to the database as a1216* value of the corresponding SQL type.1217*1218*1219* <p>Note that this method may be used to pass database-specific1220* abstract data types.1221*1222* @param parameterIndex the first parameter is 1, the second is 2, ...1223* @param x the object containing the input parameter value1224* @param targetSqlType the SQL type (as defined in {@code java.sql.Types})1225* to be sent to the database. The scale argument may further qualify this1226* type.1227* @param scaleOrLength for {@code java.sql.Types.DECIMAL}1228* or {@code java.sql.Types.NUMERIC types},1229* this is the number of digits after the decimal point. For1230* Java Object types {@code InputStream} and {@code Reader},1231* this is the length1232* of the data in the stream or {@code Reader}. For all other types,1233* this value will be ignored.1234* @throws SQLException if a database access error occurs1235* @see java.sql.Types1236*/1237void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength)1238throws SQLException;12391240/**1241* Sets the value of the designated parameter with the given object. The second1242* argument must be an object type; for integral values, the1243* {@code java.lang} equivalent objects should be used.1244*1245* <p>The given Java object will be converted to the given targetSqlType1246* before being sent to the database.1247*1248* If the object has a custom mapping (is of a class implementing the1249* interface {@code SQLData}),1250* the JDBC driver should call the method {@code SQLData.writeSQL} to write it1251* to the SQL data stream.1252* If, on the other hand, the object is of a class implementing1253* {@code Ref}, {@code Blob}, {@code Clob}, {@code NClob},1254* {@code Struct}, {@code java.net.URL},1255* or {@code Array}, the driver should pass it to the database as a1256* value of the corresponding SQL type.1257* <P>1258* Note that this method may be used to pass database-1259* specific abstract data types.1260*1261* @param parameterName the name of the parameter1262* @param x the object containing the input parameter value1263* @param targetSqlType the SQL type (as defined in java.sql.Types) to be1264* sent to the database. The scale argument may further qualify this type.1265* @param scale for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types,1266* this is the number of digits after the decimal point. For all other1267* types, this value will be ignored.1268* @throws SQLException if a database access error occurs or1269* this method is called on a closed {@code CallableStatement}1270* @throws SQLFeatureNotSupportedException if {@code targetSqlType} is1271* a {@code ARRAY}, {@code BLOB}, {@code CLOB},1272* {@code DATALINK}, {@code JAVA_OBJECT}, {@code NCHAR},1273* {@code NCLOB}, {@code NVARCHAR}, {@code LONGNVARCHAR},1274* {@code REF}, {@code ROWID}, {@code SQLXML}1275* or {@code STRUCT} data type and the JDBC driver does not support1276* this data type1277* @see Types1278* @see #getObject1279* @since 1.41280*/1281void setObject(String parameterName, Object x, int targetSqlType, int scale)1282throws SQLException;12831284/**1285* Sets the designated parameter in this {@code RowSet} object's command1286* with a Java {@code Object}. For integral values, the1287* {@code java.lang} equivalent objects should be used.1288* This method is like {@code setObject} above, but the scale used is the scale1289* of the second parameter. Scalar values have a scale of zero. Literal1290* values have the scale present in the literal.1291* <P>1292* Even though it is supported, it is not recommended that this method1293* be called with floating point input values.1294*1295* @param parameterIndex the first parameter is 1, the second is 2, ...1296* @param x the object containing the input parameter value1297* @param targetSqlType the SQL type (as defined in {@code java.sql.Types})1298* to be sent to the database1299* @throws SQLException if a database access error occurs1300*/1301void setObject(int parameterIndex, Object x,1302int targetSqlType) throws SQLException;13031304/**1305* Sets the value of the designated parameter with the given object.1306* This method is like the method {@code setObject}1307* above, except that it assumes a scale of zero.1308*1309* @param parameterName the name of the parameter1310* @param x the object containing the input parameter value1311* @param targetSqlType the SQL type (as defined in java.sql.Types) to be1312* sent to the database1313* @throws SQLException if a database access error occurs or1314* this method is called on a closed {@code CallableStatement}1315* @throws SQLFeatureNotSupportedException if {@code targetSqlType} is1316* a {@code ARRAY}, {@code BLOB}, {@code CLOB},1317* {@code DATALINK}, {@code JAVA_OBJECT}, {@code NCHAR},1318* {@code NCLOB}, {@code NVARCHAR}, {@code LONGNVARCHAR},1319* {@code REF}, {@code ROWID}, {@code SQLXML}1320* or {@code STRUCT} data type and the JDBC driver does not support1321* this data type1322* @see #getObject1323* @since 1.41324*/1325void setObject(String parameterName, Object x, int targetSqlType)1326throws SQLException;13271328/**1329* Sets the value of the designated parameter with the given object.1330* The second parameter must be of type {@code Object}; therefore, the1331* {@code java.lang} equivalent objects should be used for built-in types.1332*1333* <p>The JDBC specification specifies a standard mapping from1334* Java {@code Object} types to SQL types. The given argument1335* will be converted to the corresponding SQL type before being1336* sent to the database.1337*1338* <p>Note that this method may be used to pass database-1339* specific abstract data types, by using a driver-specific Java1340* type.1341*1342* If the object is of a class implementing the interface {@code SQLData},1343* the JDBC driver should call the method {@code SQLData.writeSQL}1344* to write it to the SQL data stream.1345* If, on the other hand, the object is of a class implementing1346* {@code Ref}, {@code Blob}, {@code Clob}, {@code NClob},1347* {@code Struct}, {@code java.net.URL},1348* or {@code Array}, the driver should pass it to the database as a1349* value of the corresponding SQL type.1350* <P>1351* This method throws an exception if there is an ambiguity, for example, if the1352* object is of a class implementing more than one of the interfaces named above.1353*1354* @param parameterName the name of the parameter1355* @param x the object containing the input parameter value1356* @throws SQLException if a database access error occurs,1357* this method is called on a closed {@code CallableStatement} or if the given1358* {@code Object} parameter is ambiguous1359* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1360* this method1361* @see #getObject1362* @since 1.41363*/1364void setObject(String parameterName, Object x) throws SQLException;13651366/**1367* Sets the designated parameter in this {@code RowSet} object's command1368* with a Java {@code Object}. For integral values, the1369* {@code java.lang} equivalent objects should be used.1370*1371* <p>The JDBC specification provides a standard mapping from1372* Java Object types to SQL types. The driver will convert the1373* given Java object to its standard SQL mapping before sending it1374* to the database.1375*1376* <p>Note that this method may be used to pass database-specific1377* abstract data types by using a driver-specific Java type.1378*1379* If the object is of a class implementing {@code SQLData},1380* the rowset should call the method {@code SQLData.writeSQL}1381* to write the object to an {@code SQLOutput} data stream.1382* If, on the other hand, the object is of a class implementing1383* {@code Ref}, {@code Blob}, {@code Clob}, {@code NClob},1384* {@code Struct}, {@code java.net.URL},1385* or {@code Array}, the driver should pass it to the database as a1386* value of the corresponding SQL type.1387*1388* <P>1389* An exception is thrown if there is an ambiguity, for example, if the1390* object is of a class implementing more than one of these interfaces.1391*1392* @param parameterIndex The first parameter is 1, the second is 2, ...1393* @param x The object containing the input parameter value1394* @throws SQLException if a database access error occurs1395*/1396void setObject(int parameterIndex, Object x) throws SQLException;139713981399/**1400* Sets the designated parameter in this {@code RowSet} object's command1401* with the given {@code Ref} value. The driver will convert this1402* to the appropriate {@code REF(<structured-type>)} value.1403*1404* @param i the first parameter is 1, the second is 2, ...1405* @param x an object representing data of an SQL {@code REF} type1406* @throws SQLException if a database access error occurs1407*/1408void setRef (int i, Ref x) throws SQLException;14091410/**1411* Sets the designated parameter in this {@code RowSet} object's command1412* with the given {@code Blob} value. The driver will convert this1413* to the {@code BLOB} value that the {@code Blob} object1414* represents before sending it to the database.1415*1416* @param i the first parameter is 1, the second is 2, ...1417* @param x an object representing a BLOB1418* @throws SQLException if a database access error occurs1419*/1420void setBlob (int i, Blob x) throws SQLException;14211422/**1423* Sets the designated parameter to a {@code InputStream} object.1424* The {@code InputStream} must contain the number1425* of characters specified by length otherwise a {@code SQLException} will be1426* generated when the {@code PreparedStatement} is executed.1427* This method differs from the {@code setBinaryStream (int, InputStream, int)}1428* method because it informs the driver that the parameter value should be1429* sent to the server as a {@code BLOB}. When the {@code setBinaryStream} method is used,1430* the driver may have to do extra work to determine whether the parameter1431* data should be sent to the server as a {@code LONGVARBINARY} or a {@code BLOB}1432* @param parameterIndex index of the first parameter is 1,1433* the second is 2, ...1434* @param inputStream An object that contains the data to set the parameter1435* value to.1436* @param length the number of bytes in the parameter data.1437* @throws SQLException if a database access error occurs,1438* this method is called on a closed {@code PreparedStatement},1439* if parameterIndex does not correspond1440* to a parameter marker in the SQL statement, if the length specified1441* is less than zero or if the number of bytes in the {@code InputStream} does not match1442* the specified length.1443* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method1444*1445* @since 1.61446*/1447void setBlob(int parameterIndex, InputStream inputStream, long length)1448throws SQLException;14491450/**1451* Sets the designated parameter to a {@code InputStream} object.1452* This method differs from the {@code setBinaryStream (int, InputStream)}1453* method because it informs the driver that the parameter value should be1454* sent to the server as a {@code BLOB}. When the {@code setBinaryStream} method is used,1455* the driver may have to do extra work to determine whether the parameter1456* data should be sent to the server as a {@code LONGVARBINARY} or a {@code BLOB}1457*1458* <P><B>Note:</B> Consult your JDBC driver documentation to determine if1459* it might be more efficient to use a version of1460* {@code setBlob} which takes a length parameter.1461*1462* @param parameterIndex index of the first parameter is 1,1463* the second is 2, ...1464* @param inputStream An object that contains the data to set the parameter1465* value to.1466* @throws SQLException if a database access error occurs,1467* this method is called on a closed {@code PreparedStatement} or1468* if parameterIndex does not correspond1469* to a parameter marker in the SQL statement,1470* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method1471*1472* @since 1.61473*/1474void setBlob(int parameterIndex, InputStream inputStream)1475throws SQLException;14761477/**1478* Sets the designated parameter to a {@code InputStream} object.1479* The {@code InputStream} must contain the number1480* of characters specified by length, otherwise a {@code SQLException} will be1481* generated when the {@code CallableStatement} is executed.1482* This method differs from the {@code setBinaryStream (int, InputStream, int)}1483* method because it informs the driver that the parameter value should be1484* sent to the server as a {@code BLOB}. When the {@code setBinaryStream} method is used,1485* the driver may have to do extra work to determine whether the parameter1486* data should be sent to the server as a {@code LONGVARBINARY} or a {@code BLOB}1487*1488* @param parameterName the name of the parameter to be set1489* the second is 2, ...1490*1491* @param inputStream An object that contains the data to set the parameter1492* value to.1493* @param length the number of bytes in the parameter data.1494* @throws SQLException if parameterIndex does not correspond1495* to a parameter marker in the SQL statement, or if the length specified1496* is less than zero; if the number of bytes in the {@code InputStream} does not match1497* the specified length; if a database access error occurs or1498* this method is called on a closed {@code CallableStatement}1499* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1500* this method1501*1502* @since 1.61503*/1504void setBlob(String parameterName, InputStream inputStream, long length)1505throws SQLException;15061507/**1508* Sets the designated parameter to the given {@code java.sql.Blob} object.1509* The driver converts this to an SQL {@code BLOB} value when it1510* sends it to the database.1511*1512* @param parameterName the name of the parameter1513* @param x a {@code Blob} object that maps an SQL {@code BLOB} value1514* @throws SQLException if a database access error occurs or1515* this method is called on a closed {@code CallableStatement}1516* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1517* this method1518* @since 1.61519*/1520void setBlob (String parameterName, Blob x) throws SQLException;15211522/**1523* Sets the designated parameter to a {@code InputStream} object.1524* This method differs from the {@code setBinaryStream (int, InputStream)}1525* method because it informs the driver that the parameter value should be1526* sent to the server as a {@code BLOB}. When the {@code setBinaryStream} method is used,1527* the driver may have to do extra work to determine whether the parameter1528* data should be send to the server as a {@code LONGVARBINARY} or a {@code BLOB}1529*1530* <P><B>Note:</B> Consult your JDBC driver documentation to determine if1531* it might be more efficient to use a version of1532* {@code setBlob} which takes a length parameter.1533*1534* @param parameterName the name of the parameter1535* @param inputStream An object that contains the data to set the parameter1536* value to.1537* @throws SQLException if a database access error occurs or1538* this method is called on a closed {@code CallableStatement}1539* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method1540*1541* @since 1.61542*/1543void setBlob(String parameterName, InputStream inputStream)1544throws SQLException;15451546/**1547* Sets the designated parameter in this {@code RowSet} object's command1548* with the given {@code Clob} value. The driver will convert this1549* to the {@code CLOB} value that the {@code Clob} object1550* represents before sending it to the database.1551*1552* @param i the first parameter is 1, the second is 2, ...1553* @param x an object representing a CLOB1554* @throws SQLException if a database access error occurs1555*/1556void setClob (int i, Clob x) throws SQLException;15571558/**1559* Sets the designated parameter to a {@code Reader} object.1560* The {@code Reader} must contain the number1561* of characters specified by length otherwise a {@code SQLException} will be1562* generated when the {@code PreparedStatement} is executed.1563*This method differs from the {@code setCharacterStream (int, Reader, int)} method1564* because it informs the driver that the parameter value should be sent to1565* the server as a {@code CLOB}. When the {@code setCharacterStream} method is used, the1566* driver may have to do extra work to determine whether the parameter1567* data should be sent to the server as a {@code LONGVARCHAR} or a {@code CLOB}1568* @param parameterIndex index of the first parameter is 1, the second is 2, ...1569* @param reader An object that contains the data to set the parameter value to.1570* @param length the number of characters in the parameter data.1571* @throws SQLException if a database access error occurs, this method is called on1572* a closed {@code PreparedStatement}, if parameterIndex does not correspond to a parameter1573* marker in the SQL statement, or if the length specified is less than zero.1574*1575* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method1576* @since 1.61577*/1578void setClob(int parameterIndex, Reader reader, long length)1579throws SQLException;15801581/**1582* Sets the designated parameter to a {@code Reader} object.1583* This method differs from the {@code setCharacterStream (int, Reader)} method1584* because it informs the driver that the parameter value should be sent to1585* the server as a {@code CLOB}. When the {@code setCharacterStream} method is used, the1586* driver may have to do extra work to determine whether the parameter1587* data should be sent to the server as a {@code LONGVARCHAR} or a {@code CLOB}1588*1589* <P><B>Note:</B> Consult your JDBC driver documentation to determine if1590* it might be more efficient to use a version of1591* {@code setClob} which takes a length parameter.1592*1593* @param parameterIndex index of the first parameter is 1, the second is 2, ...1594* @param reader An object that contains the data to set the parameter value to.1595* @throws SQLException if a database access error occurs, this method is called on1596* a closed {@code PreparedStatement}or if parameterIndex does not correspond to a parameter1597* marker in the SQL statement1598*1599* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method1600* @since 1.61601*/1602void setClob(int parameterIndex, Reader reader)1603throws SQLException;16041605/**1606* Sets the designated parameter to a {@code Reader} object. The1607* {@code Reader} must contain the number1608* of characters specified by length otherwise a {@code SQLException} will be1609* generated when the {@code CallableStatement} is executed.1610* This method differs from the {@code setCharacterStream (int, Reader, int)} method1611* because it informs the driver that the parameter value should be sent to1612* the server as a {@code CLOB}. When the {@code setCharacterStream} method is used, the1613* driver may have to do extra work to determine whether the parameter1614* data should be send to the server as a {@code LONGVARCHAR} or a {@code CLOB}1615* @param parameterName the name of the parameter to be set1616* @param reader An object that contains the data to set the parameter value to.1617* @param length the number of characters in the parameter data.1618* @throws SQLException if parameterIndex does not correspond to a parameter1619* marker in the SQL statement; if the length specified is less than zero;1620* a database access error occurs or1621* this method is called on a closed {@code CallableStatement}1622* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1623* this method1624*1625* @since 1.61626*/1627void setClob(String parameterName, Reader reader, long length)1628throws SQLException;16291630/**1631* Sets the designated parameter to the given {@code java.sql.Clob} object.1632* The driver converts this to an SQL {@code CLOB} value when it1633* sends it to the database.1634*1635* @param parameterName the name of the parameter1636* @param x a {@code Clob} object that maps an SQL {@code CLOB} value1637* @throws SQLException if a database access error occurs or1638* this method is called on a closed {@code CallableStatement}1639* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1640* this method1641* @since 1.61642*/1643void setClob (String parameterName, Clob x) throws SQLException;16441645/**1646* Sets the designated parameter to a {@code Reader} object.1647* This method differs from the {@code setCharacterStream (int, Reader)} method1648* because it informs the driver that the parameter value should be sent to1649* the server as a {@code CLOB}. When the {@code setCharacterStream} method is used, the1650* driver may have to do extra work to determine whether the parameter1651* data should be send to the server as a {@code LONGVARCHAR} or a {@code CLOB}1652*1653* <P><B>Note:</B> Consult your JDBC driver documentation to determine if1654* it might be more efficient to use a version of1655* {@code setClob} which takes a length parameter.1656*1657* @param parameterName the name of the parameter1658* @param reader An object that contains the data to set the parameter value to.1659* @throws SQLException if a database access error occurs or this method is called on1660* a closed {@code CallableStatement}1661*1662* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method1663* @since 1.61664*/1665void setClob(String parameterName, Reader reader)1666throws SQLException;16671668/**1669* Sets the designated parameter in this {@code RowSet} object's command1670* with the given {@code Array} value. The driver will convert this1671* to the {@code ARRAY} value that the {@code Array} object1672* represents before sending it to the database.1673*1674* @param i the first parameter is 1, the second is 2, ...1675* @param x an object representing an SQL array1676* @throws SQLException if a database access error occurs1677*/1678void setArray (int i, Array x) throws SQLException;16791680/**1681* Sets the designated parameter in this {@code RowSet} object's command1682* with the given {@code java.sql.Date} value. The driver will convert this1683* to an SQL {@code DATE} value, using the given {@code java.util.Calendar}1684* object to calculate the date.1685*1686* @param parameterIndex the first parameter is 1, the second is 2, ...1687* @param x the parameter value1688* @param cal the {@code java.util.Calendar} object to use for calculating the date1689* @throws SQLException if a database access error occurs1690*/1691void setDate(int parameterIndex, java.sql.Date x, Calendar cal)1692throws SQLException;16931694/**1695* Sets the designated parameter to the given {@code java.sql.Date} value1696* using the default time zone of the virtual machine that is running1697* the application.1698* The driver converts this1699* to an SQL {@code DATE} value when it sends it to the database.1700*1701* @param parameterName the name of the parameter1702* @param x the parameter value1703* @throws SQLException if a database access error occurs or1704* this method is called on a closed {@code CallableStatement}1705* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1706* this method1707* @see #getDate1708* @since 1.41709*/1710void setDate(String parameterName, java.sql.Date x)1711throws SQLException;17121713/**1714* Sets the designated parameter to the given {@code java.sql.Date} value,1715* using the given {@code Calendar} object. The driver uses1716* the {@code Calendar} object to construct an SQL {@code DATE} value,1717* which the driver then sends to the database. With a1718* a {@code Calendar} object, the driver can calculate the date1719* taking into account a custom timezone. If no1720* {@code Calendar} object is specified, the driver uses the default1721* timezone, which is that of the virtual machine running the application.1722*1723* @param parameterName the name of the parameter1724* @param x the parameter value1725* @param cal the {@code Calendar} object the driver will use1726* to construct the date1727* @throws SQLException if a database access error occurs or1728* this method is called on a closed {@code CallableStatement}1729* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1730* this method1731* @see #getDate1732* @since 1.41733*/1734void setDate(String parameterName, java.sql.Date x, Calendar cal)1735throws SQLException;17361737/**1738* Sets the designated parameter in this {@code RowSet} object's command1739* with the given {@code java.sql.Time} value. The driver will convert this1740* to an SQL {@code TIME} value, using the given {@code java.util.Calendar}1741* object to calculate it, before sending it to the database.1742*1743* @param parameterIndex the first parameter is 1, the second is 2, ...1744* @param x the parameter value1745* @param cal the {@code java.util.Calendar} object to use for calculating the time1746* @throws SQLException if a database access error occurs1747*/1748void setTime(int parameterIndex, java.sql.Time x, Calendar cal)1749throws SQLException;17501751/**1752* Sets the designated parameter to the given {@code java.sql.Time} value.1753* The driver converts this1754* to an SQL {@code TIME} value when it sends it to the database.1755*1756* @param parameterName the name of the parameter1757* @param x the parameter value1758* @throws SQLException if a database access error occurs or1759* this method is called on a closed {@code CallableStatement}1760* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1761* this method1762* @see #getTime1763* @since 1.41764*/1765void setTime(String parameterName, java.sql.Time x)1766throws SQLException;17671768/**1769* Sets the designated parameter to the given {@code java.sql.Time} value,1770* using the given {@code Calendar} object. The driver uses1771* the {@code Calendar} object to construct an SQL {@code TIME} value,1772* which the driver then sends to the database. With a1773* a {@code Calendar} object, the driver can calculate the time1774* taking into account a custom timezone. If no1775* {@code Calendar} object is specified, the driver uses the default1776* timezone, which is that of the virtual machine running the application.1777*1778* @param parameterName the name of the parameter1779* @param x the parameter value1780* @param cal the {@code Calendar} object the driver will use1781* to construct the time1782* @throws SQLException if a database access error occurs or1783* this method is called on a closed {@code CallableStatement}1784* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1785* this method1786* @see #getTime1787* @since 1.41788*/1789void setTime(String parameterName, java.sql.Time x, Calendar cal)1790throws SQLException;17911792/**1793* Sets the designated parameter in this {@code RowSet} object's command1794* with the given {@code java.sql.Timestamp} value. The driver will1795* convert this to an SQL {@code TIMESTAMP} value, using the given1796* {@code java.util.Calendar} object to calculate it, before sending it to the1797* database.1798*1799* @param parameterIndex the first parameter is 1, the second is 2, ...1800* @param x the parameter value1801* @param cal the {@code java.util.Calendar} object to use for calculating the1802* timestamp1803* @throws SQLException if a database access error occurs1804*/1805void setTimestamp(int parameterIndex, java.sql.Timestamp x, Calendar cal)1806throws SQLException;18071808/**1809* Sets the designated parameter to the given {@code java.sql.Timestamp} value,1810* using the given {@code Calendar} object. The driver uses1811* the {@code Calendar} object to construct an SQL {@code TIMESTAMP} value,1812* which the driver then sends to the database. With a1813* a {@code Calendar} object, the driver can calculate the timestamp1814* taking into account a custom timezone. If no1815* {@code Calendar} object is specified, the driver uses the default1816* timezone, which is that of the virtual machine running the application.1817*1818* @param parameterName the name of the parameter1819* @param x the parameter value1820* @param cal the {@code Calendar} object the driver will use1821* to construct the timestamp1822* @throws SQLException if a database access error occurs or1823* this method is called on a closed {@code CallableStatement}1824* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1825* this method1826* @see #getTimestamp1827* @since 1.41828*/1829void setTimestamp(String parameterName, java.sql.Timestamp x, Calendar cal)1830throws SQLException;18311832/**1833* Clears the parameters set for this {@code RowSet} object's command.1834* <P>In general, parameter values remain in force for repeated use of a1835* {@code RowSet} object. Setting a parameter value automatically clears its1836* previous value. However, in some cases it is useful to immediately1837* release the resources used by the current parameter values, which can1838* be done by calling the method {@code clearParameters}.1839*1840* @throws SQLException if a database access error occurs1841*/1842void clearParameters() throws SQLException;18431844//---------------------------------------------------------------------1845// Reading and writing data1846//---------------------------------------------------------------------18471848/**1849* Fills this {@code RowSet} object with data.1850* <P>1851* The {@code execute} method may use the following properties1852* to create a connection for reading data: url, data source name,1853* user name, password, transaction isolation, and type map.1854*1855* The {@code execute} method may use the following properties1856* to create a statement to execute a command:1857* command, read only, maximum field size,1858* maximum rows, escape processing, and query timeout.1859* <P>1860* If the required properties have not been set, an exception is1861* thrown. If this method is successful, the current contents of the rowset are1862* discarded and the rowset's metadata is also (re)set. If there are1863* outstanding updates, they are ignored.1864* <P>1865* If this {@code RowSet} object does not maintain a continuous connection1866* with its source of data, it may use a {@code Reader} (a {@code RowSetReader}1867* object) to fill itself with data. In this case, a {@code Reader} will have been1868* registered with this {@code RowSet} object, and the method1869* {@code execute} will call on the {@code Reader}'s {@code readData}1870* method as part of its implementation.1871*1872* @throws SQLException if a database access error occurs or any of the1873* properties necessary for making a connection and creating1874* a statement have not been set1875*/1876void execute() throws SQLException;18771878//--------------------------------------------------------------------1879// Events1880//--------------------------------------------------------------------18811882/**1883* Registers the given listener so that it will be notified of events1884* that occur on this {@code RowSet} object.1885*1886* @param listener a component that has implemented the {@code RowSetListener}1887* interface and wants to be notified when events occur on this1888* {@code RowSet} object1889* @see #removeRowSetListener1890*/1891void addRowSetListener(RowSetListener listener);18921893/**1894* Removes the specified listener from the list of components that will be1895* notified when an event occurs on this {@code RowSet} object.1896*1897* @param listener a component that has been registered as a listener for this1898* {@code RowSet} object1899* @see #addRowSetListener1900*/1901void removeRowSetListener(RowSetListener listener);19021903/**1904* Sets the designated parameter to the given {@code java.sql.SQLXML} object. The driver converts this to an1905* SQL {@code XML} value when it sends it to the database.1906* @param parameterIndex index of the first parameter is 1, the second is 2, ...1907* @param xmlObject a {@code SQLXML} object that maps an SQL {@code XML} value1908* @throws SQLException if a database access error occurs, this method1909* is called on a closed result set,1910* the {@code java.xml.transform.Result},1911* {@code Writer} or {@code OutputStream} has not been closed1912* for the {@code SQLXML} object or1913* if there is an error processing the XML value. The {@code getCause} method1914* of the exception may provide a more detailed exception, for example, if the1915* stream does not contain valid XML.1916* @since 1.61917*/1918void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException;19191920/**1921* Sets the designated parameter to the given {@code java.sql.SQLXML} object. The driver converts this to an1922* {@code SQL XML} value when it sends it to the database.1923* @param parameterName the name of the parameter1924* @param xmlObject a {@code SQLXML} object that maps an {@code SQL XML} value1925* @throws SQLException if a database access error occurs, this method1926* is called on a closed result set,1927* the {@code java.xml.transform.Result},1928* {@code Writer} or {@code OutputStream} has not been closed1929* for the {@code SQLXML} object or1930* if there is an error processing the XML value. The {@code getCause} method1931* of the exception may provide a more detailed exception, for example, if the1932* stream does not contain valid XML.1933* @since 1.61934*/1935void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException;19361937/**1938* Sets the designated parameter to the given {@code java.sql.RowId} object. The1939* driver converts this to a SQL {@code ROWID} value when it sends it1940* to the database1941*1942* @param parameterIndex the first parameter is 1, the second is 2, ...1943* @param x the parameter value1944* @throws SQLException if a database access error occurs1945*1946* @since 1.61947*/1948void setRowId(int parameterIndex, RowId x) throws SQLException;19491950/**1951* Sets the designated parameter to the given {@code java.sql.RowId} object. The1952* driver converts this to a SQL {@code ROWID} when it sends it to the1953* database.1954*1955* @param parameterName the name of the parameter1956* @param x the parameter value1957* @throws SQLException if a database access error occurs1958* @since 1.61959*/1960void setRowId(String parameterName, RowId x) throws SQLException;19611962/**1963* Sets the designated parameter to the given {@code String} object.1964* The driver converts this to a SQL {@code NCHAR} or1965* {@code NVARCHAR} or {@code LONGNVARCHAR} value1966* (depending on the argument's1967* size relative to the driver's limits on {@code NVARCHAR} values)1968* when it sends it to the database.1969*1970* @param parameterIndex of the first parameter is 1, the second is 2, ...1971* @param value the parameter value1972* @throws SQLException if the driver does not support national1973* character sets; if the driver can detect that a data conversion1974* error could occur ; or if a database access error occurs1975* @since 1.61976*/1977void setNString(int parameterIndex, String value) throws SQLException;19781979/**1980* Sets the designated parameter to the given {@code String} object.1981* The driver converts this to a SQL {@code NCHAR} or1982* {@code NVARCHAR} or {@code LONGNVARCHAR}1983* @param parameterName the name of the column to be set1984* @param value the parameter value1985* @throws SQLException if the driver does not support national1986* character sets; if the driver can detect that a data conversion1987* error could occur; or if a database access error occurs1988* @since 1.61989*/1990public void setNString(String parameterName, String value)1991throws SQLException;19921993/**1994* Sets the designated parameter to a {@code Reader} object. The1995* {@code Reader} reads the data till end-of-file is reached. The1996* driver does the necessary conversion from Java character format to1997* the national character set in the database.1998* @param parameterIndex of the first parameter is 1, the second is 2, ...1999* @param value the parameter value2000* @param length the number of characters in the parameter data.2001* @throws SQLException if the driver does not support national2002* character sets; if the driver can detect that a data conversion2003* error could occur ; or if a database access error occurs2004* @since 1.62005*/2006void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException;20072008/**2009* Sets the designated parameter to a {@code Reader} object. The2010* {@code Reader} reads the data till end-of-file is reached. The2011* driver does the necessary conversion from Java character format to2012* the national character set in the database.2013* @param parameterName the name of the column to be set2014* @param value the parameter value2015* @param length the number of characters in the parameter data.2016* @throws SQLException if the driver does not support national2017* character sets; if the driver can detect that a data conversion2018* error could occur; or if a database access error occurs2019* @since 1.62020*/2021public void setNCharacterStream(String parameterName, Reader value, long length)2022throws SQLException;20232024/**2025* Sets the designated parameter to a {@code Reader} object. The2026* {@code Reader} reads the data till end-of-file is reached. The2027* driver does the necessary conversion from Java character format to2028* the national character set in the database.20292030* <P><B>Note:</B> This stream object can either be a standard2031* Java stream object or your own subclass that implements the2032* standard interface.2033* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2034* it might be more efficient to use a version of2035* {@code setNCharacterStream} which takes a length parameter.2036*2037* @param parameterName the name of the parameter2038* @param value the parameter value2039* @throws SQLException if the driver does not support national2040* character sets; if the driver can detect that a data conversion2041* error could occur ; if a database access error occurs; or2042* this method is called on a closed {@code CallableStatement}2043* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2044* @since 1.62045*/2046void setNCharacterStream(String parameterName, Reader value) throws SQLException;20472048/**2049* Sets the designated parameter to a {@code java.sql.NClob} object. The object2050* implements the {@code java.sql.NClob} interface. This {@code NClob}2051* object maps to a SQL {@code NCLOB}.2052* @param parameterName the name of the column to be set2053* @param value the parameter value2054* @throws SQLException if the driver does not support national2055* character sets; if the driver can detect that a data conversion2056* error could occur; or if a database access error occurs2057* @since 1.62058*/2059void setNClob(String parameterName, NClob value) throws SQLException;20602061/**2062* Sets the designated parameter to a {@code Reader} object.2063* The {@code Reader} must contain the number2064* of characters specified by length otherwise a {@code SQLException} will be2065* generated when the {@code CallableStatement} is executed.2066* This method differs from the {@code setCharacterStream (int, Reader, int)} method2067* because it informs the driver that the parameter value should be sent to2068* the server as a {@code NCLOB}. When the {@code setCharacterStream} method is used, the2069* driver may have to do extra work to determine whether the parameter2070* data should be send to the server as a {@code LONGNVARCHAR} or a {@code NCLOB}2071*2072* @param parameterName the name of the parameter to be set2073* @param reader An object that contains the data to set the parameter value to.2074* @param length the number of characters in the parameter data.2075* @throws SQLException if parameterIndex does not correspond to a parameter2076* marker in the SQL statement; if the length specified is less than zero;2077* if the driver does not support national2078* character sets; if the driver can detect that a data conversion2079* error could occur; if a database access error occurs or2080* this method is called on a closed {@code CallableStatement}2081* @throws SQLFeatureNotSupportedException if the JDBC driver does not support2082* this method2083* @since 1.62084*/2085void setNClob(String parameterName, Reader reader, long length)2086throws SQLException;20872088/**2089* Sets the designated parameter to a {@code Reader} object.2090* This method differs from the {@code setCharacterStream (int, Reader)} method2091* because it informs the driver that the parameter value should be sent to2092* the server as a {@code NCLOB}. When the {@code setCharacterStream} method is used, the2093* driver may have to do extra work to determine whether the parameter2094* data should be send to the server as a {@code LONGNVARCHAR} or a {@code NCLOB}2095* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2096* it might be more efficient to use a version of2097* {@code setNClob} which takes a length parameter.2098*2099* @param parameterName the name of the parameter2100* @param reader An object that contains the data to set the parameter value to.2101* @throws SQLException if the driver does not support national character sets;2102* if the driver can detect that a data conversion2103* error could occur; if a database access error occurs or2104* this method is called on a closed {@code CallableStatement}2105* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2106*2107* @since 1.62108*/2109void setNClob(String parameterName, Reader reader)2110throws SQLException;21112112/**2113* Sets the designated parameter to a {@code Reader} object.2114* The {@code Reader} must contain the number2115* of characters specified by length otherwise a {@code SQLException} will be2116* generated when the {@code PreparedStatement} is executed.2117* This method differs from the {@code setCharacterStream (int, Reader, int)} method2118* because it informs the driver that the parameter value should be sent to2119* the server as a {@code NCLOB}. When the {@code setCharacterStream} method is used, the2120* driver may have to do extra work to determine whether the parameter2121* data should be sent to the server as a {@code LONGNVARCHAR} or a {@code NCLOB}2122* @param parameterIndex index of the first parameter is 1, the second is 2, ...2123* @param reader An object that contains the data to set the parameter value to.2124* @param length the number of characters in the parameter data.2125* @throws SQLException if parameterIndex does not correspond to a parameter2126* marker in the SQL statement; if the length specified is less than zero;2127* if the driver does not support national character sets;2128* if the driver can detect that a data conversion2129* error could occur; if a database access error occurs or2130* this method is called on a closed {@code PreparedStatement}2131* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2132*2133* @since 1.62134*/2135void setNClob(int parameterIndex, Reader reader, long length)2136throws SQLException;21372138/**2139* Sets the designated parameter to a {@code java.sql.NClob} object. The driver converts this to a2140* SQL {@code NCLOB} value when it sends it to the database.2141* @param parameterIndex of the first parameter is 1, the second is 2, ...2142* @param value the parameter value2143* @throws SQLException if the driver does not support national2144* character sets; if the driver can detect that a data conversion2145* error could occur ; or if a database access error occurs2146* @since 1.62147*/2148void setNClob(int parameterIndex, NClob value) throws SQLException;21492150/**2151* Sets the designated parameter to a {@code Reader} object.2152* This method differs from the {@code setCharacterStream (int, Reader)} method2153* because it informs the driver that the parameter value should be sent to2154* the server as a {@code NCLOB}. When the {@code setCharacterStream} method is used, the2155* driver may have to do extra work to determine whether the parameter2156* data should be sent to the server as a {@code LONGNVARCHAR} or a {@code NCLOB}2157* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2158* it might be more efficient to use a version of2159* {@code setNClob} which takes a length parameter.2160*2161* @param parameterIndex index of the first parameter is 1, the second is 2, ...2162* @param reader An object that contains the data to set the parameter value to.2163* @throws SQLException if parameterIndex does not correspond to a parameter2164* marker in the SQL statement;2165* if the driver does not support national character sets;2166* if the driver can detect that a data conversion2167* error could occur; if a database access error occurs or2168* this method is called on a closed {@code PreparedStatement}2169* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2170*2171* @since 1.62172*/2173void setNClob(int parameterIndex, Reader reader)2174throws SQLException;21752176/**2177* Sets the designated parameter to the given {@code java.net.URL} value.2178* The driver converts this to an SQL {@code DATALINK} value2179* when it sends it to the database.2180*2181* @param parameterIndex the first parameter is 1, the second is 2, ...2182* @param x the {@code java.net.URL} object to be set2183* @throws SQLException if a database access error occurs or2184* this method is called on a closed {@code PreparedStatement}2185* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2186* @since 1.42187*/2188void setURL(int parameterIndex, java.net.URL x) throws SQLException;2189219021912192}219321942195