Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/java/sql/CallableStatement.java
38829 views
/*1* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package java.sql;2627import java.math.BigDecimal;28import java.util.Calendar;29import java.io.Reader;30import java.io.InputStream;3132/**33* The interface used to execute SQL stored procedures. The JDBC API34* provides a stored procedure SQL escape syntax that allows stored procedures35* to be called in a standard way for all RDBMSs. This escape syntax has one36* form that includes a result parameter and one that does not. If used, the result37* parameter must be registered as an OUT parameter. The other parameters38* can be used for input, output or both. Parameters are referred to39* sequentially, by number, with the first parameter being 1.40* <PRE>41* {?= call <procedure-name>[(<arg1>,<arg2>, ...)]}42* {call <procedure-name>[(<arg1>,<arg2>, ...)]}43* </PRE>44* <P>45* IN parameter values are set using the <code>set</code> methods inherited from46* {@link PreparedStatement}. The type of all OUT parameters must be47* registered prior to executing the stored procedure; their values48* are retrieved after execution via the <code>get</code> methods provided here.49* <P>50* A <code>CallableStatement</code> can return one {@link ResultSet} object or51* multiple <code>ResultSet</code> objects. Multiple52* <code>ResultSet</code> objects are handled using operations53* inherited from {@link Statement}.54* <P>55* For maximum portability, a call's <code>ResultSet</code> objects and56* update counts should be processed prior to getting the values of output57* parameters.58*59*60* @see Connection#prepareCall61* @see ResultSet62*/6364public interface CallableStatement extends PreparedStatement {6566/**67* Registers the OUT parameter in ordinal position68* <code>parameterIndex</code> to the JDBC type69* <code>sqlType</code>. All OUT parameters must be registered70* before a stored procedure is executed.71* <p>72* The JDBC type specified by <code>sqlType</code> for an OUT73* parameter determines the Java type that must be used74* in the <code>get</code> method to read the value of that parameter.75* <p>76* If the JDBC type expected to be returned to this output parameter77* is specific to this particular database, <code>sqlType</code>78* should be <code>java.sql.Types.OTHER</code>. The method79* {@link #getObject} retrieves the value.80*81* @param parameterIndex the first parameter is 1, the second is 2,82* and so on83* @param sqlType the JDBC type code defined by <code>java.sql.Types</code>.84* If the parameter is of JDBC type <code>NUMERIC</code>85* or <code>DECIMAL</code>, the version of86* <code>registerOutParameter</code> that accepts a scale value87* should be used.88*89* @exception SQLException if the parameterIndex is not valid;90* if a database access error occurs or91* this method is called on a closed <code>CallableStatement</code>92* @exception SQLFeatureNotSupportedException if <code>sqlType</code> is93* a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,94* <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,95* <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,96* <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>97* or <code>STRUCT</code> data type and the JDBC driver does not support98* this data type99* @see Types100*/101void registerOutParameter(int parameterIndex, int sqlType)102throws SQLException;103104/**105* Registers the parameter in ordinal position106* <code>parameterIndex</code> to be of JDBC type107* <code>sqlType</code>. All OUT parameters must be registered108* before a stored procedure is executed.109* <p>110* The JDBC type specified by <code>sqlType</code> for an OUT111* parameter determines the Java type that must be used112* in the <code>get</code> method to read the value of that parameter.113* <p>114* This version of <code>registerOutParameter</code> should be115* used when the parameter is of JDBC type <code>NUMERIC</code>116* or <code>DECIMAL</code>.117*118* @param parameterIndex the first parameter is 1, the second is 2,119* and so on120* @param sqlType the SQL type code defined by <code>java.sql.Types</code>.121* @param scale the desired number of digits to the right of the122* decimal point. It must be greater than or equal to zero.123* @exception SQLException if the parameterIndex is not valid;124* if a database access error occurs or125* this method is called on a closed <code>CallableStatement</code>126* @exception SQLFeatureNotSupportedException if <code>sqlType</code> is127* a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,128* <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,129* <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,130* <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>131* or <code>STRUCT</code> data type and the JDBC driver does not support132* this data type133* @see Types134*/135void registerOutParameter(int parameterIndex, int sqlType, int scale)136throws SQLException;137138/**139* Retrieves whether the last OUT parameter read had the value of140* SQL <code>NULL</code>. Note that this method should be called only after141* calling a getter method; otherwise, there is no value to use in142* determining whether it is <code>null</code> or not.143*144* @return <code>true</code> if the last parameter read was SQL145* <code>NULL</code>; <code>false</code> otherwise146* @exception SQLException if a database access error occurs or147* this method is called on a closed <code>CallableStatement</code>148*/149boolean wasNull() throws SQLException;150151/**152* Retrieves the value of the designated JDBC <code>CHAR</code>,153* <code>VARCHAR</code>, or <code>LONGVARCHAR</code> parameter as a154* <code>String</code> in the Java programming language.155* <p>156* For the fixed-length type JDBC <code>CHAR</code>,157* the <code>String</code> object158* returned has exactly the same value the SQL159* <code>CHAR</code> value had in the160* database, including any padding added by the database.161*162* @param parameterIndex the first parameter is 1, the second is 2,163* and so on164* @return the parameter value. If the value is SQL <code>NULL</code>,165* the result166* is <code>null</code>.167* @exception SQLException if the parameterIndex is not valid;168* if a database access error occurs or169* this method is called on a closed <code>CallableStatement</code>170* @see #setString171*/172String getString(int parameterIndex) throws SQLException;173174/**175* Retrieves the value of the designated JDBC <code>BIT</code>176* or <code>BOOLEAN</code> parameter as a177* <code>boolean</code> in the Java programming language.178*179* @param parameterIndex the first parameter is 1, the second is 2,180* and so on181* @return the parameter value. If the value is SQL <code>NULL</code>,182* the result is <code>false</code>.183* @exception SQLException if the parameterIndex is not valid;184* if a database access error occurs or185* this method is called on a closed <code>CallableStatement</code>186* @see #setBoolean187*/188boolean getBoolean(int parameterIndex) throws SQLException;189190/**191* Retrieves the value of the designated JDBC <code>TINYINT</code> parameter192* as a <code>byte</code> in the Java programming language.193*194* @param parameterIndex the first parameter is 1, the second is 2,195* and so on196* @return the parameter value. If the value is SQL <code>NULL</code>, the result197* is <code>0</code>.198* @exception SQLException if the parameterIndex is not valid;199* if a database access error occurs or200* this method is called on a closed <code>CallableStatement</code>201* @see #setByte202*/203byte getByte(int parameterIndex) throws SQLException;204205/**206* Retrieves the value of the designated JDBC <code>SMALLINT</code> parameter207* as a <code>short</code> in the Java programming language.208*209* @param parameterIndex the first parameter is 1, the second is 2,210* and so on211* @return the parameter value. If the value is SQL <code>NULL</code>, the result212* is <code>0</code>.213* @exception SQLException if the parameterIndex is not valid;214* if a database access error occurs or215* this method is called on a closed <code>CallableStatement</code>216* @see #setShort217*/218short getShort(int parameterIndex) throws SQLException;219220/**221* Retrieves the value of the designated JDBC <code>INTEGER</code> parameter222* as an <code>int</code> in the Java programming language.223*224* @param parameterIndex the first parameter is 1, the second is 2,225* and so on226* @return the parameter value. If the value is SQL <code>NULL</code>, the result227* is <code>0</code>.228* @exception SQLException if the parameterIndex is not valid;229* if a database access error occurs or230* this method is called on a closed <code>CallableStatement</code>231* @see #setInt232*/233int getInt(int parameterIndex) throws SQLException;234235/**236* Retrieves the value of the designated JDBC <code>BIGINT</code> parameter237* as a <code>long</code> in the Java programming language.238*239* @param parameterIndex the first parameter is 1, the second is 2,240* and so on241* @return the parameter value. If the value is SQL <code>NULL</code>, the result242* is <code>0</code>.243* @exception SQLException if the parameterIndex is not valid;244* if a database access error occurs or245* this method is called on a closed <code>CallableStatement</code>246* @see #setLong247*/248long getLong(int parameterIndex) throws SQLException;249250/**251* Retrieves the value of the designated JDBC <code>FLOAT</code> parameter252* as a <code>float</code> in the Java programming language.253*254* @param parameterIndex the first parameter is 1, the second is 2,255* and so on256* @return the parameter value. If the value is SQL <code>NULL</code>, the result257* is <code>0</code>.258* @exception SQLException if the parameterIndex is not valid;259* if a database access error occurs or260* this method is called on a closed <code>CallableStatement</code>261* @see #setFloat262*/263float getFloat(int parameterIndex) throws SQLException;264265/**266* Retrieves the value of the designated JDBC <code>DOUBLE</code> parameter as a <code>double</code>267* in the Java programming language.268* @param parameterIndex the first parameter is 1, the second is 2,269* and so on270* @return the parameter value. If the value is SQL <code>NULL</code>, the result271* is <code>0</code>.272* @exception SQLException if the parameterIndex is not valid;273* if a database access error occurs or274* this method is called on a closed <code>CallableStatement</code>275* @see #setDouble276*/277double getDouble(int parameterIndex) throws SQLException;278279/**280* Retrieves the value of the designated JDBC <code>NUMERIC</code> parameter as a281* <code>java.math.BigDecimal</code> object with <i>scale</i> digits to282* the right of the decimal point.283* @param parameterIndex the first parameter is 1, the second is 2,284* and so on285* @param scale the number of digits to the right of the decimal point286* @return the parameter value. If the value is SQL <code>NULL</code>, the result287* is <code>null</code>.288* @exception SQLException if the parameterIndex is not valid;289* if a database access error occurs or290* this method is called on a closed <code>CallableStatement</code>291* @exception SQLFeatureNotSupportedException if the JDBC driver does not support292* this method293* @deprecated use <code>getBigDecimal(int parameterIndex)</code>294* or <code>getBigDecimal(String parameterName)</code>295* @see #setBigDecimal296*/297@Deprecated298BigDecimal getBigDecimal(int parameterIndex, int scale)299throws SQLException;300301/**302* Retrieves the value of the designated JDBC <code>BINARY</code> or303* <code>VARBINARY</code> parameter as an array of <code>byte</code>304* values in the Java programming language.305* @param parameterIndex the first parameter is 1, the second is 2,306* and so on307* @return the parameter value. If the value is SQL <code>NULL</code>, the result308* is <code>null</code>.309* @exception SQLException if the parameterIndex is not valid;310* if a database access error occurs or311* this method is called on a closed <code>CallableStatement</code>312* @see #setBytes313*/314byte[] getBytes(int parameterIndex) throws SQLException;315316/**317* Retrieves the value of the designated JDBC <code>DATE</code> parameter as a318* <code>java.sql.Date</code> object.319* @param parameterIndex the first parameter is 1, the second is 2,320* and so on321* @return the parameter value. If the value is SQL <code>NULL</code>, the result322* is <code>null</code>.323* @exception SQLException if the parameterIndex is not valid;324* if a database access error occurs or325* this method is called on a closed <code>CallableStatement</code>326* @see #setDate327*/328java.sql.Date getDate(int parameterIndex) throws SQLException;329330/**331* Retrieves the value of the designated JDBC <code>TIME</code> parameter as a332* <code>java.sql.Time</code> object.333*334* @param parameterIndex the first parameter is 1, the second is 2,335* and so on336* @return the parameter value. If the value is SQL <code>NULL</code>, the result337* is <code>null</code>.338* @exception SQLException if the parameterIndex is not valid;339* if a database access error occurs or340* this method is called on a closed <code>CallableStatement</code>341* @see #setTime342*/343java.sql.Time getTime(int parameterIndex) throws SQLException;344345/**346* Retrieves the value of the designated JDBC <code>TIMESTAMP</code> parameter as a347* <code>java.sql.Timestamp</code> object.348*349* @param parameterIndex the first parameter is 1, the second is 2,350* and so on351* @return the parameter value. If the value is SQL <code>NULL</code>, the result352* is <code>null</code>.353* @exception SQLException if the parameterIndex is not valid;354* if a database access error occurs or355* this method is called on a closed <code>CallableStatement</code>356* @see #setTimestamp357*/358java.sql.Timestamp getTimestamp(int parameterIndex)359throws SQLException;360361//----------------------------------------------------------------------362// Advanced features:363364365/**366* Retrieves the value of the designated parameter as an <code>Object</code>367* in the Java programming language. If the value is an SQL <code>NULL</code>,368* the driver returns a Java <code>null</code>.369* <p>370* This method returns a Java object whose type corresponds to the JDBC371* type that was registered for this parameter using the method372* <code>registerOutParameter</code>. By registering the target JDBC373* type as <code>java.sql.Types.OTHER</code>, this method can be used374* to read database-specific abstract data types.375*376* @param parameterIndex the first parameter is 1, the second is 2,377* and so on378* @return A <code>java.lang.Object</code> holding the OUT parameter value379* @exception SQLException if the parameterIndex is not valid;380* if a database access error occurs or381* this method is called on a closed <code>CallableStatement</code>382* @see Types383* @see #setObject384*/385Object getObject(int parameterIndex) throws SQLException;386387388//--------------------------JDBC 2.0-----------------------------389390/**391* Retrieves the value of the designated JDBC <code>NUMERIC</code> parameter as a392* <code>java.math.BigDecimal</code> object with as many digits to the393* right of the decimal point as the value contains.394* @param parameterIndex the first parameter is 1, the second is 2,395* and so on396* @return the parameter value in full precision. If the value is397* SQL <code>NULL</code>, the result is <code>null</code>.398* @exception SQLException if the parameterIndex is not valid;399* if a database access error occurs or400* this method is called on a closed <code>CallableStatement</code>401* @see #setBigDecimal402* @since 1.2403*/404BigDecimal getBigDecimal(int parameterIndex) throws SQLException;405406/**407* Returns an object representing the value of OUT parameter408* <code>parameterIndex</code> and uses <code>map</code> for the custom409* mapping of the parameter value.410* <p>411* This method returns a Java object whose type corresponds to the412* JDBC type that was registered for this parameter using the method413* <code>registerOutParameter</code>. By registering the target414* JDBC type as <code>java.sql.Types.OTHER</code>, this method can415* be used to read database-specific abstract data types.416* @param parameterIndex the first parameter is 1, the second is 2, and so on417* @param map the mapping from SQL type names to Java classes418* @return a <code>java.lang.Object</code> holding the OUT parameter value419* @exception SQLException if the parameterIndex is not valid;420* if a database access error occurs or421* this method is called on a closed <code>CallableStatement</code>422* @exception SQLFeatureNotSupportedException if the JDBC driver does not support423* this method424* @see #setObject425* @since 1.2426*/427Object getObject(int parameterIndex, java.util.Map<String,Class<?>> map)428throws SQLException;429430/**431* Retrieves the value of the designated JDBC <code>REF(<structured-type>)</code>432* parameter as a {@link java.sql.Ref} object in the Java programming language.433* @param parameterIndex the first parameter is 1, the second is 2,434* and so on435* @return the parameter value as a <code>Ref</code> object in the436* Java programming language. If the value was SQL <code>NULL</code>, the value437* <code>null</code> is returned.438* @exception SQLException if the parameterIndex is not valid;439* if a database access error occurs or440* this method is called on a closed <code>CallableStatement</code>441* @exception SQLFeatureNotSupportedException if the JDBC driver does not support442* this method443* @since 1.2444*/445Ref getRef (int parameterIndex) throws SQLException;446447/**448* Retrieves the value of the designated JDBC <code>BLOB</code> parameter as a449* {@link java.sql.Blob} object in the Java programming language.450* @param parameterIndex the first parameter is 1, the second is 2, and so on451* @return the parameter value as a <code>Blob</code> object in the452* Java programming language. If the value was SQL <code>NULL</code>, the value453* <code>null</code> is returned.454* @exception SQLException if the parameterIndex is not valid;455* if a database access error occurs or456* this method is called on a closed <code>CallableStatement</code>457* @exception SQLFeatureNotSupportedException if the JDBC driver does not support458* this method459* @since 1.2460*/461Blob getBlob (int parameterIndex) throws SQLException;462463/**464* Retrieves the value of the designated JDBC <code>CLOB</code> parameter as a465* <code>java.sql.Clob</code> object in the Java programming language.466* @param parameterIndex the first parameter is 1, the second is 2, and467* so on468* @return the parameter value as a <code>Clob</code> object in the469* Java programming language. If the value was SQL <code>NULL</code>, the470* value <code>null</code> is returned.471* @exception SQLException if the parameterIndex is not valid;472* if a database access error occurs or473* this method is called on a closed <code>CallableStatement</code>474* @exception SQLFeatureNotSupportedException if the JDBC driver does not support475* this method476* @since 1.2477*/478Clob getClob (int parameterIndex) throws SQLException;479480/**481*482* Retrieves the value of the designated JDBC <code>ARRAY</code> parameter as an483* {@link java.sql.Array} object in the Java programming language.484* @param parameterIndex the first parameter is 1, the second is 2, and485* so on486* @return the parameter value as an <code>Array</code> object in487* the Java programming language. If the value was SQL <code>NULL</code>, the488* value <code>null</code> is returned.489* @exception SQLException if the parameterIndex is not valid;490* if a database access error occurs or491* this method is called on a closed <code>CallableStatement</code>492* @exception SQLFeatureNotSupportedException if the JDBC driver does not support493* this method494* @since 1.2495*/496Array getArray (int parameterIndex) throws SQLException;497498/**499* Retrieves the value of the designated JDBC <code>DATE</code> parameter as a500* <code>java.sql.Date</code> object, using501* the given <code>Calendar</code> object502* to construct the date.503* With a <code>Calendar</code> object, the driver504* can calculate the date taking into account a custom timezone and locale.505* If no <code>Calendar</code> object is specified, the driver uses the506* default timezone and locale.507*508* @param parameterIndex the first parameter is 1, the second is 2,509* and so on510* @param cal the <code>Calendar</code> object the driver will use511* to construct the date512* @return the parameter value. If the value is SQL <code>NULL</code>, the result513* is <code>null</code>.514* @exception SQLException if the parameterIndex is not valid;515* if a database access error occurs or516* this method is called on a closed <code>CallableStatement</code>517* @see #setDate518* @since 1.2519*/520java.sql.Date getDate(int parameterIndex, Calendar cal)521throws SQLException;522523/**524* Retrieves the value of the designated JDBC <code>TIME</code> parameter as a525* <code>java.sql.Time</code> object, using526* the given <code>Calendar</code> object527* to construct the time.528* With a <code>Calendar</code> object, the driver529* can calculate the time taking into account a custom timezone and locale.530* If no <code>Calendar</code> object is specified, the driver uses the531* default timezone and locale.532*533* @param parameterIndex the first parameter is 1, the second is 2,534* and so on535* @param cal the <code>Calendar</code> object the driver will use536* to construct the time537* @return the parameter value; if the value is SQL <code>NULL</code>, the result538* is <code>null</code>.539* @exception SQLException if the parameterIndex is not valid;540* if a database access error occurs or541* this method is called on a closed <code>CallableStatement</code>542* @see #setTime543* @since 1.2544*/545java.sql.Time getTime(int parameterIndex, Calendar cal)546throws SQLException;547548/**549* Retrieves the value of the designated JDBC <code>TIMESTAMP</code> parameter as a550* <code>java.sql.Timestamp</code> object, using551* the given <code>Calendar</code> object to construct552* the <code>Timestamp</code> object.553* With a <code>Calendar</code> object, the driver554* can calculate the timestamp taking into account a custom timezone and locale.555* If no <code>Calendar</code> object is specified, the driver uses the556* default timezone and locale.557*558*559* @param parameterIndex the first parameter is 1, the second is 2,560* and so on561* @param cal the <code>Calendar</code> object the driver will use562* to construct the timestamp563* @return the parameter value. If the value is SQL <code>NULL</code>, the result564* is <code>null</code>.565* @exception SQLException if the parameterIndex is not valid;566* if a database access error occurs or567* this method is called on a closed <code>CallableStatement</code>568* @see #setTimestamp569* @since 1.2570*/571java.sql.Timestamp getTimestamp(int parameterIndex, Calendar cal)572throws SQLException;573574575/**576* Registers the designated output parameter.577* This version of578* the method <code>registerOutParameter</code>579* should be used for a user-defined or <code>REF</code> output parameter. Examples580* of user-defined types include: <code>STRUCT</code>, <code>DISTINCT</code>,581* <code>JAVA_OBJECT</code>, and named array types.582*<p>583* All OUT parameters must be registered584* before a stored procedure is executed.585* <p> For a user-defined parameter, the fully-qualified SQL586* type name of the parameter should also be given, while a <code>REF</code>587* parameter requires that the fully-qualified type name of the588* referenced type be given. A JDBC driver that does not need the589* type code and type name information may ignore it. To be portable,590* however, applications should always provide these values for591* user-defined and <code>REF</code> parameters.592*593* Although it is intended for user-defined and <code>REF</code> parameters,594* this method may be used to register a parameter of any JDBC type.595* If the parameter does not have a user-defined or <code>REF</code> type, the596* <i>typeName</i> parameter is ignored.597*598* <P><B>Note:</B> When reading the value of an out parameter, you599* must use the getter method whose Java type corresponds to the600* parameter's registered SQL type.601*602* @param parameterIndex the first parameter is 1, the second is 2,...603* @param sqlType a value from {@link java.sql.Types}604* @param typeName the fully-qualified name of an SQL structured type605* @exception SQLException if the parameterIndex is not valid;606* if a database access error occurs or607* this method is called on a closed <code>CallableStatement</code>608* @exception SQLFeatureNotSupportedException if <code>sqlType</code> is609* a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,610* <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,611* <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,612* <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>613* or <code>STRUCT</code> data type and the JDBC driver does not support614* this data type615* @see Types616* @since 1.2617*/618void registerOutParameter (int parameterIndex, int sqlType, String typeName)619throws SQLException;620621//--------------------------JDBC 3.0-----------------------------622623/**624* Registers the OUT parameter named625* <code>parameterName</code> to the JDBC type626* <code>sqlType</code>. All OUT parameters must be registered627* before a stored procedure is executed.628* <p>629* The JDBC type specified by <code>sqlType</code> for an OUT630* parameter determines the Java type that must be used631* in the <code>get</code> method to read the value of that parameter.632* <p>633* If the JDBC type expected to be returned to this output parameter634* is specific to this particular database, <code>sqlType</code>635* should be <code>java.sql.Types.OTHER</code>. The method636* {@link #getObject} retrieves the value.637* @param parameterName the name of the parameter638* @param sqlType the JDBC type code defined by <code>java.sql.Types</code>.639* If the parameter is of JDBC type <code>NUMERIC</code>640* or <code>DECIMAL</code>, the version of641* <code>registerOutParameter</code> that accepts a scale value642* should be used.643* @exception SQLException if parameterName does not correspond to a named644* parameter; if a database access error occurs or645* this method is called on a closed <code>CallableStatement</code>646* @exception SQLFeatureNotSupportedException if <code>sqlType</code> is647* a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,648* <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,649* <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,650* <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>651* or <code>STRUCT</code> data type and the JDBC driver does not support652* this data type or if the JDBC driver does not support653* this method654* @since 1.4655* @see Types656*/657void registerOutParameter(String parameterName, int sqlType)658throws SQLException;659660/**661* Registers the parameter named662* <code>parameterName</code> to be of JDBC type663* <code>sqlType</code>. All OUT parameters must be registered664* before a stored procedure is executed.665* <p>666* The JDBC type specified by <code>sqlType</code> for an OUT667* parameter determines the Java type that must be used668* in the <code>get</code> method to read the value of that parameter.669* <p>670* This version of <code>registerOutParameter</code> should be671* used when the parameter is of JDBC type <code>NUMERIC</code>672* or <code>DECIMAL</code>.673*674* @param parameterName the name of the parameter675* @param sqlType SQL type code defined by <code>java.sql.Types</code>.676* @param scale the desired number of digits to the right of the677* decimal point. It must be greater than or equal to zero.678* @exception SQLException if parameterName does not correspond to a named679* parameter; if a database access error occurs or680* this method is called on a closed <code>CallableStatement</code>681* @exception SQLFeatureNotSupportedException if <code>sqlType</code> is682* a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,683* <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,684* <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,685* <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>686* or <code>STRUCT</code> data type and the JDBC driver does not support687* this data type or if the JDBC driver does not support688* this method689* @since 1.4690* @see Types691*/692void registerOutParameter(String parameterName, int sqlType, int scale)693throws SQLException;694695/**696* Registers the designated output parameter. This version of697* the method <code>registerOutParameter</code>698* should be used for a user-named or REF output parameter. Examples699* of user-named types include: STRUCT, DISTINCT, JAVA_OBJECT, and700* named array types.701*<p>702* All OUT parameters must be registered703* before a stored procedure is executed.704* <p>705* For a user-named parameter the fully-qualified SQL706* type name of the parameter should also be given, while a REF707* parameter requires that the fully-qualified type name of the708* referenced type be given. A JDBC driver that does not need the709* type code and type name information may ignore it. To be portable,710* however, applications should always provide these values for711* user-named and REF parameters.712*713* Although it is intended for user-named and REF parameters,714* this method may be used to register a parameter of any JDBC type.715* If the parameter does not have a user-named or REF type, the716* typeName parameter is ignored.717*718* <P><B>Note:</B> When reading the value of an out parameter, you719* must use the <code>getXXX</code> method whose Java type XXX corresponds to the720* parameter's registered SQL type.721*722* @param parameterName the name of the parameter723* @param sqlType a value from {@link java.sql.Types}724* @param typeName the fully-qualified name of an SQL structured type725* @exception SQLException if parameterName does not correspond to a named726* parameter; if a database access error occurs or727* this method is called on a closed <code>CallableStatement</code>728* @exception SQLFeatureNotSupportedException if <code>sqlType</code> is729* a <code>ARRAY</code>, <code>BLOB</code>, <code>CLOB</code>,730* <code>DATALINK</code>, <code>JAVA_OBJECT</code>, <code>NCHAR</code>,731* <code>NCLOB</code>, <code>NVARCHAR</code>, <code>LONGNVARCHAR</code>,732* <code>REF</code>, <code>ROWID</code>, <code>SQLXML</code>733* or <code>STRUCT</code> data type and the JDBC driver does not support734* this data type or if the JDBC driver does not support735* this method736* @see Types737* @since 1.4738*/739void registerOutParameter (String parameterName, int sqlType, String typeName)740throws SQLException;741742/**743* Retrieves the value of the designated JDBC <code>DATALINK</code> parameter as a744* <code>java.net.URL</code> object.745*746* @param parameterIndex the first parameter is 1, the second is 2,...747* @return a <code>java.net.URL</code> object that represents the748* JDBC <code>DATALINK</code> value used as the designated749* parameter750* @exception SQLException if the parameterIndex is not valid;751* if a database access error occurs,752* this method is called on a closed <code>CallableStatement</code>,753* or if the URL being returned is754* not a valid URL on the Java platform755* @exception SQLFeatureNotSupportedException if the JDBC driver does not support756* this method757* @see #setURL758* @since 1.4759*/760java.net.URL getURL(int parameterIndex) throws SQLException;761762/**763* Sets the designated parameter to the given <code>java.net.URL</code> object.764* The driver converts this to an SQL <code>DATALINK</code> value when765* it sends it to the database.766*767* @param parameterName the name of the parameter768* @param val the parameter value769* @exception SQLException if parameterName does not correspond to a named770* parameter; if a database access error occurs;771* this method is called on a closed <code>CallableStatement</code>772* or if a URL is malformed773* @exception SQLFeatureNotSupportedException if the JDBC driver does not support774* this method775* @see #getURL776* @since 1.4777*/778void setURL(String parameterName, java.net.URL val) throws SQLException;779780/**781* Sets the designated parameter to SQL <code>NULL</code>.782*783* <P><B>Note:</B> You must specify the parameter's SQL type.784*785* @param parameterName the name of the parameter786* @param sqlType the SQL type code defined in <code>java.sql.Types</code>787* @exception SQLException if parameterName does not correspond to a named788* parameter; if a database access error occurs or789* this method is called on a closed <code>CallableStatement</code>790* @exception SQLFeatureNotSupportedException if the JDBC driver does not support791* this method792* @since 1.4793*/794void setNull(String parameterName, int sqlType) throws SQLException;795796/**797* Sets the designated parameter to the given Java <code>boolean</code> value.798* The driver converts this799* to an SQL <code>BIT</code> or <code>BOOLEAN</code> value when it sends it to the database.800*801* @param parameterName the name of the parameter802* @param x the parameter value803* @exception SQLException if parameterName does not correspond to a named804* parameter; if a database access error occurs or805* this method is called on a closed <code>CallableStatement</code>806* @see #getBoolean807* @exception SQLFeatureNotSupportedException if the JDBC driver does not support808* this method809* @since 1.4810*/811void setBoolean(String parameterName, boolean x) throws SQLException;812813/**814* Sets the designated parameter to the given Java <code>byte</code> value.815* The driver converts this816* to an SQL <code>TINYINT</code> value when it sends it to the database.817*818* @param parameterName the name of the parameter819* @param x the parameter value820* @exception SQLException if parameterName does not correspond to a named821* parameter; if a database access error occurs or822* this method is called on a closed <code>CallableStatement</code>823* @exception SQLFeatureNotSupportedException if the JDBC driver does not support824* this method825* @see #getByte826* @since 1.4827*/828void setByte(String parameterName, byte x) throws SQLException;829830/**831* Sets the designated parameter to the given Java <code>short</code> value.832* The driver converts this833* to an SQL <code>SMALLINT</code> value when it sends it to the database.834*835* @param parameterName the name of the parameter836* @param x the parameter value837* @exception SQLException if parameterName does not correspond to a named838* parameter; if a database access error occurs or839* this method is called on a closed <code>CallableStatement</code>840* @exception SQLFeatureNotSupportedException if the JDBC driver does not support841* this method842* @see #getShort843* @since 1.4844*/845void setShort(String parameterName, short x) throws SQLException;846847/**848* Sets the designated parameter to the given Java <code>int</code> value.849* The driver converts this850* to an SQL <code>INTEGER</code> value when it sends it to the database.851*852* @param parameterName the name of the parameter853* @param x the parameter value854* @exception SQLException if parameterName does not correspond to a named855* parameter; if a database access error occurs or856* this method is called on a closed <code>CallableStatement</code>857* @exception SQLFeatureNotSupportedException if the JDBC driver does not support858* this method859* @see #getInt860* @since 1.4861*/862void setInt(String parameterName, int x) throws SQLException;863864/**865* Sets the designated parameter to the given Java <code>long</code> value.866* The driver converts this867* to an SQL <code>BIGINT</code> value when it sends it to the database.868*869* @param parameterName the name of the parameter870* @param x the parameter value871* @exception SQLException if parameterName does not correspond to a named872* parameter; if a database access error occurs or873* this method is called on a closed <code>CallableStatement</code>874* @exception SQLFeatureNotSupportedException if the JDBC driver does not support875* this method876* @see #getLong877* @since 1.4878*/879void setLong(String parameterName, long x) throws SQLException;880881/**882* Sets the designated parameter to the given Java <code>float</code> value.883* The driver converts this884* to an SQL <code>FLOAT</code> value when it sends it to the database.885*886* @param parameterName the name of the parameter887* @param x the parameter value888* @exception SQLException if parameterName does not correspond to a named889* parameter; if a database access error occurs or890* this method is called on a closed <code>CallableStatement</code>891* @exception SQLFeatureNotSupportedException if the JDBC driver does not support892* this method893* @see #getFloat894* @since 1.4895*/896void setFloat(String parameterName, float x) throws SQLException;897898/**899* Sets the designated parameter to the given Java <code>double</code> value.900* The driver converts this901* to an SQL <code>DOUBLE</code> value when it sends it to the database.902*903* @param parameterName the name of the parameter904* @param x the parameter value905* @exception SQLException if parameterName does not correspond to a named906* parameter; if a database access error occurs or907* this method is called on a closed <code>CallableStatement</code>908* @exception SQLFeatureNotSupportedException if the JDBC driver does not support909* this method910* @see #getDouble911* @since 1.4912*/913void setDouble(String parameterName, double x) throws SQLException;914915/**916* Sets the designated parameter to the given917* <code>java.math.BigDecimal</code> value.918* The driver converts this to an SQL <code>NUMERIC</code> value when919* it sends it to the database.920*921* @param parameterName the name of the parameter922* @param x the parameter value923* @exception SQLException if parameterName does not correspond to a named924* parameter; if a database access error occurs or925* this method is called on a closed <code>CallableStatement</code>926* @exception SQLFeatureNotSupportedException if the JDBC driver does not support927* this method928* @see #getBigDecimal929* @since 1.4930*/931void setBigDecimal(String parameterName, BigDecimal x) throws SQLException;932933/**934* Sets the designated parameter to the given Java <code>String</code> value.935* The driver converts this936* to an SQL <code>VARCHAR</code> or <code>LONGVARCHAR</code> value937* (depending on the argument's938* size relative to the driver's limits on <code>VARCHAR</code> values)939* when it sends it to the database.940*941* @param parameterName the name of the parameter942* @param x the parameter value943* @exception SQLException if parameterName does not correspond to a named944* parameter; if a database access error occurs or945* this method is called on a closed <code>CallableStatement</code>946* @exception SQLFeatureNotSupportedException if the JDBC driver does not support947* this method948* @see #getString949* @since 1.4950*/951void setString(String parameterName, String x) throws SQLException;952953/**954* Sets the designated parameter to the given Java array of bytes.955* The driver converts this to an SQL <code>VARBINARY</code> or956* <code>LONGVARBINARY</code> (depending on the argument's size relative957* to the driver's limits on <code>VARBINARY</code> values) when it sends958* it to the database.959*960* @param parameterName the name of the parameter961* @param x the parameter value962* @exception SQLException if parameterName does not correspond to a named963* parameter; if a database access error occurs or964* this method is called on a closed <code>CallableStatement</code>965* @exception SQLFeatureNotSupportedException if the JDBC driver does not support966* this method967* @see #getBytes968* @since 1.4969*/970void setBytes(String parameterName, byte x[]) throws SQLException;971972/**973* Sets the designated parameter to the given <code>java.sql.Date</code> value974* using the default time zone of the virtual machine that is running975* the application.976* The driver converts this977* to an SQL <code>DATE</code> value when it sends it to the database.978*979* @param parameterName the name of the parameter980* @param x the parameter value981* @exception SQLException if parameterName does not correspond to a named982* parameter; if a database access error occurs or983* this method is called on a closed <code>CallableStatement</code>984* @exception SQLFeatureNotSupportedException if the JDBC driver does not support985* this method986* @see #getDate987* @since 1.4988*/989void setDate(String parameterName, java.sql.Date x)990throws SQLException;991992/**993* Sets the designated parameter to the given <code>java.sql.Time</code> value.994* The driver converts this995* to an SQL <code>TIME</code> value when it sends it to the database.996*997* @param parameterName the name of the parameter998* @param x the parameter value999* @exception SQLException if parameterName does not correspond to a named1000* parameter; if a database access error occurs or1001* this method is called on a closed <code>CallableStatement</code>1002* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1003* this method1004* @see #getTime1005* @since 1.41006*/1007void setTime(String parameterName, java.sql.Time x)1008throws SQLException;10091010/**1011* Sets the designated parameter to the given <code>java.sql.Timestamp</code> value.1012* The driver1013* converts this to an SQL <code>TIMESTAMP</code> value when it sends it to the1014* database.1015*1016* @param parameterName the name of the parameter1017* @param x the parameter value1018* @exception SQLException if parameterName does not correspond to a named1019* parameter; if a database access error occurs or1020* this method is called on a closed <code>CallableStatement</code>1021* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1022* this method1023* @see #getTimestamp1024* @since 1.41025*/1026void setTimestamp(String parameterName, java.sql.Timestamp x)1027throws SQLException;10281029/**1030* Sets the designated parameter to the given input stream, which will have1031* the specified number of bytes.1032* When a very large ASCII value is input to a <code>LONGVARCHAR</code>1033* parameter, it may be more practical to send it via a1034* <code>java.io.InputStream</code>. Data will be read from the stream1035* as needed until end-of-file is reached. The JDBC driver will1036* do any necessary conversion from ASCII to the database char format.1037*1038* <P><B>Note:</B> This stream object can either be a standard1039* Java stream object or your own subclass that implements the1040* standard interface.1041*1042* @param parameterName the name of the parameter1043* @param x the Java input stream that contains the ASCII parameter value1044* @param length the number of bytes in the stream1045* @exception SQLException if parameterName does not correspond to a named1046* parameter; if a database access error occurs or1047* this method is called on a closed <code>CallableStatement</code>1048* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1049* this method1050* @since 1.41051*/1052void setAsciiStream(String parameterName, java.io.InputStream x, int length)1053throws SQLException;10541055/**1056* Sets the designated parameter to the given input stream, which will have1057* the specified number of bytes.1058* When a very large binary value is input to a <code>LONGVARBINARY</code>1059* parameter, it may be more practical to send it via a1060* <code>java.io.InputStream</code> object. The data will be read from the stream1061* as needed until end-of-file is reached.1062*1063* <P><B>Note:</B> This stream object can either be a standard1064* Java stream object or your own subclass that implements the1065* standard interface.1066*1067* @param parameterName the name of the parameter1068* @param x the java input stream which contains the binary parameter value1069* @param length the number of bytes in the stream1070* @exception SQLException if parameterName does not correspond to a named1071* parameter; if a database access error occurs or1072* this method is called on a closed <code>CallableStatement</code>1073* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1074* this method1075* @since 1.41076*/1077void setBinaryStream(String parameterName, java.io.InputStream x,1078int length) throws SQLException;10791080/**1081* Sets the value of the designated parameter with the given object.1082*1083* <p>The given Java object will be converted to the given targetSqlType1084* before being sent to the database.1085*1086* If the object has a custom mapping (is of a class implementing the1087* interface <code>SQLData</code>),1088* the JDBC driver should call the method <code>SQLData.writeSQL</code> to write it1089* to the SQL data stream.1090* If, on the other hand, the object is of a class implementing1091* <code>Ref</code>, <code>Blob</code>, <code>Clob</code>, <code>NClob</code>,1092* <code>Struct</code>, <code>java.net.URL</code>,1093* or <code>Array</code>, the driver should pass it to the database as a1094* value of the corresponding SQL type.1095* <P>1096* Note that this method may be used to pass datatabase-1097* specific abstract data types.1098*1099* @param parameterName the name of the parameter1100* @param x the object containing the input parameter value1101* @param targetSqlType the SQL type (as defined in java.sql.Types) to be1102* sent to the database. The scale argument may further qualify this type.1103* @param scale for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types,1104* this is the number of digits after the decimal point. For all other1105* types, this value will be ignored.1106* @exception SQLException if parameterName does not correspond to a named1107* parameter; if a database access error occurs or1108* this method is called on a closed <code>CallableStatement</code>1109* @exception SQLFeatureNotSupportedException if1110* the JDBC driver does not support the specified targetSqlType1111* @see Types1112* @see #getObject1113* @since 1.41114*/1115void setObject(String parameterName, Object x, int targetSqlType, int scale)1116throws SQLException;11171118/**1119* Sets the value of the designated parameter with the given object.1120*1121* This method is similar to {@link #setObject(String parameterName,1122* Object x, int targetSqlType, int scaleOrLength)},1123* except that it assumes a scale of zero.1124*1125* @param parameterName the name of the parameter1126* @param x the object containing the input parameter value1127* @param targetSqlType the SQL type (as defined in java.sql.Types) to be1128* sent to the database1129* @exception SQLException if parameterName does not correspond to a named1130* parameter; if a database access error occurs or1131* this method is called on a closed <code>CallableStatement</code>1132* @exception SQLFeatureNotSupportedException if1133* the JDBC driver does not support the specified targetSqlType1134* @see #getObject1135* @since 1.41136*/1137void setObject(String parameterName, Object x, int targetSqlType)1138throws SQLException;11391140/**1141* Sets the value of the designated parameter with the given object.1142*1143* <p>The JDBC specification specifies a standard mapping from1144* Java <code>Object</code> types to SQL types. The given argument1145* will be converted to the corresponding SQL type before being1146* sent to the database.1147* <p>Note that this method may be used to pass datatabase-1148* specific abstract data types, by using a driver-specific Java1149* type.1150*1151* If the object is of a class implementing the interface <code>SQLData</code>,1152* the JDBC driver should call the method <code>SQLData.writeSQL</code>1153* to write it to the SQL data stream.1154* If, on the other hand, the object is of a class implementing1155* <code>Ref</code>, <code>Blob</code>, <code>Clob</code>, <code>NClob</code>,1156* <code>Struct</code>, <code>java.net.URL</code>,1157* or <code>Array</code>, the driver should pass it to the database as a1158* value of the corresponding SQL type.1159* <P>1160* This method throws an exception if there is an ambiguity, for example, if the1161* object is of a class implementing more than one of the interfaces named above.1162*<p>1163*<b>Note:</b> Not all databases allow for a non-typed Null to be sent to1164* the backend. For maximum portability, the <code>setNull</code> or the1165* <code>setObject(String parameterName, Object x, int sqlType)</code>1166* method should be used1167* instead of <code>setObject(String parameterName, Object x)</code>.1168*<p>1169* @param parameterName the name of the parameter1170* @param x the object containing the input parameter value1171* @exception SQLException if parameterName does not correspond to a named1172* parameter; if a database access error occurs,1173* this method is called on a closed <code>CallableStatement</code> or if the given1174* <code>Object</code> parameter is ambiguous1175* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1176* this method1177* @see #getObject1178* @since 1.41179*/1180void setObject(String parameterName, Object x) throws SQLException;118111821183/**1184* Sets the designated parameter to the given <code>Reader</code>1185* object, which is the given number of characters long.1186* When a very large UNICODE value is input to a <code>LONGVARCHAR</code>1187* parameter, it may be more practical to send it via a1188* <code>java.io.Reader</code> object. The data will be read from the stream1189* as needed until end-of-file is reached. The JDBC driver will1190* do any necessary conversion from UNICODE to the database char format.1191*1192* <P><B>Note:</B> This stream object can either be a standard1193* Java stream object or your own subclass that implements the1194* standard interface.1195*1196* @param parameterName the name of the parameter1197* @param reader the <code>java.io.Reader</code> object that1198* contains the UNICODE data used as the designated parameter1199* @param length the number of characters in the stream1200* @exception SQLException if parameterName does not correspond to a named1201* parameter; if a database access error occurs or1202* this method is called on a closed <code>CallableStatement</code>1203* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1204* this method1205* @since 1.41206*/1207void setCharacterStream(String parameterName,1208java.io.Reader reader,1209int length) throws SQLException;12101211/**1212* Sets the designated parameter to the given <code>java.sql.Date</code> value,1213* using the given <code>Calendar</code> object. The driver uses1214* the <code>Calendar</code> object to construct an SQL <code>DATE</code> value,1215* which the driver then sends to the database. With a1216* a <code>Calendar</code> object, the driver can calculate the date1217* taking into account a custom timezone. If no1218* <code>Calendar</code> object is specified, the driver uses the default1219* timezone, which is that of the virtual machine running the application.1220*1221* @param parameterName the name of the parameter1222* @param x the parameter value1223* @param cal the <code>Calendar</code> object the driver will use1224* to construct the date1225* @exception SQLException if parameterName does not correspond to a named1226* parameter; if a database access error occurs or1227* this method is called on a closed <code>CallableStatement</code>1228* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1229* this method1230* @see #getDate1231* @since 1.41232*/1233void setDate(String parameterName, java.sql.Date x, Calendar cal)1234throws SQLException;12351236/**1237* Sets the designated parameter to the given <code>java.sql.Time</code> value,1238* using the given <code>Calendar</code> object. The driver uses1239* the <code>Calendar</code> object to construct an SQL <code>TIME</code> value,1240* which the driver then sends to the database. With a1241* a <code>Calendar</code> object, the driver can calculate the time1242* taking into account a custom timezone. If no1243* <code>Calendar</code> object is specified, the driver uses the default1244* timezone, which is that of the virtual machine running the application.1245*1246* @param parameterName the name of the parameter1247* @param x the parameter value1248* @param cal the <code>Calendar</code> object the driver will use1249* to construct the time1250* @exception SQLException if parameterName does not correspond to a named1251* parameter; if a database access error occurs or1252* this method is called on a closed <code>CallableStatement</code>1253* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1254* this method1255* @see #getTime1256* @since 1.41257*/1258void setTime(String parameterName, java.sql.Time x, Calendar cal)1259throws SQLException;12601261/**1262* Sets the designated parameter to the given <code>java.sql.Timestamp</code> value,1263* using the given <code>Calendar</code> object. The driver uses1264* the <code>Calendar</code> object to construct an SQL <code>TIMESTAMP</code> value,1265* which the driver then sends to the database. With a1266* a <code>Calendar</code> object, the driver can calculate the timestamp1267* taking into account a custom timezone. If no1268* <code>Calendar</code> object is specified, the driver uses the default1269* timezone, which is that of the virtual machine running the application.1270*1271* @param parameterName the name of the parameter1272* @param x the parameter value1273* @param cal the <code>Calendar</code> object the driver will use1274* to construct the timestamp1275* @exception SQLException if parameterName does not correspond to a named1276* parameter; if a database access error occurs or1277* this method is called on a closed <code>CallableStatement</code>1278* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1279* this method1280* @see #getTimestamp1281* @since 1.41282*/1283void setTimestamp(String parameterName, java.sql.Timestamp x, Calendar cal)1284throws SQLException;12851286/**1287* Sets the designated parameter to SQL <code>NULL</code>.1288* This version of the method <code>setNull</code> should1289* be used for user-defined types and REF type parameters. Examples1290* of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and1291* named array types.1292*1293* <P><B>Note:</B> To be portable, applications must give the1294* SQL type code and the fully-qualified SQL type name when specifying1295* a NULL user-defined or REF parameter. In the case of a user-defined type1296* the name is the type name of the parameter itself. For a REF1297* parameter, the name is the type name of the referenced type.1298* <p>1299* Although it is intended for user-defined and Ref parameters,1300* this method may be used to set a null parameter of any JDBC type.1301* If the parameter does not have a user-defined or REF type, the given1302* typeName is ignored.1303*1304*1305* @param parameterName the name of the parameter1306* @param sqlType a value from <code>java.sql.Types</code>1307* @param typeName the fully-qualified name of an SQL user-defined type;1308* ignored if the parameter is not a user-defined type or1309* SQL <code>REF</code> value1310* @exception SQLException if parameterName does not correspond to a named1311* parameter; if a database access error occurs or1312* this method is called on a closed <code>CallableStatement</code>1313* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1314* this method1315* @since 1.41316*/1317void setNull (String parameterName, int sqlType, String typeName)1318throws SQLException;13191320/**1321* Retrieves the value of a JDBC <code>CHAR</code>, <code>VARCHAR</code>,1322* or <code>LONGVARCHAR</code> parameter as a <code>String</code> in1323* the Java programming language.1324* <p>1325* For the fixed-length type JDBC <code>CHAR</code>,1326* the <code>String</code> object1327* returned has exactly the same value the SQL1328* <code>CHAR</code> value had in the1329* database, including any padding added by the database.1330* @param parameterName the name of the parameter1331* @return the parameter value. If the value is SQL <code>NULL</code>, the result1332* is <code>null</code>.1333* @exception SQLException if parameterName does not correspond to a named1334* parameter; if a database access error occurs or1335* this method is called on a closed <code>CallableStatement</code>1336* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1337* this method1338* @see #setString1339* @since 1.41340*/1341String getString(String parameterName) throws SQLException;13421343/**1344* Retrieves the value of a JDBC <code>BIT</code> or <code>BOOLEAN</code>1345* parameter as a1346* <code>boolean</code> in the Java programming language.1347* @param parameterName the name of the parameter1348* @return the parameter value. If the value is SQL <code>NULL</code>, the result1349* is <code>false</code>.1350* @exception SQLException if parameterName does not correspond to a named1351* parameter; if a database access error occurs or1352* this method is called on a closed <code>CallableStatement</code>1353* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1354* this method1355* @see #setBoolean1356* @since 1.41357*/1358boolean getBoolean(String parameterName) throws SQLException;13591360/**1361* Retrieves the value of a JDBC <code>TINYINT</code> parameter as a <code>byte</code>1362* in the Java programming language.1363* @param parameterName the name of the parameter1364* @return the parameter value. If the value is SQL <code>NULL</code>, the result1365* is <code>0</code>.1366* @exception SQLException if parameterName does not correspond to a named1367* parameter; if a database access error occurs or1368* this method is called on a closed <code>CallableStatement</code>1369* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1370* this method1371* @see #setByte1372* @since 1.41373*/1374byte getByte(String parameterName) throws SQLException;13751376/**1377* Retrieves the value of a JDBC <code>SMALLINT</code> parameter as a <code>short</code>1378* in the Java programming language.1379* @param parameterName the name of the parameter1380* @return the parameter value. If the value is SQL <code>NULL</code>, the result1381* is <code>0</code>.1382* @exception SQLException if parameterName does not correspond to a named1383* parameter; if a database access error occurs or1384* this method is called on a closed <code>CallableStatement</code>1385* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1386* this method1387* @see #setShort1388* @since 1.41389*/1390short getShort(String parameterName) throws SQLException;13911392/**1393* Retrieves the value of a JDBC <code>INTEGER</code> parameter as an <code>int</code>1394* in the Java programming language.1395*1396* @param parameterName the name of the parameter1397* @return the parameter value. If the value is SQL <code>NULL</code>,1398* the result is <code>0</code>.1399* @exception SQLException if parameterName does not correspond to a named1400* parameter; if a database access error occurs or1401* this method is called on a closed <code>CallableStatement</code>1402* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1403* this method1404* @see #setInt1405* @since 1.41406*/1407int getInt(String parameterName) throws SQLException;14081409/**1410* Retrieves the value of a JDBC <code>BIGINT</code> parameter as a <code>long</code>1411* in the Java programming language.1412*1413* @param parameterName the name of the parameter1414* @return the parameter value. If the value is SQL <code>NULL</code>,1415* the result is <code>0</code>.1416* @exception SQLException if parameterName does not correspond to a named1417* parameter; if a database access error occurs or1418* this method is called on a closed <code>CallableStatement</code>1419* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1420* this method1421* @see #setLong1422* @since 1.41423*/1424long getLong(String parameterName) throws SQLException;14251426/**1427* Retrieves the value of a JDBC <code>FLOAT</code> parameter as a <code>float</code>1428* in the Java programming language.1429* @param parameterName the name of the parameter1430* @return the parameter value. If the value is SQL <code>NULL</code>,1431* the result is <code>0</code>.1432* @exception SQLException if parameterName does not correspond to a named1433* parameter; if a database access error occurs or1434* this method is called on a closed <code>CallableStatement</code>1435* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1436* this method1437* @see #setFloat1438* @since 1.41439*/1440float getFloat(String parameterName) throws SQLException;14411442/**1443* Retrieves the value of a JDBC <code>DOUBLE</code> parameter as a <code>double</code>1444* in the Java programming language.1445* @param parameterName the name of the parameter1446* @return the parameter value. If the value is SQL <code>NULL</code>,1447* the result is <code>0</code>.1448* @exception SQLException if parameterName does not correspond to a named1449* parameter; if a database access error occurs or1450* this method is called on a closed <code>CallableStatement</code>1451* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1452* this method1453* @see #setDouble1454* @since 1.41455*/1456double getDouble(String parameterName) throws SQLException;14571458/**1459* Retrieves the value of a JDBC <code>BINARY</code> or <code>VARBINARY</code>1460* parameter as an array of <code>byte</code> values in the Java1461* programming language.1462* @param parameterName the name of the parameter1463* @return the parameter value. If the value is SQL <code>NULL</code>, the result is1464* <code>null</code>.1465* @exception SQLException if parameterName does not correspond to a named1466* parameter; if a database access error occurs or1467* this method is called on a closed <code>CallableStatement</code>1468* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1469* this method1470* @see #setBytes1471* @since 1.41472*/1473byte[] getBytes(String parameterName) throws SQLException;14741475/**1476* Retrieves the value of a JDBC <code>DATE</code> parameter as a1477* <code>java.sql.Date</code> object.1478* @param parameterName the name of the parameter1479* @return the parameter value. If the value is SQL <code>NULL</code>, the result1480* is <code>null</code>.1481* @exception SQLException if parameterName does not correspond to a named1482* parameter; if a database access error occurs or1483* this method is called on a closed <code>CallableStatement</code>1484* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1485* this method1486* @see #setDate1487* @since 1.41488*/1489java.sql.Date getDate(String parameterName) throws SQLException;14901491/**1492* Retrieves the value of a JDBC <code>TIME</code> parameter as a1493* <code>java.sql.Time</code> object.1494* @param parameterName the name of the parameter1495* @return the parameter value. If the value is SQL <code>NULL</code>, the result1496* is <code>null</code>.1497* @exception SQLException if parameterName does not correspond to a named1498* parameter; if a database access error occurs or1499* this method is called on a closed <code>CallableStatement</code>1500* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1501* this method1502* @see #setTime1503* @since 1.41504*/1505java.sql.Time getTime(String parameterName) throws SQLException;15061507/**1508* Retrieves the value of a JDBC <code>TIMESTAMP</code> parameter as a1509* <code>java.sql.Timestamp</code> object.1510* @param parameterName the name of the parameter1511* @return the parameter value. If the value is SQL <code>NULL</code>, the result1512* is <code>null</code>.1513* @exception SQLException if parameterName does not correspond to a named1514* parameter; if a database access error occurs or1515* this method is called on a closed <code>CallableStatement</code>1516* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1517* this method1518* @see #setTimestamp1519* @since 1.41520*/1521java.sql.Timestamp getTimestamp(String parameterName) throws SQLException;15221523/**1524* Retrieves the value of a parameter as an <code>Object</code> in the Java1525* programming language. If the value is an SQL <code>NULL</code>, the1526* driver returns a Java <code>null</code>.1527* <p>1528* This method returns a Java object whose type corresponds to the JDBC1529* type that was registered for this parameter using the method1530* <code>registerOutParameter</code>. By registering the target JDBC1531* type as <code>java.sql.Types.OTHER</code>, this method can be used1532* to read database-specific abstract data types.1533* @param parameterName the name of the parameter1534* @return A <code>java.lang.Object</code> holding the OUT parameter value.1535* @exception SQLException if parameterName does not correspond to a named1536* parameter; if a database access error occurs or1537* this method is called on a closed <code>CallableStatement</code>1538* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1539* this method1540* @see Types1541* @see #setObject1542* @since 1.41543*/1544Object getObject(String parameterName) throws SQLException;15451546/**1547* Retrieves the value of a JDBC <code>NUMERIC</code> parameter as a1548* <code>java.math.BigDecimal</code> object with as many digits to the1549* right of the decimal point as the value contains.1550* @param parameterName the name of the parameter1551* @return the parameter value in full precision. If the value is1552* SQL <code>NULL</code>, the result is <code>null</code>.1553* @exception SQLException if parameterName does not correspond to a named1554* parameter; if a database access error occurs or1555* this method is called on a closed <code>CallableStatement</code>1556* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1557* this method1558* @see #setBigDecimal1559* @since 1.41560*/1561BigDecimal getBigDecimal(String parameterName) throws SQLException;15621563/**1564* Returns an object representing the value of OUT parameter1565* <code>parameterName</code> and uses <code>map</code> for the custom1566* mapping of the parameter value.1567* <p>1568* This method returns a Java object whose type corresponds to the1569* JDBC type that was registered for this parameter using the method1570* <code>registerOutParameter</code>. By registering the target1571* JDBC type as <code>java.sql.Types.OTHER</code>, this method can1572* be used to read database-specific abstract data types.1573* @param parameterName the name of the parameter1574* @param map the mapping from SQL type names to Java classes1575* @return a <code>java.lang.Object</code> holding the OUT parameter value1576* @exception SQLException if parameterName does not correspond to a named1577* parameter; if a database access error occurs or1578* this method is called on a closed <code>CallableStatement</code>1579* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1580* this method1581* @see #setObject1582* @since 1.41583*/1584Object getObject(String parameterName, java.util.Map<String,Class<?>> map)1585throws SQLException;15861587/**1588* Retrieves the value of a JDBC <code>REF(<structured-type>)</code>1589* parameter as a {@link java.sql.Ref} object in the Java programming language.1590*1591* @param parameterName the name of the parameter1592* @return the parameter value as a <code>Ref</code> object in the1593* Java programming language. If the value was SQL <code>NULL</code>,1594* the value <code>null</code> is returned.1595* @exception SQLException if parameterName does not correspond to a named1596* parameter; if a database access error occurs or1597* this method is called on a closed <code>CallableStatement</code>1598* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1599* this method1600* @since 1.41601*/1602Ref getRef (String parameterName) throws SQLException;16031604/**1605* Retrieves the value of a JDBC <code>BLOB</code> parameter as a1606* {@link java.sql.Blob} object in the Java programming language.1607*1608* @param parameterName the name of the parameter1609* @return the parameter value as a <code>Blob</code> object in the1610* Java programming language. If the value was SQL <code>NULL</code>,1611* the value <code>null</code> is returned.1612* @exception SQLException if parameterName does not correspond to a named1613* parameter; if a database access error occurs or1614* this method is called on a closed <code>CallableStatement</code>1615* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1616* this method1617* @since 1.41618*/1619Blob getBlob (String parameterName) throws SQLException;16201621/**1622* Retrieves the value of a JDBC <code>CLOB</code> parameter as a1623* <code>java.sql.Clob</code> object in the Java programming language.1624* @param parameterName the name of the parameter1625* @return the parameter value as a <code>Clob</code> object in the1626* Java programming language. If the value was SQL <code>NULL</code>,1627* the value <code>null</code> is returned.1628* @exception SQLException if parameterName does not correspond to a named1629* parameter; if a database access error occurs or1630* this method is called on a closed <code>CallableStatement</code>1631* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1632* this method1633* @since 1.41634*/1635Clob getClob (String parameterName) throws SQLException;16361637/**1638* Retrieves the value of a JDBC <code>ARRAY</code> parameter as an1639* {@link java.sql.Array} object in the Java programming language.1640*1641* @param parameterName the name of the parameter1642* @return the parameter value as an <code>Array</code> object in1643* Java programming language. If the value was SQL <code>NULL</code>,1644* the value <code>null</code> is returned.1645* @exception SQLException if parameterName does not correspond to a named1646* parameter; if a database access error occurs or1647* this method is called on a closed <code>CallableStatement</code>1648* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1649* this method1650* @since 1.41651*/1652Array getArray (String parameterName) throws SQLException;16531654/**1655* Retrieves the value of a JDBC <code>DATE</code> parameter as a1656* <code>java.sql.Date</code> object, using1657* the given <code>Calendar</code> object1658* to construct the date.1659* With a <code>Calendar</code> object, the driver1660* can calculate the date taking into account a custom timezone and locale.1661* If no <code>Calendar</code> object is specified, the driver uses the1662* default timezone and locale.1663*1664* @param parameterName the name of the parameter1665* @param cal the <code>Calendar</code> object the driver will use1666* to construct the date1667* @return the parameter value. If the value is SQL <code>NULL</code>,1668* the result is <code>null</code>.1669* @exception SQLException if parameterName does not correspond to a named1670* parameter; if a database access error occurs or1671* this method is called on a closed <code>CallableStatement</code>1672* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1673* this method1674* @see #setDate1675* @since 1.41676*/1677java.sql.Date getDate(String parameterName, Calendar cal)1678throws SQLException;16791680/**1681* Retrieves the value of a JDBC <code>TIME</code> parameter as a1682* <code>java.sql.Time</code> object, using1683* the given <code>Calendar</code> object1684* to construct the time.1685* With a <code>Calendar</code> object, the driver1686* can calculate the time taking into account a custom timezone and locale.1687* If no <code>Calendar</code> object is specified, the driver uses the1688* default timezone and locale.1689*1690* @param parameterName the name of the parameter1691* @param cal the <code>Calendar</code> object the driver will use1692* to construct the time1693* @return the parameter value; if the value is SQL <code>NULL</code>, the result is1694* <code>null</code>.1695* @exception SQLException if parameterName does not correspond to a named1696* parameter; if a database access error occurs or1697* this method is called on a closed <code>CallableStatement</code>1698* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1699* this method1700* @see #setTime1701* @since 1.41702*/1703java.sql.Time getTime(String parameterName, Calendar cal)1704throws SQLException;17051706/**1707* Retrieves the value of a JDBC <code>TIMESTAMP</code> parameter as a1708* <code>java.sql.Timestamp</code> object, using1709* the given <code>Calendar</code> object to construct1710* the <code>Timestamp</code> object.1711* With a <code>Calendar</code> object, the driver1712* can calculate the timestamp taking into account a custom timezone and locale.1713* If no <code>Calendar</code> object is specified, the driver uses the1714* default timezone and locale.1715*1716*1717* @param parameterName the name of the parameter1718* @param cal the <code>Calendar</code> object the driver will use1719* to construct the timestamp1720* @return the parameter value. If the value is SQL <code>NULL</code>, the result is1721* <code>null</code>.1722* @exception SQLException if parameterName does not correspond to a named1723* parameter; if a database access error occurs or1724* this method is called on a closed <code>CallableStatement</code>1725* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1726* this method1727* @see #setTimestamp1728* @since 1.41729*/1730java.sql.Timestamp getTimestamp(String parameterName, Calendar cal)1731throws SQLException;17321733/**1734* Retrieves the value of a JDBC <code>DATALINK</code> parameter as a1735* <code>java.net.URL</code> object.1736*1737* @param parameterName the name of the parameter1738* @return the parameter value as a <code>java.net.URL</code> object in the1739* Java programming language. If the value was SQL <code>NULL</code>, the1740* value <code>null</code> is returned.1741* @exception SQLException if parameterName does not correspond to a named1742* parameter; if a database access error occurs,1743* this method is called on a closed <code>CallableStatement</code>,1744* or if there is a problem with the URL1745* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1746* this method1747* @see #setURL1748* @since 1.41749*/1750java.net.URL getURL(String parameterName) throws SQLException;17511752//------------------------- JDBC 4.0 -----------------------------------17531754/**1755* Retrieves the value of the designated JDBC <code>ROWID</code> parameter as a1756* <code>java.sql.RowId</code> object.1757*1758* @param parameterIndex the first parameter is 1, the second is 2,...1759* @return a <code>RowId</code> object that represents the JDBC <code>ROWID</code>1760* value is used as the designated parameter. If the parameter contains1761* a SQL <code>NULL</code>, then a <code>null</code> value is returned.1762* @throws SQLException if the parameterIndex is not valid;1763* if a database access error occurs or1764* this method is called on a closed <code>CallableStatement</code>1765* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1766* this method1767* @since 1.61768*/1769RowId getRowId(int parameterIndex) throws SQLException;17701771/**1772* Retrieves the value of the designated JDBC <code>ROWID</code> parameter as a1773* <code>java.sql.RowId</code> object.1774*1775* @param parameterName the name of the parameter1776* @return a <code>RowId</code> object that represents the JDBC <code>ROWID</code>1777* value is used as the designated parameter. If the parameter contains1778* a SQL <code>NULL</code>, then a <code>null</code> value is returned.1779* @throws SQLException if parameterName does not correspond to a named1780* parameter; if a database access error occurs or1781* this method is called on a closed <code>CallableStatement</code>1782* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1783* this method1784* @since 1.61785*/1786RowId getRowId(String parameterName) throws SQLException;17871788/**1789* Sets the designated parameter to the given <code>java.sql.RowId</code> object. The1790* driver converts this to a SQL <code>ROWID</code> when it sends it to the1791* database.1792*1793* @param parameterName the name of the parameter1794* @param x the parameter value1795* @throws SQLException if parameterName does not correspond to a named1796* parameter; if a database access error occurs or1797* this method is called on a closed <code>CallableStatement</code>1798* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1799* this method1800* @since 1.61801*/1802void setRowId(String parameterName, RowId x) throws SQLException;18031804/**1805* Sets the designated parameter to the given <code>String</code> object.1806* The driver converts this to a SQL <code>NCHAR</code> or1807* <code>NVARCHAR</code> or <code>LONGNVARCHAR</code>1808* @param parameterName the name of the parameter to be set1809* @param value the parameter value1810* @throws SQLException if parameterName does not correspond to a named1811* parameter; if the driver does not support national1812* character sets; if the driver can detect that a data conversion1813* error could occur; if a database access error occurs or1814* this method is called on a closed <code>CallableStatement</code>1815* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1816* this method1817* @since 1.61818*/1819void setNString(String parameterName, String value)1820throws SQLException;18211822/**1823* Sets the designated parameter to a <code>Reader</code> object. The1824* <code>Reader</code> reads the data till end-of-file is reached. The1825* driver does the necessary conversion from Java character format to1826* the national character set in the database.1827* @param parameterName the name of the parameter to be set1828* @param value the parameter value1829* @param length the number of characters in the parameter data.1830* @throws SQLException if parameterName does not correspond to a named1831* parameter; if the driver does not support national1832* character sets; if the driver can detect that a data conversion1833* error could occur; if a database access error occurs or1834* this method is called on a closed <code>CallableStatement</code>1835* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1836* this method1837* @since 1.61838*/1839void setNCharacterStream(String parameterName, Reader value, long length)1840throws SQLException;18411842/**1843* Sets the designated parameter to a <code>java.sql.NClob</code> object. The object1844* implements the <code>java.sql.NClob</code> interface. This <code>NClob</code>1845* object maps to a SQL <code>NCLOB</code>.1846* @param parameterName the name of the parameter to be set1847* @param value the parameter value1848* @throws SQLException if parameterName does not correspond to a named1849* parameter; if the driver does not support national1850* character sets; if the driver can detect that a data conversion1851* error could occur; if a database access error occurs or1852* this method is called on a closed <code>CallableStatement</code>1853* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1854* this method1855* @since 1.61856*/1857void setNClob(String parameterName, NClob value) throws SQLException;18581859/**1860* Sets the designated parameter to a <code>Reader</code> object. The <code>reader</code> must contain the number1861* of characters specified by length otherwise a <code>SQLException</code> will be1862* generated when the <code>CallableStatement</code> is executed.1863* This method differs from the <code>setCharacterStream (int, Reader, int)</code> method1864* because it informs the driver that the parameter value should be sent to1865* the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the1866* driver may have to do extra work to determine whether the parameter1867* data should be send to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>1868* @param parameterName the name of the parameter to be set1869* @param reader An object that contains the data to set the parameter value to.1870* @param length the number of characters in the parameter data.1871* @throws SQLException if parameterName does not correspond to a named1872* parameter; if the length specified is less than zero;1873* a database access error occurs or1874* this method is called on a closed <code>CallableStatement</code>1875* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1876* this method1877*1878* @since 1.61879*/1880void setClob(String parameterName, Reader reader, long length)1881throws SQLException;18821883/**1884* Sets the designated parameter to a <code>InputStream</code> object. The <code>inputstream</code> must contain the number1885* of characters specified by length, otherwise a <code>SQLException</code> will be1886* generated when the <code>CallableStatement</code> is executed.1887* This method differs from the <code>setBinaryStream (int, InputStream, int)</code>1888* method because it informs the driver that the parameter value should be1889* sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used,1890* the driver may have to do extra work to determine whether the parameter1891* data should be sent to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>1892*1893* @param parameterName the name of the parameter to be set1894* the second is 2, ...1895*1896* @param inputStream An object that contains the data to set the parameter1897* value to.1898* @param length the number of bytes in the parameter data.1899* @throws SQLException if parameterName does not correspond to a named1900* parameter; if the length specified1901* is less than zero; if the number of bytes in the inputstream does not match1902* the specified length; if a database access error occurs or1903* this method is called on a closed <code>CallableStatement</code>1904* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1905* this method1906*1907* @since 1.61908*/1909void setBlob(String parameterName, InputStream inputStream, long length)1910throws SQLException;1911/**1912* Sets the designated parameter to a <code>Reader</code> object. The <code>reader</code> must contain the number1913* of characters specified by length otherwise a <code>SQLException</code> will be1914* generated when the <code>CallableStatement</code> is executed.1915* This method differs from the <code>setCharacterStream (int, Reader, int)</code> method1916* because it informs the driver that the parameter value should be sent to1917* the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the1918* driver may have to do extra work to determine whether the parameter1919* data should be send to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>1920*1921* @param parameterName the name of the parameter to be set1922* @param reader An object that contains the data to set the parameter value to.1923* @param length the number of characters in the parameter data.1924* @throws SQLException if parameterName does not correspond to a named1925* parameter; if the length specified is less than zero;1926* if the driver does not support national1927* character sets; if the driver can detect that a data conversion1928* error could occur; if a database access error occurs or1929* this method is called on a closed <code>CallableStatement</code>1930* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1931* this method1932* @since 1.61933*/1934void setNClob(String parameterName, Reader reader, long length)1935throws SQLException;19361937/**1938* Retrieves the value of the designated JDBC <code>NCLOB</code> parameter as a1939* <code>java.sql.NClob</code> object in the Java programming language.1940*1941* @param parameterIndex the first parameter is 1, the second is 2, and1942* so on1943* @return the parameter value as a <code>NClob</code> object in the1944* Java programming language. If the value was SQL <code>NULL</code>, the1945* value <code>null</code> is returned.1946* @exception SQLException if the parameterIndex is not valid;1947* if the driver does not support national1948* character sets; if the driver can detect that a data conversion1949* error could occur; if a database access error occurs or1950* this method is called on a closed <code>CallableStatement</code>1951* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1952* this method1953* @since 1.61954*/1955NClob getNClob (int parameterIndex) throws SQLException;195619571958/**1959* Retrieves the value of a JDBC <code>NCLOB</code> parameter as a1960* <code>java.sql.NClob</code> object in the Java programming language.1961* @param parameterName the name of the parameter1962* @return the parameter value as a <code>NClob</code> object in the1963* Java programming language. If the value was SQL <code>NULL</code>,1964* the value <code>null</code> is returned.1965* @exception SQLException if parameterName does not correspond to a named1966* parameter; if the driver does not support national1967* character sets; if the driver can detect that a data conversion1968* error could occur; if a database access error occurs or1969* this method is called on a closed <code>CallableStatement</code>1970* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1971* this method1972* @since 1.61973*/1974NClob getNClob (String parameterName) throws SQLException;19751976/**1977* Sets the designated parameter to the given <code>java.sql.SQLXML</code> object. The driver converts this to an1978* <code>SQL XML</code> value when it sends it to the database.1979*1980* @param parameterName the name of the parameter1981* @param xmlObject a <code>SQLXML</code> object that maps an <code>SQL XML</code> value1982* @throws SQLException if parameterName does not correspond to a named1983* parameter; if a database access error occurs;1984* this method is called on a closed <code>CallableStatement</code> or1985* the <code>java.xml.transform.Result</code>,1986* <code>Writer</code> or <code>OutputStream</code> has not been closed for the <code>SQLXML</code> object1987* @exception SQLFeatureNotSupportedException if the JDBC driver does not support1988* this method1989*1990* @since 1.61991*/1992void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException;19931994/**1995* Retrieves the value of the designated <code>SQL XML</code> parameter as a1996* <code>java.sql.SQLXML</code> object in the Java programming language.1997* @param parameterIndex index of the first parameter is 1, the second is 2, ...1998* @return a <code>SQLXML</code> object that maps an <code>SQL XML</code> value1999* @throws SQLException if the parameterIndex is not valid;2000* if a database access error occurs or2001* this method is called on a closed <code>CallableStatement</code>2002* @exception SQLFeatureNotSupportedException if the JDBC driver does not support2003* this method2004* @since 1.62005*/2006SQLXML getSQLXML(int parameterIndex) throws SQLException;20072008/**2009* Retrieves the value of the designated <code>SQL XML</code> parameter as a2010* <code>java.sql.SQLXML</code> object in the Java programming language.2011* @param parameterName the name of the parameter2012* @return a <code>SQLXML</code> object that maps an <code>SQL XML</code> value2013* @throws SQLException if parameterName does not correspond to a named2014* parameter; if a database access error occurs or2015* this method is called on a closed <code>CallableStatement</code>2016* @exception SQLFeatureNotSupportedException if the JDBC driver does not support2017* this method2018* @since 1.62019*/2020SQLXML getSQLXML(String parameterName) throws SQLException;20212022/**2023* Retrieves the value of the designated <code>NCHAR</code>,2024* <code>NVARCHAR</code>2025* or <code>LONGNVARCHAR</code> parameter as2026* a <code>String</code> in the Java programming language.2027* <p>2028* For the fixed-length type JDBC <code>NCHAR</code>,2029* the <code>String</code> object2030* returned has exactly the same value the SQL2031* <code>NCHAR</code> value had in the2032* database, including any padding added by the database.2033*2034* @param parameterIndex index of the first parameter is 1, the second is 2, ...2035* @return a <code>String</code> object that maps an2036* <code>NCHAR</code>, <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value2037* @exception SQLException if the parameterIndex is not valid;2038* if a database access error occurs or2039* this method is called on a closed <code>CallableStatement</code>2040* @exception SQLFeatureNotSupportedException if the JDBC driver does not support2041* this method2042* @since 1.62043* @see #setNString2044*/2045String getNString(int parameterIndex) throws SQLException;204620472048/**2049* Retrieves the value of the designated <code>NCHAR</code>,2050* <code>NVARCHAR</code>2051* or <code>LONGNVARCHAR</code> parameter as2052* a <code>String</code> in the Java programming language.2053* <p>2054* For the fixed-length type JDBC <code>NCHAR</code>,2055* the <code>String</code> object2056* returned has exactly the same value the SQL2057* <code>NCHAR</code> value had in the2058* database, including any padding added by the database.2059*2060* @param parameterName the name of the parameter2061* @return a <code>String</code> object that maps an2062* <code>NCHAR</code>, <code>NVARCHAR</code> or <code>LONGNVARCHAR</code> value2063* @exception SQLException if parameterName does not correspond to a named2064* parameter;2065* if a database access error occurs or2066* this method is called on a closed <code>CallableStatement</code>2067* @exception SQLFeatureNotSupportedException if the JDBC driver does not support2068* this method2069* @since 1.62070* @see #setNString2071*/2072String getNString(String parameterName) throws SQLException;20732074/**2075* Retrieves the value of the designated parameter as a2076* <code>java.io.Reader</code> object in the Java programming language.2077* It is intended for use when2078* accessing <code>NCHAR</code>,<code>NVARCHAR</code>2079* and <code>LONGNVARCHAR</code> parameters.2080*2081* @return a <code>java.io.Reader</code> object that contains the parameter2082* value; if the value is SQL <code>NULL</code>, the value returned is2083* <code>null</code> in the Java programming language.2084* @param parameterIndex the first parameter is 1, the second is 2, ...2085* @exception SQLException if the parameterIndex is not valid;2086* if a database access error occurs or2087* this method is called on a closed <code>CallableStatement</code>2088* @exception SQLFeatureNotSupportedException if the JDBC driver does not support2089* this method2090* @since 1.62091*/2092java.io.Reader getNCharacterStream(int parameterIndex) throws SQLException;20932094/**2095* Retrieves the value of the designated parameter as a2096* <code>java.io.Reader</code> object in the Java programming language.2097* It is intended for use when2098* accessing <code>NCHAR</code>,<code>NVARCHAR</code>2099* and <code>LONGNVARCHAR</code> parameters.2100*2101* @param parameterName the name of the parameter2102* @return a <code>java.io.Reader</code> object that contains the parameter2103* value; if the value is SQL <code>NULL</code>, the value returned is2104* <code>null</code> in the Java programming language2105* @exception SQLException if parameterName does not correspond to a named2106* parameter; if a database access error occurs or2107* this method is called on a closed <code>CallableStatement</code>2108* @exception SQLFeatureNotSupportedException if the JDBC driver does not support2109* this method2110* @since 1.62111*/2112java.io.Reader getNCharacterStream(String parameterName) throws SQLException;21132114/**2115* Retrieves the value of the designated parameter as a2116* <code>java.io.Reader</code> object in the Java programming language.2117*2118* @return a <code>java.io.Reader</code> object that contains the parameter2119* value; if the value is SQL <code>NULL</code>, the value returned is2120* <code>null</code> in the Java programming language.2121* @param parameterIndex the first parameter is 1, the second is 2, ...2122* @exception SQLException if the parameterIndex is not valid; if a database access error occurs or2123* this method is called on a closed <code>CallableStatement</code>2124* @since 1.62125*/2126java.io.Reader getCharacterStream(int parameterIndex) throws SQLException;21272128/**2129* Retrieves the value of the designated parameter as a2130* <code>java.io.Reader</code> object in the Java programming language.2131*2132* @param parameterName the name of the parameter2133* @return a <code>java.io.Reader</code> object that contains the parameter2134* value; if the value is SQL <code>NULL</code>, the value returned is2135* <code>null</code> in the Java programming language2136* @exception SQLException if parameterName does not correspond to a named2137* parameter; if a database access error occurs or2138* this method is called on a closed <code>CallableStatement</code>2139* @exception SQLFeatureNotSupportedException if the JDBC driver does not support2140* this method2141* @since 1.62142*/2143java.io.Reader getCharacterStream(String parameterName) throws SQLException;21442145/**2146* Sets the designated parameter to the given <code>java.sql.Blob</code> object.2147* The driver converts this to an SQL <code>BLOB</code> value when it2148* sends it to the database.2149*2150* @param parameterName the name of the parameter2151* @param x a <code>Blob</code> object that maps an SQL <code>BLOB</code> value2152* @exception SQLException if parameterName does not correspond to a named2153* parameter; if a database access error occurs or2154* this method is called on a closed <code>CallableStatement</code>2155* @exception SQLFeatureNotSupportedException if the JDBC driver does not support2156* this method2157* @since 1.62158*/2159void setBlob (String parameterName, Blob x) throws SQLException;21602161/**2162* Sets the designated parameter to the given <code>java.sql.Clob</code> object.2163* The driver converts this to an SQL <code>CLOB</code> value when it2164* sends it to the database.2165*2166* @param parameterName the name of the parameter2167* @param x a <code>Clob</code> object that maps an SQL <code>CLOB</code> value2168* @exception SQLException if parameterName does not correspond to a named2169* parameter; if a database access error occurs or2170* this method is called on a closed <code>CallableStatement</code>2171* @exception SQLFeatureNotSupportedException if the JDBC driver does not support2172* this method2173* @since 1.62174*/2175void setClob (String parameterName, Clob x) throws SQLException;2176/**2177* Sets the designated parameter to the given input stream, which will have2178* the specified number of bytes.2179* When a very large ASCII value is input to a <code>LONGVARCHAR</code>2180* parameter, it may be more practical to send it via a2181* <code>java.io.InputStream</code>. Data will be read from the stream2182* as needed until end-of-file is reached. The JDBC driver will2183* do any necessary conversion from ASCII to the database char format.2184*2185* <P><B>Note:</B> This stream object can either be a standard2186* Java stream object or your own subclass that implements the2187* standard interface.2188*2189* @param parameterName the name of the parameter2190* @param x the Java input stream that contains the ASCII parameter value2191* @param length the number of bytes in the stream2192* @exception SQLException if parameterName does not correspond to a named2193* parameter; if a database access error occurs or2194* this method is called on a closed <code>CallableStatement</code>2195* @exception SQLFeatureNotSupportedException if the JDBC driver does not support2196* this method2197* @since 1.62198*/2199void setAsciiStream(String parameterName, java.io.InputStream x, long length)2200throws SQLException;22012202/**2203* Sets the designated parameter to the given input stream, which will have2204* the specified number of bytes.2205* When a very large binary value is input to a <code>LONGVARBINARY</code>2206* parameter, it may be more practical to send it via a2207* <code>java.io.InputStream</code> object. The data will be read from the stream2208* as needed until end-of-file is reached.2209*2210* <P><B>Note:</B> This stream object can either be a standard2211* Java stream object or your own subclass that implements the2212* standard interface.2213*2214* @param parameterName the name of the parameter2215* @param x the java input stream which contains the binary parameter value2216* @param length the number of bytes in the stream2217* @exception SQLException if parameterName does not correspond to a named2218* parameter; if a database access error occurs or2219* this method is called on a closed <code>CallableStatement</code>2220* @exception SQLFeatureNotSupportedException if the JDBC driver does not support2221* this method2222* @since 1.62223*/2224void setBinaryStream(String parameterName, java.io.InputStream x,2225long length) throws SQLException;2226/**2227* Sets the designated parameter to the given <code>Reader</code>2228* object, which is the given number of characters long.2229* When a very large UNICODE value is input to a <code>LONGVARCHAR</code>2230* parameter, it may be more practical to send it via a2231* <code>java.io.Reader</code> object. The data will be read from the stream2232* as needed until end-of-file is reached. The JDBC driver will2233* do any necessary conversion from UNICODE to the database char format.2234*2235* <P><B>Note:</B> This stream object can either be a standard2236* Java stream object or your own subclass that implements the2237* standard interface.2238*2239* @param parameterName the name of the parameter2240* @param reader the <code>java.io.Reader</code> object that2241* contains the UNICODE data used as the designated parameter2242* @param length the number of characters in the stream2243* @exception SQLException if parameterName does not correspond to a named2244* parameter; if a database access error occurs or2245* this method is called on a closed <code>CallableStatement</code>2246* @exception SQLFeatureNotSupportedException if the JDBC driver does not support2247* this method2248* @since 1.62249*/2250void setCharacterStream(String parameterName,2251java.io.Reader reader,2252long length) throws SQLException;2253//--2254/**2255* Sets the designated parameter to the given input stream.2256* When a very large ASCII value is input to a <code>LONGVARCHAR</code>2257* parameter, it may be more practical to send it via a2258* <code>java.io.InputStream</code>. Data will be read from the stream2259* as needed until end-of-file is reached. The JDBC driver will2260* do any necessary conversion from ASCII to the database char format.2261*2262* <P><B>Note:</B> This stream object can either be a standard2263* Java stream object or your own subclass that implements the2264* standard interface.2265* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2266* it might be more efficient to use a version of2267* <code>setAsciiStream</code> which takes a length parameter.2268*2269* @param parameterName the name of the parameter2270* @param x the Java input stream that contains the ASCII parameter value2271* @exception SQLException if parameterName does not correspond to a named2272* parameter; if a database access error occurs or2273* this method is called on a closed <code>CallableStatement</code>2274* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2275* @since 1.62276*/2277void setAsciiStream(String parameterName, java.io.InputStream x)2278throws SQLException;2279/**2280* Sets the designated parameter to the given input stream.2281* When a very large binary value is input to a <code>LONGVARBINARY</code>2282* parameter, it may be more practical to send it via a2283* <code>java.io.InputStream</code> object. The data will be read from the2284* stream as needed until end-of-file is reached.2285*2286* <P><B>Note:</B> This stream object can either be a standard2287* Java stream object or your own subclass that implements the2288* standard interface.2289* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2290* it might be more efficient to use a version of2291* <code>setBinaryStream</code> which takes a length parameter.2292*2293* @param parameterName the name of the parameter2294* @param x the java input stream which contains the binary parameter value2295* @exception SQLException if parameterName does not correspond to a named2296* parameter; if a database access error occurs or2297* this method is called on a closed <code>CallableStatement</code>2298* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2299* @since 1.62300*/2301void setBinaryStream(String parameterName, java.io.InputStream x)2302throws SQLException;2303/**2304* Sets the designated parameter to the given <code>Reader</code>2305* object.2306* When a very large UNICODE value is input to a <code>LONGVARCHAR</code>2307* parameter, it may be more practical to send it via a2308* <code>java.io.Reader</code> object. The data will be read from the stream2309* as needed until end-of-file is reached. The JDBC driver will2310* do any necessary conversion from UNICODE to the database char format.2311*2312* <P><B>Note:</B> This stream object can either be a standard2313* Java stream object or your own subclass that implements the2314* standard interface.2315* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2316* it might be more efficient to use a version of2317* <code>setCharacterStream</code> which takes a length parameter.2318*2319* @param parameterName the name of the parameter2320* @param reader the <code>java.io.Reader</code> object that contains the2321* Unicode data2322* @exception SQLException if parameterName does not correspond to a named2323* parameter; if a database access error occurs or2324* this method is called on a closed <code>CallableStatement</code>2325* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2326* @since 1.62327*/2328void setCharacterStream(String parameterName,2329java.io.Reader reader) throws SQLException;2330/**2331* Sets the designated parameter to a <code>Reader</code> object. The2332* <code>Reader</code> reads the data till end-of-file is reached. The2333* driver does the necessary conversion from Java character format to2334* the national character set in the database.23352336* <P><B>Note:</B> This stream object can either be a standard2337* Java stream object or your own subclass that implements the2338* standard interface.2339* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2340* it might be more efficient to use a version of2341* <code>setNCharacterStream</code> which takes a length parameter.2342*2343* @param parameterName the name of the parameter2344* @param value the parameter value2345* @throws SQLException if parameterName does not correspond to a named2346* parameter; if the driver does not support national2347* character sets; if the driver can detect that a data conversion2348* error could occur; if a database access error occurs; or2349* this method is called on a closed <code>CallableStatement</code>2350* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2351* @since 1.62352*/2353void setNCharacterStream(String parameterName, Reader value) throws SQLException;23542355/**2356* Sets the designated parameter to a <code>Reader</code> object.2357* This method differs from the <code>setCharacterStream (int, Reader)</code> method2358* because it informs the driver that the parameter value should be sent to2359* the server as a <code>CLOB</code>. When the <code>setCharacterStream</code> method is used, the2360* driver may have to do extra work to determine whether the parameter2361* data should be send to the server as a <code>LONGVARCHAR</code> or a <code>CLOB</code>2362*2363* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2364* it might be more efficient to use a version of2365* <code>setClob</code> which takes a length parameter.2366*2367* @param parameterName the name of the parameter2368* @param reader An object that contains the data to set the parameter value to.2369* @throws SQLException if parameterName does not correspond to a named2370* parameter; if a database access error occurs or this method is called on2371* a closed <code>CallableStatement</code>2372*2373* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2374* @since 1.62375*/2376void setClob(String parameterName, Reader reader)2377throws SQLException;23782379/**2380* Sets the designated parameter to a <code>InputStream</code> object.2381* This method differs from the <code>setBinaryStream (int, InputStream)</code>2382* method because it informs the driver that the parameter value should be2383* sent to the server as a <code>BLOB</code>. When the <code>setBinaryStream</code> method is used,2384* the driver may have to do extra work to determine whether the parameter2385* data should be send to the server as a <code>LONGVARBINARY</code> or a <code>BLOB</code>2386*2387* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2388* it might be more efficient to use a version of2389* <code>setBlob</code> which takes a length parameter.2390*2391* @param parameterName the name of the parameter2392* @param inputStream An object that contains the data to set the parameter2393* value to.2394* @throws SQLException if parameterName does not correspond to a named2395* parameter; if a database access error occurs or2396* this method is called on a closed <code>CallableStatement</code>2397* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2398*2399* @since 1.62400*/2401void setBlob(String parameterName, InputStream inputStream)2402throws SQLException;2403/**2404* Sets the designated parameter to a <code>Reader</code> object.2405* This method differs from the <code>setCharacterStream (int, Reader)</code> method2406* because it informs the driver that the parameter value should be sent to2407* the server as a <code>NCLOB</code>. When the <code>setCharacterStream</code> method is used, the2408* driver may have to do extra work to determine whether the parameter2409* data should be send to the server as a <code>LONGNVARCHAR</code> or a <code>NCLOB</code>2410* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2411* it might be more efficient to use a version of2412* <code>setNClob</code> which takes a length parameter.2413*2414* @param parameterName the name of the parameter2415* @param reader An object that contains the data to set the parameter value to.2416* @throws SQLException if parameterName does not correspond to a named2417* parameter; if the driver does not support national character sets;2418* if the driver can detect that a data conversion2419* error could occur; if a database access error occurs or2420* this method is called on a closed <code>CallableStatement</code>2421* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2422*2423* @since 1.62424*/2425void setNClob(String parameterName, Reader reader)2426throws SQLException;24272428//------------------------- JDBC 4.1 -----------------------------------242924302431/**2432*<p>Returns an object representing the value of OUT parameter2433* {@code parameterIndex} and will convert from the2434* SQL type of the parameter to the requested Java data type, if the2435* conversion is supported. If the conversion is not2436* supported or null is specified for the type, a2437* <code>SQLException</code> is thrown.2438*<p>2439* At a minimum, an implementation must support the conversions defined in2440* Appendix B, Table B-3 and conversion of appropriate user defined SQL2441* types to a Java type which implements {@code SQLData}, or {@code Struct}.2442* Additional conversions may be supported and are vendor defined.2443*2444* @param parameterIndex the first parameter is 1, the second is 2, and so on2445* @param type Class representing the Java data type to convert the2446* designated parameter to.2447* @param <T> the type of the class modeled by this Class object2448* @return an instance of {@code type} holding the OUT parameter value2449* @throws SQLException if conversion is not supported, type is null or2450* another error occurs. The getCause() method of the2451* exception may provide a more detailed exception, for example, if2452* a conversion error occurs2453* @throws SQLFeatureNotSupportedException if the JDBC driver does not support2454* this method2455* @since 1.72456*/2457public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException;245824592460/**2461*<p>Returns an object representing the value of OUT parameter2462* {@code parameterName} and will convert from the2463* SQL type of the parameter to the requested Java data type, if the2464* conversion is supported. If the conversion is not2465* supported or null is specified for the type, a2466* <code>SQLException</code> is thrown.2467*<p>2468* At a minimum, an implementation must support the conversions defined in2469* Appendix B, Table B-3 and conversion of appropriate user defined SQL2470* types to a Java type which implements {@code SQLData}, or {@code Struct}.2471* Additional conversions may be supported and are vendor defined.2472*2473* @param parameterName the name of the parameter2474* @param type Class representing the Java data type to convert2475* the designated parameter to.2476* @param <T> the type of the class modeled by this Class object2477* @return an instance of {@code type} holding the OUT parameter2478* value2479* @throws SQLException if conversion is not supported, type is null or2480* another error occurs. The getCause() method of the2481* exception may provide a more detailed exception, for example, if2482* a conversion error occurs2483* @throws SQLFeatureNotSupportedException if the JDBC driver does not support2484* this method2485* @since 1.72486*/2487public <T> T getObject(String parameterName, Class<T> type) throws SQLException;24882489//------------------------- JDBC 4.2 -----------------------------------24902491/**2492* <p>Sets the value of the designated parameter with the given object.2493*2494* If the second argument is an {@code InputStream} then the stream2495* must contain the number of bytes specified by scaleOrLength.2496* If the second argument is a {@code Reader} then the reader must2497* contain the number of characters specified2498* by scaleOrLength. If these conditions are not true the driver2499* will generate a2500* {@code SQLException} when the prepared statement is executed.2501*2502* <p>The given Java object will be converted to the given targetSqlType2503* before being sent to the database.2504*2505* If the object has a custom mapping (is of a class implementing the2506* interface {@code SQLData}),2507* the JDBC driver should call the method {@code SQLData.writeSQL} to2508* write it to the SQL data stream.2509* If, on the other hand, the object is of a class implementing2510* {@code Ref}, {@code Blob}, {@code Clob}, {@code NClob},2511* {@code Struct}, {@code java.net.URL},2512* or {@code Array}, the driver should pass it to the database as a2513* value of the corresponding SQL type.2514*2515* <p>Note that this method may be used to pass database-specific2516* abstract data types.2517*<P>2518* The default implementation will throw {@code SQLFeatureNotSupportedException}2519*2520* @param parameterName the name of the parameter2521* @param x the object containing the input parameter value2522* @param targetSqlType the SQL type to be2523* sent to the database. The scale argument may further qualify this type.2524* @param scaleOrLength for {@code java.sql.JDBCType.DECIMAL}2525* or {@code java.sql.JDBCType.NUMERIC types},2526* this is the number of digits after the decimal point. For2527* Java Object types {@code InputStream} and {@code Reader},2528* this is the length2529* of the data in the stream or reader. For all other types,2530* this value will be ignored.2531* @exception SQLException if parameterName does not correspond to a named2532* parameter; if a database access error occurs2533* or this method is called on a closed {@code CallableStatement} or2534* if the Java Object specified by x is an InputStream2535* or Reader object and the value of the scale parameter is less2536* than zero2537* @exception SQLFeatureNotSupportedException if2538* the JDBC driver does not support the specified targetSqlType2539* @see JDBCType2540* @see SQLType2541*2542* @since 1.82543*/2544default void setObject(String parameterName, Object x, SQLType targetSqlType,2545int scaleOrLength) throws SQLException {2546throw new SQLFeatureNotSupportedException("setObject not implemented");2547}2548/**2549* Sets the value of the designated parameter with the given object.2550*2551* This method is similar to {@link #setObject(String parameterName,2552* Object x, SQLType targetSqlType, int scaleOrLength)},2553* except that it assumes a scale of zero.2554*<P>2555* The default implementation will throw {@code SQLFeatureNotSupportedException}2556*2557* @param parameterName the name of the parameter2558* @param x the object containing the input parameter value2559* @param targetSqlType the SQL type to be sent to the database2560* @exception SQLException if parameterName does not correspond to a named2561* parameter; if a database access error occurs2562* or this method is called on a closed {@code CallableStatement}2563* @exception SQLFeatureNotSupportedException if2564* the JDBC driver does not support the specified targetSqlType2565* @see JDBCType2566* @see SQLType2567* @since 1.82568*/2569default void setObject(String parameterName, Object x, SQLType targetSqlType)2570throws SQLException {2571throw new SQLFeatureNotSupportedException("setObject not implemented");2572}25732574/**2575* Registers the OUT parameter in ordinal position2576* {@code parameterIndex} to the JDBC type2577* {@code sqlType}. All OUT parameters must be registered2578* before a stored procedure is executed.2579* <p>2580* The JDBC type specified by {@code sqlType} for an OUT2581* parameter determines the Java type that must be used2582* in the {@code get} method to read the value of that parameter.2583* <p>2584* If the JDBC type expected to be returned to this output parameter2585* is specific to this particular database, {@code sqlType}2586* may be {@code JDBCType.OTHER} or a {@code SQLType} that is supported by2587* the JDBC driver. The method2588* {@link #getObject} retrieves the value.2589*<P>2590* The default implementation will throw {@code SQLFeatureNotSupportedException}2591*2592* @param parameterIndex the first parameter is 1, the second is 2,2593* and so on2594* @param sqlType the JDBC type code defined by {@code SQLType} to use to2595* register the OUT Parameter.2596* If the parameter is of JDBC type {@code JDBCType.NUMERIC}2597* or {@code JDBCType.DECIMAL}, the version of2598* {@code registerOutParameter} that accepts a scale value2599* should be used.2600*2601* @exception SQLException if the parameterIndex is not valid;2602* if a database access error occurs or2603* this method is called on a closed {@code CallableStatement}2604* @exception SQLFeatureNotSupportedException if2605* the JDBC driver does not support the specified sqlType2606* @see JDBCType2607* @see SQLType2608* @since 1.82609*/2610default void registerOutParameter(int parameterIndex, SQLType sqlType)2611throws SQLException {2612throw new SQLFeatureNotSupportedException("registerOutParameter not implemented");2613}26142615/**2616* Registers the parameter in ordinal position2617* {@code parameterIndex} to be of JDBC type2618* {@code sqlType}. All OUT parameters must be registered2619* before a stored procedure is executed.2620* <p>2621* The JDBC type specified by {@code sqlType} for an OUT2622* parameter determines the Java type that must be used2623* in the {@code get} method to read the value of that parameter.2624* <p>2625* This version of {@code registerOutParameter} should be2626* used when the parameter is of JDBC type {@code JDBCType.NUMERIC}2627* or {@code JDBCType.DECIMAL}.2628*<P>2629* The default implementation will throw {@code SQLFeatureNotSupportedException}2630*2631* @param parameterIndex the first parameter is 1, the second is 2,2632* and so on2633* @param sqlType the JDBC type code defined by {@code SQLType} to use to2634* register the OUT Parameter.2635* @param scale the desired number of digits to the right of the2636* decimal point. It must be greater than or equal to zero.2637* @exception SQLException if the parameterIndex is not valid;2638* if a database access error occurs or2639* this method is called on a closed {@code CallableStatement}2640* @exception SQLFeatureNotSupportedException if2641* the JDBC driver does not support the specified sqlType2642* @see JDBCType2643* @see SQLType2644* @since 1.82645*/2646default void registerOutParameter(int parameterIndex, SQLType sqlType,2647int scale) throws SQLException {2648throw new SQLFeatureNotSupportedException("registerOutParameter not implemented");2649}2650/**2651* Registers the designated output parameter.2652* This version of2653* the method {@code registerOutParameter}2654* should be used for a user-defined or {@code REF} output parameter.2655* Examples2656* of user-defined types include: {@code STRUCT}, {@code DISTINCT},2657* {@code JAVA_OBJECT}, and named array types.2658*<p>2659* All OUT parameters must be registered2660* before a stored procedure is executed.2661* <p> For a user-defined parameter, the fully-qualified SQL2662* type name of the parameter should also be given, while a {@code REF}2663* parameter requires that the fully-qualified type name of the2664* referenced type be given. A JDBC driver that does not need the2665* type code and type name information may ignore it. To be portable,2666* however, applications should always provide these values for2667* user-defined and {@code REF} parameters.2668*2669* Although it is intended for user-defined and {@code REF} parameters,2670* this method may be used to register a parameter of any JDBC type.2671* If the parameter does not have a user-defined or {@code REF} type, the2672* <i>typeName</i> parameter is ignored.2673*2674* <P><B>Note:</B> When reading the value of an out parameter, you2675* must use the getter method whose Java type corresponds to the2676* parameter's registered SQL type.2677*<P>2678* The default implementation will throw {@code SQLFeatureNotSupportedException}2679*2680* @param parameterIndex the first parameter is 1, the second is 2,...2681* @param sqlType the JDBC type code defined by {@code SQLType} to use to2682* register the OUT Parameter.2683* @param typeName the fully-qualified name of an SQL structured type2684* @exception SQLException if the parameterIndex is not valid;2685* if a database access error occurs or2686* this method is called on a closed {@code CallableStatement}2687* @exception SQLFeatureNotSupportedException if2688* the JDBC driver does not support the specified sqlType2689* @see JDBCType2690* @see SQLType2691* @since 1.82692*/2693default void registerOutParameter (int parameterIndex, SQLType sqlType,2694String typeName) throws SQLException {2695throw new SQLFeatureNotSupportedException("registerOutParameter not implemented");2696}26972698/**2699* Registers the OUT parameter named2700* <code>parameterName</code> to the JDBC type2701* {@code sqlType}. All OUT parameters must be registered2702* before a stored procedure is executed.2703* <p>2704* The JDBC type specified by {@code sqlType} for an OUT2705* parameter determines the Java type that must be used2706* in the {@code get} method to read the value of that parameter.2707* <p>2708* If the JDBC type expected to be returned to this output parameter2709* is specific to this particular database, {@code sqlType}2710* should be {@code JDBCType.OTHER} or a {@code SQLType} that is supported2711* by the JDBC driver.. The method2712* {@link #getObject} retrieves the value.2713*<P>2714* The default implementation will throw {@code SQLFeatureNotSupportedException}2715*2716* @param parameterName the name of the parameter2717* @param sqlType the JDBC type code defined by {@code SQLType} to use to2718* register the OUT Parameter.2719* If the parameter is of JDBC type {@code JDBCType.NUMERIC}2720* or {@code JDBCType.DECIMAL}, the version of2721* {@code registerOutParameter} that accepts a scale value2722* should be used.2723* @exception SQLException if parameterName does not correspond to a named2724* parameter; if a database access error occurs or2725* this method is called on a closed {@code CallableStatement}2726* @exception SQLFeatureNotSupportedException if2727* the JDBC driver does not support the specified sqlType2728* or if the JDBC driver does not support2729* this method2730* @since 1.82731* @see JDBCType2732* @see SQLType2733*/2734default void registerOutParameter(String parameterName, SQLType sqlType)2735throws SQLException {2736throw new SQLFeatureNotSupportedException("registerOutParameter not implemented");2737}27382739/**2740* Registers the parameter named2741* <code>parameterName</code> to be of JDBC type2742* {@code sqlType}. All OUT parameters must be registered2743* before a stored procedure is executed.2744* <p>2745* The JDBC type specified by {@code sqlType} for an OUT2746* parameter determines the Java type that must be used2747* in the {@code get} method to read the value of that parameter.2748* <p>2749* This version of {@code registerOutParameter} should be2750* used when the parameter is of JDBC type {@code JDBCType.NUMERIC}2751* or {@code JDBCType.DECIMAL}.2752*<P>2753* The default implementation will throw {@code SQLFeatureNotSupportedException}2754*2755* @param parameterName the name of the parameter2756* @param sqlType the JDBC type code defined by {@code SQLType} to use to2757* register the OUT Parameter.2758* @param scale the desired number of digits to the right of the2759* decimal point. It must be greater than or equal to zero.2760* @exception SQLException if parameterName does not correspond to a named2761* parameter; if a database access error occurs or2762* this method is called on a closed {@code CallableStatement}2763* @exception SQLFeatureNotSupportedException if2764* the JDBC driver does not support the specified sqlType2765* or if the JDBC driver does not support2766* this method2767* @since 1.82768* @see JDBCType2769* @see SQLType2770*/2771default void registerOutParameter(String parameterName, SQLType sqlType,2772int scale) throws SQLException {2773throw new SQLFeatureNotSupportedException("registerOutParameter not implemented");2774}27752776/**2777* Registers the designated output parameter. This version of2778* the method {@code registerOutParameter}2779* should be used for a user-named or REF output parameter. Examples2780* of user-named types include: STRUCT, DISTINCT, JAVA_OBJECT, and2781* named array types.2782*<p>2783* All OUT parameters must be registered2784* before a stored procedure is executed.2785* </p>2786* For a user-named parameter the fully-qualified SQL2787* type name of the parameter should also be given, while a REF2788* parameter requires that the fully-qualified type name of the2789* referenced type be given. A JDBC driver that does not need the2790* type code and type name information may ignore it. To be portable,2791* however, applications should always provide these values for2792* user-named and REF parameters.2793*2794* Although it is intended for user-named and REF parameters,2795* this method may be used to register a parameter of any JDBC type.2796* If the parameter does not have a user-named or REF type, the2797* typeName parameter is ignored.2798*2799* <P><B>Note:</B> When reading the value of an out parameter, you2800* must use the {@code getXXX} method whose Java type XXX corresponds to the2801* parameter's registered SQL type.2802*<P>2803* The default implementation will throw {@code SQLFeatureNotSupportedException}2804*2805* @param parameterName the name of the parameter2806* @param sqlType the JDBC type code defined by {@code SQLType} to use to2807* register the OUT Parameter.2808* @param typeName the fully-qualified name of an SQL structured type2809* @exception SQLException if parameterName does not correspond to a named2810* parameter; if a database access error occurs or2811* this method is called on a closed {@code CallableStatement}2812* @exception SQLFeatureNotSupportedException if2813* the JDBC driver does not support the specified sqlType2814* or if the JDBC driver does not support this method2815* @see JDBCType2816* @see SQLType2817* @since 1.82818*/2819default void registerOutParameter (String parameterName, SQLType sqlType,2820String typeName) throws SQLException {2821throw new SQLFeatureNotSupportedException("registerOutParameter not implemented");2822}2823}282428252826