Path: blob/master/src/java.sql/share/classes/java/sql/CallableStatement.java
41153 views
/*1* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package 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} 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} methods provided here.49* <P>50* A {@code CallableStatement} can return one {@link ResultSet} object or51* multiple {@code ResultSet} objects. Multiple52* {@code ResultSet} objects are handled using operations53* inherited from {@link Statement}.54* <P>55* For maximum portability, a call's {@code ResultSet} objects and56* update counts should be processed prior to getting the values of output57* parameters.58*59*60* @see Connection#prepareCall61* @see ResultSet62* @since 1.163*/6465public interface CallableStatement extends PreparedStatement {6667/**68* Registers the OUT parameter in ordinal position69* {@code parameterIndex} to the JDBC type70* {@code sqlType}. All OUT parameters must be registered71* before a stored procedure is executed.72* <p>73* The JDBC type specified by {@code sqlType} for an OUT74* parameter determines the Java type that must be used75* in the {@code get} method to read the value of that parameter.76* <p>77* If the JDBC type expected to be returned to this output parameter78* is specific to this particular database, {@code sqlType}79* should be {@code java.sql.Types.OTHER}. The method80* {@link #getObject} retrieves the value.81*82* @param parameterIndex the first parameter is 1, the second is 2,83* and so on84* @param sqlType the JDBC type code defined by {@code java.sql.Types}.85* If the parameter is of JDBC type {@code NUMERIC}86* or {@code DECIMAL}, the version of87* {@code registerOutParameter} that accepts a scale value88* should be used.89*90* @throws SQLException if the parameterIndex is not valid;91* if a database access error occurs or92* this method is called on a closed {@code CallableStatement}93* @throws SQLFeatureNotSupportedException if {@code sqlType} is94* a {@code ARRAY}, {@code BLOB}, {@code CLOB},95* {@code DATALINK}, {@code JAVA_OBJECT}, {@code NCHAR},96* {@code NCLOB}, {@code NVARCHAR}, {@code LONGNVARCHAR},97* {@code REF}, {@code ROWID}, {@code SQLXML}98* or {@code STRUCT} data type and the JDBC driver does not support99* this data type100* @see Types101*/102void registerOutParameter(int parameterIndex, int sqlType)103throws SQLException;104105/**106* Registers the parameter in ordinal position107* {@code parameterIndex} to be of JDBC type108* {@code sqlType}. All OUT parameters must be registered109* before a stored procedure is executed.110* <p>111* The JDBC type specified by {@code sqlType} for an OUT112* parameter determines the Java type that must be used113* in the {@code get} method to read the value of that parameter.114* <p>115* This version of {@code registerOutParameter} should be116* used when the parameter is of JDBC type {@code NUMERIC}117* or {@code DECIMAL}.118*119* @param parameterIndex the first parameter is 1, the second is 2,120* and so on121* @param sqlType the SQL type code defined by {@code java.sql.Types}.122* @param scale the desired number of digits to the right of the123* decimal point. It must be greater than or equal to zero.124* @throws SQLException if the parameterIndex is not valid;125* if a database access error occurs or126* this method is called on a closed {@code CallableStatement}127* @throws SQLFeatureNotSupportedException if {@code sqlType} is128* a {@code ARRAY}, {@code BLOB}, {@code CLOB},129* {@code DATALINK}, {@code JAVA_OBJECT}, {@code NCHAR},130* {@code NCLOB}, {@code NVARCHAR}, {@code LONGNVARCHAR},131* {@code REF}, {@code ROWID}, {@code SQLXML}132* or {@code STRUCT} data type and the JDBC driver does not support133* this data type134* @see Types135*/136void registerOutParameter(int parameterIndex, int sqlType, int scale)137throws SQLException;138139/**140* Retrieves whether the last OUT parameter read had the value of141* SQL {@code NULL}. Note that this method should be called only after142* calling a getter method; otherwise, there is no value to use in143* determining whether it is {@code null} or not.144*145* @return {@code true} if the last parameter read was SQL146* {@code NULL}; {@code false} otherwise147* @throws SQLException if a database access error occurs or148* this method is called on a closed {@code CallableStatement}149*/150boolean wasNull() throws SQLException;151152/**153* Retrieves the value of the designated JDBC {@code CHAR},154* {@code VARCHAR}, or {@code LONGVARCHAR} parameter as a155* {@code String} in the Java programming language.156* <p>157* For the fixed-length type JDBC {@code CHAR},158* the {@code String} object159* returned has exactly the same value the SQL160* {@code CHAR} value had in the161* database, including any padding added by the database.162*163* @param parameterIndex the first parameter is 1, the second is 2,164* and so on165* @return the parameter value. If the value is SQL {@code NULL},166* the result167* is {@code null}.168* @throws SQLException if the parameterIndex is not valid;169* if a database access error occurs or170* this method is called on a closed {@code CallableStatement}171* @see #setString172*/173String getString(int parameterIndex) throws SQLException;174175/**176* Retrieves the value of the designated JDBC {@code BIT}177* or {@code BOOLEAN} parameter as a178* {@code boolean} in the Java programming language.179*180* @param parameterIndex the first parameter is 1, the second is 2,181* and so on182* @return the parameter value. If the value is SQL {@code NULL},183* the result is {@code false}.184* @throws SQLException if the parameterIndex is not valid;185* if a database access error occurs or186* this method is called on a closed {@code CallableStatement}187* @see #setBoolean188*/189boolean getBoolean(int parameterIndex) throws SQLException;190191/**192* Retrieves the value of the designated JDBC {@code TINYINT} parameter193* as a {@code byte} in the Java programming language.194*195* @param parameterIndex the first parameter is 1, the second is 2,196* and so on197* @return the parameter value. If the value is SQL {@code NULL}, the result198* is {@code 0}.199* @throws SQLException if the parameterIndex is not valid;200* if a database access error occurs or201* this method is called on a closed {@code CallableStatement}202* @see #setByte203*/204byte getByte(int parameterIndex) throws SQLException;205206/**207* Retrieves the value of the designated JDBC {@code SMALLINT} parameter208* as a {@code short} in the Java programming language.209*210* @param parameterIndex the first parameter is 1, the second is 2,211* and so on212* @return the parameter value. If the value is SQL {@code NULL}, the result213* is {@code 0}.214* @throws SQLException if the parameterIndex is not valid;215* if a database access error occurs or216* this method is called on a closed {@code CallableStatement}217* @see #setShort218*/219short getShort(int parameterIndex) throws SQLException;220221/**222* Retrieves the value of the designated JDBC {@code INTEGER} parameter223* as an {@code int} in the Java programming language.224*225* @param parameterIndex the first parameter is 1, the second is 2,226* and so on227* @return the parameter value. If the value is SQL {@code NULL}, the result228* is {@code 0}.229* @throws SQLException if the parameterIndex is not valid;230* if a database access error occurs or231* this method is called on a closed {@code CallableStatement}232* @see #setInt233*/234int getInt(int parameterIndex) throws SQLException;235236/**237* Retrieves the value of the designated JDBC {@code BIGINT} parameter238* as a {@code long} in the Java programming language.239*240* @param parameterIndex the first parameter is 1, the second is 2,241* and so on242* @return the parameter value. If the value is SQL {@code NULL}, the result243* is {@code 0}.244* @throws SQLException if the parameterIndex is not valid;245* if a database access error occurs or246* this method is called on a closed {@code CallableStatement}247* @see #setLong248*/249long getLong(int parameterIndex) throws SQLException;250251/**252* Retrieves the value of the designated JDBC {@code FLOAT} parameter253* as a {@code float} in the Java programming language.254*255* @param parameterIndex the first parameter is 1, the second is 2,256* and so on257* @return the parameter value. If the value is SQL {@code NULL}, the result258* is {@code 0}.259* @throws SQLException if the parameterIndex is not valid;260* if a database access error occurs or261* this method is called on a closed {@code CallableStatement}262* @see #setFloat263*/264float getFloat(int parameterIndex) throws SQLException;265266/**267* Retrieves the value of the designated JDBC {@code DOUBLE} parameter as a {@code double}268* in the Java programming language.269* @param parameterIndex the first parameter is 1, the second is 2,270* and so on271* @return the parameter value. If the value is SQL {@code NULL}, the result272* is {@code 0}.273* @throws SQLException if the parameterIndex is not valid;274* if a database access error occurs or275* this method is called on a closed {@code CallableStatement}276* @see #setDouble277*/278double getDouble(int parameterIndex) throws SQLException;279280/**281* Retrieves the value of the designated JDBC {@code NUMERIC} parameter as a282* {@code java.math.BigDecimal} object with <i>scale</i> digits to283* the right of the decimal point.284* @param parameterIndex the first parameter is 1, the second is 2,285* and so on286* @param scale the number of digits to the right of the decimal point287* @return the parameter value. If the value is SQL {@code NULL}, the result288* is {@code null}.289* @throws SQLException if the parameterIndex is not valid;290* if a database access error occurs or291* this method is called on a closed {@code CallableStatement}292* @throws SQLFeatureNotSupportedException if the JDBC driver does not support293* this method294* @deprecated use {@code getBigDecimal(int parameterIndex)}295* or {@code getBigDecimal(String parameterName)}296* @see #setBigDecimal297*/298@Deprecated(since="1.2")299BigDecimal getBigDecimal(int parameterIndex, int scale)300throws SQLException;301302/**303* Retrieves the value of the designated JDBC {@code BINARY} or304* {@code VARBINARY} parameter as an array of {@code byte}305* values in the Java programming language.306* @param parameterIndex the first parameter is 1, the second is 2,307* and so on308* @return the parameter value. If the value is SQL {@code NULL}, the result309* is {@code null}.310* @throws SQLException if the parameterIndex is not valid;311* if a database access error occurs or312* this method is called on a closed {@code CallableStatement}313* @see #setBytes314*/315byte[] getBytes(int parameterIndex) throws SQLException;316317/**318* Retrieves the value of the designated JDBC {@code DATE} parameter as a319* {@code java.sql.Date} object.320* @param parameterIndex the first parameter is 1, the second is 2,321* and so on322* @return the parameter value. If the value is SQL {@code NULL}, the result323* is {@code null}.324* @throws SQLException if the parameterIndex is not valid;325* if a database access error occurs or326* this method is called on a closed {@code CallableStatement}327* @see #setDate328*/329java.sql.Date getDate(int parameterIndex) throws SQLException;330331/**332* Retrieves the value of the designated JDBC {@code TIME} parameter as a333* {@code java.sql.Time} object.334*335* @param parameterIndex the first parameter is 1, the second is 2,336* and so on337* @return the parameter value. If the value is SQL {@code NULL}, the result338* is {@code null}.339* @throws SQLException if the parameterIndex is not valid;340* if a database access error occurs or341* this method is called on a closed {@code CallableStatement}342* @see #setTime343*/344java.sql.Time getTime(int parameterIndex) throws SQLException;345346/**347* Retrieves the value of the designated JDBC {@code TIMESTAMP} parameter as a348* {@code java.sql.Timestamp} object.349*350* @param parameterIndex the first parameter is 1, the second is 2,351* and so on352* @return the parameter value. If the value is SQL {@code NULL}, the result353* is {@code null}.354* @throws SQLException if the parameterIndex is not valid;355* if a database access error occurs or356* this method is called on a closed {@code CallableStatement}357* @see #setTimestamp358*/359java.sql.Timestamp getTimestamp(int parameterIndex)360throws SQLException;361362//----------------------------------------------------------------------363// Advanced features:364365366/**367* Retrieves the value of the designated parameter as an {@code Object}368* in the Java programming language. If the value is an SQL {@code NULL},369* the driver returns a Java {@code null}.370* <p>371* This method returns a Java object whose type corresponds to the JDBC372* type that was registered for this parameter using the method373* {@code registerOutParameter}. By registering the target JDBC374* type as {@code java.sql.Types.OTHER}, this method can be used375* to read database-specific abstract data types.376*377* @param parameterIndex the first parameter is 1, the second is 2,378* and so on379* @return A {@code java.lang.Object} holding the OUT parameter value380* @throws SQLException if the parameterIndex is not valid;381* if a database access error occurs or382* this method is called on a closed {@code CallableStatement}383* @see Types384* @see #setObject385*/386Object getObject(int parameterIndex) throws SQLException;387388389//--------------------------JDBC 2.0-----------------------------390391/**392* Retrieves the value of the designated JDBC {@code NUMERIC} parameter as a393* {@code java.math.BigDecimal} object with as many digits to the394* right of the decimal point as the value contains.395* @param parameterIndex the first parameter is 1, the second is 2,396* and so on397* @return the parameter value in full precision. If the value is398* SQL {@code NULL}, the result is {@code null}.399* @throws SQLException if the parameterIndex is not valid;400* if a database access error occurs or401* this method is called on a closed {@code CallableStatement}402* @see #setBigDecimal403* @since 1.2404*/405BigDecimal getBigDecimal(int parameterIndex) throws SQLException;406407/**408* Returns an object representing the value of OUT parameter409* {@code parameterIndex} and uses {@code map} for the custom410* mapping of the parameter value.411* <p>412* This method returns a Java object whose type corresponds to the413* JDBC type that was registered for this parameter using the method414* {@code registerOutParameter}. By registering the target415* JDBC type as {@code java.sql.Types.OTHER}, this method can416* be used to read database-specific abstract data types.417* @param parameterIndex the first parameter is 1, the second is 2, and so on418* @param map the mapping from SQL type names to Java classes419* @return a {@code java.lang.Object} holding the OUT parameter value420* @throws SQLException if the parameterIndex is not valid;421* if a database access error occurs or422* this method is called on a closed {@code CallableStatement}423* @throws SQLFeatureNotSupportedException if the JDBC driver does not support424* this method425* @see #setObject426* @since 1.2427*/428Object getObject(int parameterIndex, java.util.Map<String,Class<?>> map)429throws SQLException;430431/**432* Retrieves the value of the designated JDBC {@code REF(<structured-type>)}433* parameter as a {@link java.sql.Ref} object in the Java programming language.434* @param parameterIndex the first parameter is 1, the second is 2,435* and so on436* @return the parameter value as a {@code Ref} object in the437* Java programming language. If the value was SQL {@code NULL}, the value438* {@code null} is returned.439* @throws SQLException if the parameterIndex is not valid;440* if a database access error occurs or441* this method is called on a closed {@code CallableStatement}442* @throws SQLFeatureNotSupportedException if the JDBC driver does not support443* this method444* @since 1.2445*/446Ref getRef (int parameterIndex) throws SQLException;447448/**449* Retrieves the value of the designated JDBC {@code BLOB} parameter as a450* {@link java.sql.Blob} object in the Java programming language.451* @param parameterIndex the first parameter is 1, the second is 2, and so on452* @return the parameter value as a {@code Blob} object in the453* Java programming language. If the value was SQL {@code NULL}, the value454* {@code null} is returned.455* @throws SQLException if the parameterIndex is not valid;456* if a database access error occurs or457* this method is called on a closed {@code CallableStatement}458* @throws SQLFeatureNotSupportedException if the JDBC driver does not support459* this method460* @since 1.2461*/462Blob getBlob (int parameterIndex) throws SQLException;463464/**465* Retrieves the value of the designated JDBC {@code CLOB} parameter as a466* {@code java.sql.Clob} object in the Java programming language.467* @param parameterIndex the first parameter is 1, the second is 2, and468* so on469* @return the parameter value as a {@code Clob} object in the470* Java programming language. If the value was SQL {@code NULL}, the471* value {@code null} is returned.472* @throws SQLException if the parameterIndex is not valid;473* if a database access error occurs or474* this method is called on a closed {@code CallableStatement}475* @throws SQLFeatureNotSupportedException if the JDBC driver does not support476* this method477* @since 1.2478*/479Clob getClob (int parameterIndex) throws SQLException;480481/**482*483* Retrieves the value of the designated JDBC {@code ARRAY} parameter as an484* {@link java.sql.Array} object in the Java programming language.485* @param parameterIndex the first parameter is 1, the second is 2, and486* so on487* @return the parameter value as an {@code Array} object in488* the Java programming language. If the value was SQL {@code NULL}, the489* value {@code null} is returned.490* @throws SQLException if the parameterIndex is not valid;491* if a database access error occurs or492* this method is called on a closed {@code CallableStatement}493* @throws SQLFeatureNotSupportedException if the JDBC driver does not support494* this method495* @since 1.2496*/497Array getArray (int parameterIndex) throws SQLException;498499/**500* Retrieves the value of the designated JDBC {@code DATE} parameter as a501* {@code java.sql.Date} object, using502* the given {@code Calendar} object503* to construct the date.504* With a {@code Calendar} object, the driver505* can calculate the date taking into account a custom timezone and locale.506* If no {@code Calendar} object is specified, the driver uses the507* default timezone and locale.508*509* @param parameterIndex the first parameter is 1, the second is 2,510* and so on511* @param cal the {@code Calendar} object the driver will use512* to construct the date513* @return the parameter value. If the value is SQL {@code NULL}, the result514* is {@code null}.515* @throws SQLException if the parameterIndex is not valid;516* if a database access error occurs or517* this method is called on a closed {@code CallableStatement}518* @see #setDate519* @since 1.2520*/521java.sql.Date getDate(int parameterIndex, Calendar cal)522throws SQLException;523524/**525* Retrieves the value of the designated JDBC {@code TIME} parameter as a526* {@code java.sql.Time} object, using527* the given {@code Calendar} object528* to construct the time.529* With a {@code Calendar} object, the driver530* can calculate the time taking into account a custom timezone and locale.531* If no {@code Calendar} object is specified, the driver uses the532* default timezone and locale.533*534* @param parameterIndex the first parameter is 1, the second is 2,535* and so on536* @param cal the {@code Calendar} object the driver will use537* to construct the time538* @return the parameter value; if the value is SQL {@code NULL}, the result539* is {@code null}.540* @throws SQLException if the parameterIndex is not valid;541* if a database access error occurs or542* this method is called on a closed {@code CallableStatement}543* @see #setTime544* @since 1.2545*/546java.sql.Time getTime(int parameterIndex, Calendar cal)547throws SQLException;548549/**550* Retrieves the value of the designated JDBC {@code TIMESTAMP} parameter as a551* {@code java.sql.Timestamp} object, using552* the given {@code Calendar} object to construct553* the {@code Timestamp} object.554* With a {@code Calendar} object, the driver555* can calculate the timestamp taking into account a custom timezone and locale.556* If no {@code Calendar} object is specified, the driver uses the557* default timezone and locale.558*559*560* @param parameterIndex the first parameter is 1, the second is 2,561* and so on562* @param cal the {@code Calendar} object the driver will use563* to construct the timestamp564* @return the parameter value. If the value is SQL {@code NULL}, the result565* is {@code null}.566* @throws SQLException if the parameterIndex is not valid;567* if a database access error occurs or568* this method is called on a closed {@code CallableStatement}569* @see #setTimestamp570* @since 1.2571*/572java.sql.Timestamp getTimestamp(int parameterIndex, Calendar cal)573throws SQLException;574575576/**577* Registers the designated output parameter.578* This version of579* the method {@code registerOutParameter}580* should be used for a user-defined or {@code REF} output parameter. Examples581* of user-defined types include: {@code STRUCT}, {@code DISTINCT},582* {@code JAVA_OBJECT}, and named array types.583*<p>584* All OUT parameters must be registered585* before a stored procedure is executed.586* <p> For a user-defined parameter, the fully-qualified SQL587* type name of the parameter should also be given, while a {@code REF}588* parameter requires that the fully-qualified type name of the589* referenced type be given. A JDBC driver that does not need the590* type code and type name information may ignore it. To be portable,591* however, applications should always provide these values for592* user-defined and {@code REF} parameters.593*594* Although it is intended for user-defined and {@code REF} parameters,595* this method may be used to register a parameter of any JDBC type.596* If the parameter does not have a user-defined or {@code REF} type, the597* <i>typeName</i> parameter is ignored.598*599* <P><B>Note:</B> When reading the value of an out parameter, you600* must use the getter method whose Java type corresponds to the601* parameter's registered SQL type.602*603* @param parameterIndex the first parameter is 1, the second is 2,...604* @param sqlType a value from {@link java.sql.Types}605* @param typeName the fully-qualified name of an SQL structured type606* @throws SQLException if the parameterIndex is not valid;607* if a database access error occurs or608* this method is called on a closed {@code CallableStatement}609* @throws SQLFeatureNotSupportedException if {@code sqlType} is610* a {@code ARRAY}, {@code BLOB}, {@code CLOB},611* {@code DATALINK}, {@code JAVA_OBJECT}, {@code NCHAR},612* {@code NCLOB}, {@code NVARCHAR}, {@code LONGNVARCHAR},613* {@code REF}, {@code ROWID}, {@code SQLXML}614* or {@code STRUCT} data type and the JDBC driver does not support615* this data type616* @see Types617* @since 1.2618*/619void registerOutParameter (int parameterIndex, int sqlType, String typeName)620throws SQLException;621622//--------------------------JDBC 3.0-----------------------------623624/**625* Registers the OUT parameter named626* {@code parameterName} to the JDBC type627* {@code sqlType}. All OUT parameters must be registered628* before a stored procedure is executed.629* <p>630* The JDBC type specified by {@code sqlType} for an OUT631* parameter determines the Java type that must be used632* in the {@code get} method to read the value of that parameter.633* <p>634* If the JDBC type expected to be returned to this output parameter635* is specific to this particular database, {@code sqlType}636* should be {@code java.sql.Types.OTHER}. The method637* {@link #getObject} retrieves the value.638* @param parameterName the name of the parameter639* @param sqlType the JDBC type code defined by {@code java.sql.Types}.640* If the parameter is of JDBC type {@code NUMERIC}641* or {@code DECIMAL}, the version of642* {@code registerOutParameter} that accepts a scale value643* should be used.644* @throws SQLException if parameterName does not correspond to a named645* parameter; if a database access error occurs or646* this method is called on a closed {@code CallableStatement}647* @throws SQLFeatureNotSupportedException if {@code sqlType} is648* a {@code ARRAY}, {@code BLOB}, {@code CLOB},649* {@code DATALINK}, {@code JAVA_OBJECT}, {@code NCHAR},650* {@code NCLOB}, {@code NVARCHAR}, {@code LONGNVARCHAR},651* {@code REF}, {@code ROWID}, {@code SQLXML}652* or {@code STRUCT} data type and the JDBC driver does not support653* this data type or if the JDBC driver does not support654* this method655* @since 1.4656* @see Types657*/658void registerOutParameter(String parameterName, int sqlType)659throws SQLException;660661/**662* Registers the parameter named663* {@code parameterName} to be of JDBC type664* {@code sqlType}. All OUT parameters must be registered665* before a stored procedure is executed.666* <p>667* The JDBC type specified by {@code sqlType} for an OUT668* parameter determines the Java type that must be used669* in the {@code get} method to read the value of that parameter.670* <p>671* This version of {@code registerOutParameter} should be672* used when the parameter is of JDBC type {@code NUMERIC}673* or {@code DECIMAL}.674*675* @param parameterName the name of the parameter676* @param sqlType SQL type code defined by {@code java.sql.Types}.677* @param scale the desired number of digits to the right of the678* decimal point. It must be greater than or equal to zero.679* @throws SQLException if parameterName does not correspond to a named680* parameter; if a database access error occurs or681* this method is called on a closed {@code CallableStatement}682* @throws SQLFeatureNotSupportedException if {@code sqlType} is683* a {@code ARRAY}, {@code BLOB}, {@code CLOB},684* {@code DATALINK}, {@code JAVA_OBJECT}, {@code NCHAR},685* {@code NCLOB}, {@code NVARCHAR}, {@code LONGNVARCHAR},686* {@code REF}, {@code ROWID}, {@code SQLXML}687* or {@code STRUCT} data type and the JDBC driver does not support688* this data type or if the JDBC driver does not support689* this method690* @since 1.4691* @see Types692*/693void registerOutParameter(String parameterName, int sqlType, int scale)694throws SQLException;695696/**697* Registers the designated output parameter. This version of698* the method {@code registerOutParameter}699* should be used for a user-named or REF output parameter. Examples700* of user-named types include: STRUCT, DISTINCT, JAVA_OBJECT, and701* named array types.702*<p>703* All OUT parameters must be registered704* before a stored procedure is executed.705* <p>706* For a user-named parameter the fully-qualified SQL707* type name of the parameter should also be given, while a REF708* parameter requires that the fully-qualified type name of the709* referenced type be given. A JDBC driver that does not need the710* type code and type name information may ignore it. To be portable,711* however, applications should always provide these values for712* user-named and REF parameters.713*714* Although it is intended for user-named and REF parameters,715* this method may be used to register a parameter of any JDBC type.716* If the parameter does not have a user-named or REF type, the717* typeName parameter is ignored.718*719* <P><B>Note:</B> When reading the value of an out parameter, you720* must use the {@code getXXX} method whose Java type XXX corresponds to the721* parameter's registered SQL type.722*723* @param parameterName the name of the parameter724* @param sqlType a value from {@link java.sql.Types}725* @param typeName the fully-qualified name of an SQL structured type726* @throws SQLException if parameterName does not correspond to a named727* parameter; if a database access error occurs or728* this method is called on a closed {@code CallableStatement}729* @throws SQLFeatureNotSupportedException if {@code sqlType} is730* a {@code ARRAY}, {@code BLOB}, {@code CLOB},731* {@code DATALINK}, {@code JAVA_OBJECT}, {@code NCHAR},732* {@code NCLOB}, {@code NVARCHAR}, {@code LONGNVARCHAR},733* {@code REF}, {@code ROWID}, {@code SQLXML}734* or {@code STRUCT} data type and the JDBC driver does not support735* this data type or if the JDBC driver does not support736* this method737* @see Types738* @since 1.4739*/740void registerOutParameter (String parameterName, int sqlType, String typeName)741throws SQLException;742743/**744* Retrieves the value of the designated JDBC {@code DATALINK} parameter as a745* {@code java.net.URL} object.746*747* @param parameterIndex the first parameter is 1, the second is 2,...748* @return a {@code java.net.URL} object that represents the749* JDBC {@code DATALINK} value used as the designated750* parameter751* @throws SQLException if the parameterIndex is not valid;752* if a database access error occurs,753* this method is called on a closed {@code CallableStatement},754* or if the URL being returned is755* not a valid URL on the Java platform756* @throws SQLFeatureNotSupportedException if the JDBC driver does not support757* this method758* @see #setURL759* @since 1.4760*/761java.net.URL getURL(int parameterIndex) throws SQLException;762763/**764* Sets the designated parameter to the given {@code java.net.URL} object.765* The driver converts this to an SQL {@code DATALINK} value when766* it sends it to the database.767*768* @param parameterName the name of the parameter769* @param val the parameter value770* @throws SQLException if parameterName does not correspond to a named771* parameter; if a database access error occurs;772* this method is called on a closed {@code CallableStatement}773* or if a URL is malformed774* @throws SQLFeatureNotSupportedException if the JDBC driver does not support775* this method776* @see #getURL777* @since 1.4778*/779void setURL(String parameterName, java.net.URL val) throws SQLException;780781/**782* Sets the designated parameter to SQL {@code NULL}.783*784* <P><B>Note:</B> You must specify the parameter's SQL type.785*786* @param parameterName the name of the parameter787* @param sqlType the SQL type code defined in {@code java.sql.Types}788* @throws SQLException if parameterName does not correspond to a named789* parameter; if a database access error occurs or790* this method is called on a closed {@code CallableStatement}791* @throws SQLFeatureNotSupportedException if the JDBC driver does not support792* this method793* @since 1.4794*/795void setNull(String parameterName, int sqlType) throws SQLException;796797/**798* Sets the designated parameter to the given Java {@code boolean} value.799* The driver converts this800* to an SQL {@code BIT} or {@code BOOLEAN} value when it sends it to the database.801*802* @param parameterName the name of the parameter803* @param x the parameter value804* @throws SQLException if parameterName does not correspond to a named805* parameter; if a database access error occurs or806* this method is called on a closed {@code CallableStatement}807* @see #getBoolean808* @throws SQLFeatureNotSupportedException if the JDBC driver does not support809* this method810* @since 1.4811*/812void setBoolean(String parameterName, boolean x) throws SQLException;813814/**815* Sets the designated parameter to the given Java {@code byte} value.816* The driver converts this817* to an SQL {@code TINYINT} value when it sends it to the database.818*819* @param parameterName the name of the parameter820* @param x the parameter value821* @throws SQLException if parameterName does not correspond to a named822* parameter; if a database access error occurs or823* this method is called on a closed {@code CallableStatement}824* @throws SQLFeatureNotSupportedException if the JDBC driver does not support825* this method826* @see #getByte827* @since 1.4828*/829void setByte(String parameterName, byte x) throws SQLException;830831/**832* Sets the designated parameter to the given Java {@code short} value.833* The driver converts this834* to an SQL {@code SMALLINT} value when it sends it to the database.835*836* @param parameterName the name of the parameter837* @param x the parameter value838* @throws SQLException if parameterName does not correspond to a named839* parameter; if a database access error occurs or840* this method is called on a closed {@code CallableStatement}841* @throws SQLFeatureNotSupportedException if the JDBC driver does not support842* this method843* @see #getShort844* @since 1.4845*/846void setShort(String parameterName, short x) throws SQLException;847848/**849* Sets the designated parameter to the given Java {@code int} value.850* The driver converts this851* to an SQL {@code INTEGER} value when it sends it to the database.852*853* @param parameterName the name of the parameter854* @param x the parameter value855* @throws SQLException if parameterName does not correspond to a named856* parameter; if a database access error occurs or857* this method is called on a closed {@code CallableStatement}858* @throws SQLFeatureNotSupportedException if the JDBC driver does not support859* this method860* @see #getInt861* @since 1.4862*/863void setInt(String parameterName, int x) throws SQLException;864865/**866* Sets the designated parameter to the given Java {@code long} value.867* The driver converts this868* to an SQL {@code BIGINT} value when it sends it to the database.869*870* @param parameterName the name of the parameter871* @param x the parameter value872* @throws SQLException if parameterName does not correspond to a named873* parameter; if a database access error occurs or874* this method is called on a closed {@code CallableStatement}875* @throws SQLFeatureNotSupportedException if the JDBC driver does not support876* this method877* @see #getLong878* @since 1.4879*/880void setLong(String parameterName, long x) throws SQLException;881882/**883* Sets the designated parameter to the given Java {@code float} value.884* The driver converts this885* to an SQL {@code FLOAT} value when it sends it to the database.886*887* @param parameterName the name of the parameter888* @param x the parameter value889* @throws SQLException if parameterName does not correspond to a named890* parameter; if a database access error occurs or891* this method is called on a closed {@code CallableStatement}892* @throws SQLFeatureNotSupportedException if the JDBC driver does not support893* this method894* @see #getFloat895* @since 1.4896*/897void setFloat(String parameterName, float x) throws SQLException;898899/**900* Sets the designated parameter to the given Java {@code double} value.901* The driver converts this902* to an SQL {@code DOUBLE} value when it sends it to the database.903*904* @param parameterName the name of the parameter905* @param x the parameter value906* @throws SQLException if parameterName does not correspond to a named907* parameter; if a database access error occurs or908* this method is called on a closed {@code CallableStatement}909* @throws SQLFeatureNotSupportedException if the JDBC driver does not support910* this method911* @see #getDouble912* @since 1.4913*/914void setDouble(String parameterName, double x) throws SQLException;915916/**917* Sets the designated parameter to the given918* {@code java.math.BigDecimal} value.919* The driver converts this to an SQL {@code NUMERIC} value when920* it sends it to the database.921*922* @param parameterName the name of the parameter923* @param x the parameter value924* @throws SQLException if parameterName does not correspond to a named925* parameter; if a database access error occurs or926* this method is called on a closed {@code CallableStatement}927* @throws SQLFeatureNotSupportedException if the JDBC driver does not support928* this method929* @see #getBigDecimal930* @since 1.4931*/932void setBigDecimal(String parameterName, BigDecimal x) throws SQLException;933934/**935* Sets the designated parameter to the given Java {@code String} value.936* The driver converts this937* to an SQL {@code VARCHAR} or {@code LONGVARCHAR} value938* (depending on the argument's939* size relative to the driver's limits on {@code VARCHAR} values)940* when it sends it to the database.941*942* @param parameterName the name of the parameter943* @param x the parameter value944* @throws SQLException if parameterName does not correspond to a named945* parameter; if a database access error occurs or946* this method is called on a closed {@code CallableStatement}947* @throws SQLFeatureNotSupportedException if the JDBC driver does not support948* this method949* @see #getString950* @since 1.4951*/952void setString(String parameterName, String x) throws SQLException;953954/**955* Sets the designated parameter to the given Java array of bytes.956* The driver converts this to an SQL {@code VARBINARY} or957* {@code LONGVARBINARY} (depending on the argument's size relative958* to the driver's limits on {@code VARBINARY} values) when it sends959* it to the database.960*961* @param parameterName the name of the parameter962* @param x the parameter value963* @throws SQLException if parameterName does not correspond to a named964* parameter; if a database access error occurs or965* this method is called on a closed {@code CallableStatement}966* @throws SQLFeatureNotSupportedException if the JDBC driver does not support967* this method968* @see #getBytes969* @since 1.4970*/971void setBytes(String parameterName, byte x[]) throws SQLException;972973/**974* Sets the designated parameter to the given {@code java.sql.Date} value975* using the default time zone of the virtual machine that is running976* the application.977* The driver converts this978* to an SQL {@code DATE} value when it sends it to the database.979*980* @param parameterName the name of the parameter981* @param x the parameter value982* @throws SQLException if parameterName does not correspond to a named983* parameter; if a database access error occurs or984* this method is called on a closed {@code CallableStatement}985* @throws SQLFeatureNotSupportedException if the JDBC driver does not support986* this method987* @see #getDate988* @since 1.4989*/990void setDate(String parameterName, java.sql.Date x)991throws SQLException;992993/**994* Sets the designated parameter to the given {@code java.sql.Time} value.995* The driver converts this996* to an SQL {@code TIME} value when it sends it to the database.997*998* @param parameterName the name of the parameter999* @param x the parameter value1000* @throws SQLException if parameterName does not correspond to a named1001* parameter; if a database access error occurs or1002* this method is called on a closed {@code CallableStatement}1003* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1004* this method1005* @see #getTime1006* @since 1.41007*/1008void setTime(String parameterName, java.sql.Time x)1009throws SQLException;10101011/**1012* Sets the designated parameter to the given {@code java.sql.Timestamp} value.1013* The driver1014* converts this to an SQL {@code TIMESTAMP} value when it sends it to the1015* database.1016*1017* @param parameterName the name of the parameter1018* @param x the parameter value1019* @throws SQLException if parameterName does not correspond to a named1020* parameter; if a database access error occurs or1021* this method is called on a closed {@code CallableStatement}1022* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1023* this method1024* @see #getTimestamp1025* @since 1.41026*/1027void setTimestamp(String parameterName, java.sql.Timestamp x)1028throws SQLException;10291030/**1031* Sets the designated parameter to the given input stream, which will have1032* the specified number of bytes.1033* When a very large ASCII value is input to a {@code LONGVARCHAR}1034* parameter, it may be more practical to send it via a1035* {@code java.io.InputStream}. Data will be read from the stream1036* as needed until end-of-file is reached. The JDBC driver will1037* do any necessary conversion from ASCII to the database char format.1038*1039* <P><B>Note:</B> This stream object can either be a standard1040* Java stream object or your own subclass that implements the1041* standard interface.1042*1043* @param parameterName the name of the parameter1044* @param x the Java input stream that contains the ASCII parameter value1045* @param length the number of bytes in the stream1046* @throws SQLException if parameterName does not correspond to a named1047* parameter; if a database access error occurs or1048* this method is called on a closed {@code CallableStatement}1049* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1050* this method1051* @since 1.41052*/1053void setAsciiStream(String parameterName, java.io.InputStream x, int length)1054throws SQLException;10551056/**1057* Sets the designated parameter to the given input stream, which will have1058* the specified number of bytes.1059* When a very large binary value is input to a {@code LONGVARBINARY}1060* parameter, it may be more practical to send it via a1061* {@code java.io.InputStream} object. The data will be read from the stream1062* as needed until end-of-file is reached.1063*1064* <P><B>Note:</B> This stream object can either be a standard1065* Java stream object or your own subclass that implements the1066* standard interface.1067*1068* @param parameterName the name of the parameter1069* @param x the java input stream which contains the binary parameter value1070* @param length the number of bytes in the stream1071* @throws SQLException if parameterName does not correspond to a named1072* parameter; if a database access error occurs or1073* this method is called on a closed {@code CallableStatement}1074* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1075* this method1076* @since 1.41077*/1078void setBinaryStream(String parameterName, java.io.InputStream x,1079int length) throws SQLException;10801081/**1082* Sets the value of the designated parameter with the given object.1083*1084* <p>The given Java object will be converted to the given targetSqlType1085* before being sent to the database.1086*1087* If the object has a custom mapping (is of a class implementing the1088* interface {@code SQLData}),1089* the JDBC driver should call the method {@code SQLData.writeSQL} to write it1090* to the SQL data stream.1091* If, on the other hand, the object is of a class implementing1092* {@code Ref}, {@code Blob}, {@code Clob}, {@code NClob},1093* {@code Struct}, {@code java.net.URL},1094* or {@code Array}, the driver should pass it to the database as a1095* value of the corresponding SQL type.1096* <P>1097* Note that this method may be used to pass datatabase-1098* specific abstract data types.1099*1100* @param parameterName the name of the parameter1101* @param x the object containing the input parameter value1102* @param targetSqlType the SQL type (as defined in java.sql.Types) to be1103* sent to the database. The scale argument may further qualify this type.1104* @param scale for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types,1105* this is the number of digits after the decimal point. For all other1106* types, this value will be ignored.1107* @throws SQLException if parameterName does not correspond to a named1108* parameter; if a database access error occurs or1109* this method is called on a closed {@code CallableStatement}1110* @throws SQLFeatureNotSupportedException if1111* the JDBC driver does not support the specified targetSqlType1112* @see Types1113* @see #getObject1114* @since 1.41115*/1116void setObject(String parameterName, Object x, int targetSqlType, int scale)1117throws SQLException;11181119/**1120* Sets the value of the designated parameter with the given object.1121*1122* This method is similar to {@link #setObject(String parameterName,1123* Object x, int targetSqlType, int scaleOrLength)},1124* except that it assumes a scale of zero.1125*1126* @param parameterName the name of the parameter1127* @param x the object containing the input parameter value1128* @param targetSqlType the SQL type (as defined in java.sql.Types) to be1129* sent to the database1130* @throws SQLException if parameterName does not correspond to a named1131* parameter; if a database access error occurs or1132* this method is called on a closed {@code CallableStatement}1133* @throws SQLFeatureNotSupportedException if1134* the JDBC driver does not support the specified targetSqlType1135* @see #getObject1136* @since 1.41137*/1138void setObject(String parameterName, Object x, int targetSqlType)1139throws SQLException;11401141/**1142* Sets the value of the designated parameter with the given object.1143*1144* <p>The JDBC specification specifies a standard mapping from1145* Java {@code Object} types to SQL types. The given argument1146* will be converted to the corresponding SQL type before being1147* sent to the database.1148* <p>Note that this method may be used to pass database-1149* specific abstract data types, by using a driver-specific Java1150* type.1151*1152* If the object is of a class implementing the interface {@code SQLData},1153* the JDBC driver should call the method {@code SQLData.writeSQL}1154* to write it to the SQL data stream.1155* If, on the other hand, the object is of a class implementing1156* {@code Ref}, {@code Blob}, {@code Clob}, {@code NClob},1157* {@code Struct}, {@code java.net.URL},1158* or {@code Array}, the driver should pass it to the database as a1159* value of the corresponding SQL type.1160* <P>1161* This method throws an exception if there is an ambiguity, for example, if the1162* object is of a class implementing more than one of the interfaces named above.1163* <p>1164*<b>Note:</b> Not all databases allow for a non-typed Null to be sent to1165* the backend. For maximum portability, the {@code setNull} or the1166* {@code setObject(String parameterName, Object x, int sqlType)}1167* method should be used1168* instead of {@code setObject(String parameterName, Object x)}.1169*1170* @param parameterName the name of the parameter1171* @param x the object containing the input parameter value1172* @throws SQLException if parameterName does not correspond to a named1173* parameter; if a database access error occurs,1174* this method is called on a closed {@code CallableStatement} or if the given1175* {@code Object} parameter is ambiguous1176* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1177* this method1178* @see #getObject1179* @since 1.41180*/1181void setObject(String parameterName, Object x) throws SQLException;118211831184/**1185* Sets the designated parameter to the given {@code Reader}1186* object, which is the given number of characters long.1187* When a very large UNICODE value is input to a {@code LONGVARCHAR}1188* parameter, it may be more practical to send it via a1189* {@code java.io.Reader} object. The data will be read from the stream1190* as needed until end-of-file is reached. The JDBC driver will1191* do any necessary conversion from UNICODE to the database char format.1192*1193* <P><B>Note:</B> This stream object can either be a standard1194* Java stream object or your own subclass that implements the1195* standard interface.1196*1197* @param parameterName the name of the parameter1198* @param reader the {@code java.io.Reader} object that1199* contains the UNICODE data used as the designated parameter1200* @param length the number of characters in the stream1201* @throws SQLException if parameterName does not correspond to a named1202* parameter; if a database access error occurs or1203* this method is called on a closed {@code CallableStatement}1204* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1205* this method1206* @since 1.41207*/1208void setCharacterStream(String parameterName,1209java.io.Reader reader,1210int length) throws SQLException;12111212/**1213* Sets the designated parameter to the given {@code java.sql.Date} value,1214* using the given {@code Calendar} object. The driver uses1215* the {@code Calendar} object to construct an SQL {@code DATE} value,1216* which the driver then sends to the database. With a1217* a {@code Calendar} object, the driver can calculate the date1218* taking into account a custom timezone. If no1219* {@code Calendar} object is specified, the driver uses the default1220* timezone, which is that of the virtual machine running the application.1221*1222* @param parameterName the name of the parameter1223* @param x the parameter value1224* @param cal the {@code Calendar} object the driver will use1225* to construct the date1226* @throws SQLException if parameterName does not correspond to a named1227* parameter; if a database access error occurs or1228* this method is called on a closed {@code CallableStatement}1229* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1230* this method1231* @see #getDate1232* @since 1.41233*/1234void setDate(String parameterName, java.sql.Date x, Calendar cal)1235throws SQLException;12361237/**1238* Sets the designated parameter to the given {@code java.sql.Time} value,1239* using the given {@code Calendar} object. The driver uses1240* the {@code Calendar} object to construct an SQL {@code TIME} value,1241* which the driver then sends to the database. With a1242* a {@code Calendar} object, the driver can calculate the time1243* taking into account a custom timezone. If no1244* {@code Calendar} object is specified, the driver uses the default1245* timezone, which is that of the virtual machine running the application.1246*1247* @param parameterName the name of the parameter1248* @param x the parameter value1249* @param cal the {@code Calendar} object the driver will use1250* to construct the time1251* @throws SQLException if parameterName does not correspond to a named1252* parameter; if a database access error occurs or1253* this method is called on a closed {@code CallableStatement}1254* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1255* this method1256* @see #getTime1257* @since 1.41258*/1259void setTime(String parameterName, java.sql.Time x, Calendar cal)1260throws SQLException;12611262/**1263* Sets the designated parameter to the given {@code java.sql.Timestamp} value,1264* using the given {@code Calendar} object. The driver uses1265* the {@code Calendar} object to construct an SQL {@code TIMESTAMP} value,1266* which the driver then sends to the database. With a1267* a {@code Calendar} object, the driver can calculate the timestamp1268* taking into account a custom timezone. If no1269* {@code Calendar} object is specified, the driver uses the default1270* timezone, which is that of the virtual machine running the application.1271*1272* @param parameterName the name of the parameter1273* @param x the parameter value1274* @param cal the {@code Calendar} object the driver will use1275* to construct the timestamp1276* @throws SQLException if parameterName does not correspond to a named1277* parameter; if a database access error occurs or1278* this method is called on a closed {@code CallableStatement}1279* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1280* this method1281* @see #getTimestamp1282* @since 1.41283*/1284void setTimestamp(String parameterName, java.sql.Timestamp x, Calendar cal)1285throws SQLException;12861287/**1288* Sets the designated parameter to SQL {@code NULL}.1289* This version of the method {@code setNull} should1290* be used for user-defined types and REF type parameters. Examples1291* of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and1292* named array types.1293*1294* <P><B>Note:</B> To be portable, applications must give the1295* SQL type code and the fully-qualified SQL type name when specifying1296* a NULL user-defined or REF parameter. In the case of a user-defined type1297* the name is the type name of the parameter itself. For a REF1298* parameter, the name is the type name of the referenced type.1299* <p>1300* Although it is intended for user-defined and Ref parameters,1301* this method may be used to set a null parameter of any JDBC type.1302* If the parameter does not have a user-defined or REF type, the given1303* typeName is ignored.1304*1305*1306* @param parameterName the name of the parameter1307* @param sqlType a value from {@code java.sql.Types}1308* @param typeName the fully-qualified name of an SQL user-defined type;1309* ignored if the parameter is not a user-defined type or1310* SQL {@code REF} value1311* @throws SQLException if parameterName does not correspond to a named1312* parameter; if a database access error occurs or1313* this method is called on a closed {@code CallableStatement}1314* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1315* this method1316* @since 1.41317*/1318void setNull (String parameterName, int sqlType, String typeName)1319throws SQLException;13201321/**1322* Retrieves the value of a JDBC {@code CHAR}, {@code VARCHAR},1323* or {@code LONGVARCHAR} parameter as a {@code String} in1324* the Java programming language.1325* <p>1326* For the fixed-length type JDBC {@code CHAR},1327* the {@code String} object1328* returned has exactly the same value the SQL1329* {@code CHAR} value had in the1330* database, including any padding added by the database.1331* @param parameterName the name of the parameter1332* @return the parameter value. If the value is SQL {@code NULL}, the result1333* is {@code null}.1334* @throws SQLException if parameterName does not correspond to a named1335* parameter; if a database access error occurs or1336* this method is called on a closed {@code CallableStatement}1337* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1338* this method1339* @see #setString1340* @since 1.41341*/1342String getString(String parameterName) throws SQLException;13431344/**1345* Retrieves the value of a JDBC {@code BIT} or {@code BOOLEAN}1346* parameter as a1347* {@code boolean} in the Java programming language.1348* @param parameterName the name of the parameter1349* @return the parameter value. If the value is SQL {@code NULL}, the result1350* is {@code false}.1351* @throws SQLException if parameterName does not correspond to a named1352* parameter; if a database access error occurs or1353* this method is called on a closed {@code CallableStatement}1354* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1355* this method1356* @see #setBoolean1357* @since 1.41358*/1359boolean getBoolean(String parameterName) throws SQLException;13601361/**1362* Retrieves the value of a JDBC {@code TINYINT} parameter as a {@code byte}1363* in the Java programming language.1364* @param parameterName the name of the parameter1365* @return the parameter value. If the value is SQL {@code NULL}, the result1366* is {@code 0}.1367* @throws SQLException if parameterName does not correspond to a named1368* parameter; if a database access error occurs or1369* this method is called on a closed {@code CallableStatement}1370* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1371* this method1372* @see #setByte1373* @since 1.41374*/1375byte getByte(String parameterName) throws SQLException;13761377/**1378* Retrieves the value of a JDBC {@code SMALLINT} parameter as a {@code short}1379* in the Java programming language.1380* @param parameterName the name of the parameter1381* @return the parameter value. If the value is SQL {@code NULL}, the result1382* is {@code 0}.1383* @throws SQLException if parameterName does not correspond to a named1384* parameter; if a database access error occurs or1385* this method is called on a closed {@code CallableStatement}1386* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1387* this method1388* @see #setShort1389* @since 1.41390*/1391short getShort(String parameterName) throws SQLException;13921393/**1394* Retrieves the value of a JDBC {@code INTEGER} parameter as an {@code int}1395* in the Java programming language.1396*1397* @param parameterName the name of the parameter1398* @return the parameter value. If the value is SQL {@code NULL},1399* the result is {@code 0}.1400* @throws SQLException if parameterName does not correspond to a named1401* parameter; if a database access error occurs or1402* this method is called on a closed {@code CallableStatement}1403* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1404* this method1405* @see #setInt1406* @since 1.41407*/1408int getInt(String parameterName) throws SQLException;14091410/**1411* Retrieves the value of a JDBC {@code BIGINT} parameter as a {@code long}1412* in the Java programming language.1413*1414* @param parameterName the name of the parameter1415* @return the parameter value. If the value is SQL {@code NULL},1416* the result is {@code 0}.1417* @throws SQLException if parameterName does not correspond to a named1418* parameter; if a database access error occurs or1419* this method is called on a closed {@code CallableStatement}1420* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1421* this method1422* @see #setLong1423* @since 1.41424*/1425long getLong(String parameterName) throws SQLException;14261427/**1428* Retrieves the value of a JDBC {@code FLOAT} parameter as a {@code float}1429* in the Java programming language.1430* @param parameterName the name of the parameter1431* @return the parameter value. If the value is SQL {@code NULL},1432* the result is {@code 0}.1433* @throws SQLException if parameterName does not correspond to a named1434* parameter; if a database access error occurs or1435* this method is called on a closed {@code CallableStatement}1436* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1437* this method1438* @see #setFloat1439* @since 1.41440*/1441float getFloat(String parameterName) throws SQLException;14421443/**1444* Retrieves the value of a JDBC {@code DOUBLE} parameter as a {@code double}1445* in the Java programming language.1446* @param parameterName the name of the parameter1447* @return the parameter value. If the value is SQL {@code NULL},1448* the result is {@code 0}.1449* @throws SQLException if parameterName does not correspond to a named1450* parameter; if a database access error occurs or1451* this method is called on a closed {@code CallableStatement}1452* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1453* this method1454* @see #setDouble1455* @since 1.41456*/1457double getDouble(String parameterName) throws SQLException;14581459/**1460* Retrieves the value of a JDBC {@code BINARY} or {@code VARBINARY}1461* parameter as an array of {@code byte} values in the Java1462* programming language.1463* @param parameterName the name of the parameter1464* @return the parameter value. If the value is SQL {@code NULL}, the result is1465* {@code null}.1466* @throws SQLException if parameterName does not correspond to a named1467* parameter; if a database access error occurs or1468* this method is called on a closed {@code CallableStatement}1469* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1470* this method1471* @see #setBytes1472* @since 1.41473*/1474byte[] getBytes(String parameterName) throws SQLException;14751476/**1477* Retrieves the value of a JDBC {@code DATE} parameter as a1478* {@code java.sql.Date} object.1479* @param parameterName the name of the parameter1480* @return the parameter value. If the value is SQL {@code NULL}, the result1481* is {@code null}.1482* @throws SQLException if parameterName does not correspond to a named1483* parameter; if a database access error occurs or1484* this method is called on a closed {@code CallableStatement}1485* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1486* this method1487* @see #setDate1488* @since 1.41489*/1490java.sql.Date getDate(String parameterName) throws SQLException;14911492/**1493* Retrieves the value of a JDBC {@code TIME} parameter as a1494* {@code java.sql.Time} object.1495* @param parameterName the name of the parameter1496* @return the parameter value. If the value is SQL {@code NULL}, the result1497* is {@code null}.1498* @throws SQLException if parameterName does not correspond to a named1499* parameter; if a database access error occurs or1500* this method is called on a closed {@code CallableStatement}1501* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1502* this method1503* @see #setTime1504* @since 1.41505*/1506java.sql.Time getTime(String parameterName) throws SQLException;15071508/**1509* Retrieves the value of a JDBC {@code TIMESTAMP} parameter as a1510* {@code java.sql.Timestamp} object.1511* @param parameterName the name of the parameter1512* @return the parameter value. If the value is SQL {@code NULL}, the result1513* is {@code null}.1514* @throws SQLException if parameterName does not correspond to a named1515* parameter; if a database access error occurs or1516* this method is called on a closed {@code CallableStatement}1517* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1518* this method1519* @see #setTimestamp1520* @since 1.41521*/1522java.sql.Timestamp getTimestamp(String parameterName) throws SQLException;15231524/**1525* Retrieves the value of a parameter as an {@code Object} in the Java1526* programming language. If the value is an SQL {@code NULL}, the1527* driver returns a Java {@code null}.1528* <p>1529* This method returns a Java object whose type corresponds to the JDBC1530* type that was registered for this parameter using the method1531* {@code registerOutParameter}. By registering the target JDBC1532* type as {@code java.sql.Types.OTHER}, this method can be used1533* to read database-specific abstract data types.1534* @param parameterName the name of the parameter1535* @return A {@code java.lang.Object} holding the OUT parameter value.1536* @throws SQLException if parameterName does not correspond to a named1537* parameter; if a database access error occurs or1538* this method is called on a closed {@code CallableStatement}1539* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1540* this method1541* @see Types1542* @see #setObject1543* @since 1.41544*/1545Object getObject(String parameterName) throws SQLException;15461547/**1548* Retrieves the value of a JDBC {@code NUMERIC} parameter as a1549* {@code java.math.BigDecimal} object with as many digits to the1550* right of the decimal point as the value contains.1551* @param parameterName the name of the parameter1552* @return the parameter value in full precision. If the value is1553* SQL {@code NULL}, the result is {@code null}.1554* @throws SQLException if parameterName does not correspond to a named1555* parameter; if a database access error occurs or1556* this method is called on a closed {@code CallableStatement}1557* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1558* this method1559* @see #setBigDecimal1560* @since 1.41561*/1562BigDecimal getBigDecimal(String parameterName) throws SQLException;15631564/**1565* Returns an object representing the value of OUT parameter1566* {@code parameterName} and uses {@code map} for the custom1567* mapping of the parameter value.1568* <p>1569* This method returns a Java object whose type corresponds to the1570* JDBC type that was registered for this parameter using the method1571* {@code registerOutParameter}. By registering the target1572* JDBC type as {@code java.sql.Types.OTHER}, this method can1573* be used to read database-specific abstract data types.1574* @param parameterName the name of the parameter1575* @param map the mapping from SQL type names to Java classes1576* @return a {@code java.lang.Object} holding the OUT parameter value1577* @throws SQLException if parameterName does not correspond to a named1578* parameter; if a database access error occurs or1579* this method is called on a closed {@code CallableStatement}1580* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1581* this method1582* @see #setObject1583* @since 1.41584*/1585Object getObject(String parameterName, java.util.Map<String,Class<?>> map)1586throws SQLException;15871588/**1589* Retrieves the value of a JDBC {@code REF(<structured-type>)}1590* parameter as a {@link java.sql.Ref} object in the Java programming language.1591*1592* @param parameterName the name of the parameter1593* @return the parameter value as a {@code Ref} object in the1594* Java programming language. If the value was SQL {@code NULL},1595* the value {@code null} is returned.1596* @throws SQLException if parameterName does not correspond to a named1597* parameter; if a database access error occurs or1598* this method is called on a closed {@code CallableStatement}1599* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1600* this method1601* @since 1.41602*/1603Ref getRef (String parameterName) throws SQLException;16041605/**1606* Retrieves the value of a JDBC {@code BLOB} parameter as a1607* {@link java.sql.Blob} object in the Java programming language.1608*1609* @param parameterName the name of the parameter1610* @return the parameter value as a {@code Blob} object in the1611* Java programming language. If the value was SQL {@code NULL},1612* the value {@code null} is returned.1613* @throws SQLException if parameterName does not correspond to a named1614* parameter; if a database access error occurs or1615* this method is called on a closed {@code CallableStatement}1616* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1617* this method1618* @since 1.41619*/1620Blob getBlob (String parameterName) throws SQLException;16211622/**1623* Retrieves the value of a JDBC {@code CLOB} parameter as a1624* {@code java.sql.Clob} object in the Java programming language.1625* @param parameterName the name of the parameter1626* @return the parameter value as a {@code Clob} object in the1627* Java programming language. If the value was SQL {@code NULL},1628* the value {@code null} is returned.1629* @throws SQLException if parameterName does not correspond to a named1630* parameter; if a database access error occurs or1631* this method is called on a closed {@code CallableStatement}1632* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1633* this method1634* @since 1.41635*/1636Clob getClob (String parameterName) throws SQLException;16371638/**1639* Retrieves the value of a JDBC {@code ARRAY} parameter as an1640* {@link java.sql.Array} object in the Java programming language.1641*1642* @param parameterName the name of the parameter1643* @return the parameter value as an {@code Array} object in1644* Java programming language. If the value was SQL {@code NULL},1645* the value {@code null} is returned.1646* @throws SQLException if parameterName does not correspond to a named1647* parameter; if a database access error occurs or1648* this method is called on a closed {@code CallableStatement}1649* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1650* this method1651* @since 1.41652*/1653Array getArray (String parameterName) throws SQLException;16541655/**1656* Retrieves the value of a JDBC {@code DATE} parameter as a1657* {@code java.sql.Date} object, using1658* the given {@code Calendar} object1659* to construct the date.1660* With a {@code Calendar} object, the driver1661* can calculate the date taking into account a custom timezone and locale.1662* If no {@code Calendar} object is specified, the driver uses the1663* default timezone and locale.1664*1665* @param parameterName the name of the parameter1666* @param cal the {@code Calendar} object the driver will use1667* to construct the date1668* @return the parameter value. If the value is SQL {@code NULL},1669* the result is {@code null}.1670* @throws SQLException if parameterName does not correspond to a named1671* parameter; if a database access error occurs or1672* this method is called on a closed {@code CallableStatement}1673* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1674* this method1675* @see #setDate1676* @since 1.41677*/1678java.sql.Date getDate(String parameterName, Calendar cal)1679throws SQLException;16801681/**1682* Retrieves the value of a JDBC {@code TIME} parameter as a1683* {@code java.sql.Time} object, using1684* the given {@code Calendar} object1685* to construct the time.1686* With a {@code Calendar} object, the driver1687* can calculate the time taking into account a custom timezone and locale.1688* If no {@code Calendar} object is specified, the driver uses the1689* default timezone and locale.1690*1691* @param parameterName the name of the parameter1692* @param cal the {@code Calendar} object the driver will use1693* to construct the time1694* @return the parameter value; if the value is SQL {@code NULL}, the result is1695* {@code null}.1696* @throws SQLException if parameterName does not correspond to a named1697* parameter; if a database access error occurs or1698* this method is called on a closed {@code CallableStatement}1699* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1700* this method1701* @see #setTime1702* @since 1.41703*/1704java.sql.Time getTime(String parameterName, Calendar cal)1705throws SQLException;17061707/**1708* Retrieves the value of a JDBC {@code TIMESTAMP} parameter as a1709* {@code java.sql.Timestamp} object, using1710* the given {@code Calendar} object to construct1711* the {@code Timestamp} object.1712* With a {@code Calendar} object, the driver1713* can calculate the timestamp taking into account a custom timezone and locale.1714* If no {@code Calendar} object is specified, the driver uses the1715* default timezone and locale.1716*1717*1718* @param parameterName the name of the parameter1719* @param cal the {@code Calendar} object the driver will use1720* to construct the timestamp1721* @return the parameter value. If the value is SQL {@code NULL}, the result is1722* {@code null}.1723* @throws SQLException if parameterName does not correspond to a named1724* parameter; if a database access error occurs or1725* this method is called on a closed {@code CallableStatement}1726* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1727* this method1728* @see #setTimestamp1729* @since 1.41730*/1731java.sql.Timestamp getTimestamp(String parameterName, Calendar cal)1732throws SQLException;17331734/**1735* Retrieves the value of a JDBC {@code DATALINK} parameter as a1736* {@code java.net.URL} object.1737*1738* @param parameterName the name of the parameter1739* @return the parameter value as a {@code java.net.URL} object in the1740* Java programming language. If the value was SQL {@code NULL}, the1741* value {@code null} is returned.1742* @throws SQLException if parameterName does not correspond to a named1743* parameter; if a database access error occurs,1744* this method is called on a closed {@code CallableStatement},1745* or if there is a problem with the URL1746* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1747* this method1748* @see #setURL1749* @since 1.41750*/1751java.net.URL getURL(String parameterName) throws SQLException;17521753//------------------------- JDBC 4.0 -----------------------------------17541755/**1756* Retrieves the value of the designated JDBC {@code ROWID} parameter as a1757* {@code java.sql.RowId} object.1758*1759* @param parameterIndex the first parameter is 1, the second is 2,...1760* @return a {@code RowId} object that represents the JDBC {@code ROWID}1761* value is used as the designated parameter. If the parameter contains1762* a SQL {@code NULL}, then a {@code null} value is returned.1763* @throws SQLException if the parameterIndex is not valid;1764* if a database access error occurs or1765* this method is called on a closed {@code CallableStatement}1766* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1767* this method1768* @since 1.61769*/1770RowId getRowId(int parameterIndex) throws SQLException;17711772/**1773* Retrieves the value of the designated JDBC {@code ROWID} parameter as a1774* {@code java.sql.RowId} object.1775*1776* @param parameterName the name of the parameter1777* @return a {@code RowId} object that represents the JDBC {@code ROWID}1778* value is used as the designated parameter. If the parameter contains1779* a SQL {@code NULL}, then a {@code null} value is returned.1780* @throws SQLException if parameterName does not correspond to a named1781* parameter; if a database access error occurs or1782* this method is called on a closed {@code CallableStatement}1783* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1784* this method1785* @since 1.61786*/1787RowId getRowId(String parameterName) throws SQLException;17881789/**1790* Sets the designated parameter to the given {@code java.sql.RowId} object. The1791* driver converts this to a SQL {@code ROWID} when it sends it to the1792* database.1793*1794* @param parameterName the name of the parameter1795* @param x the parameter value1796* @throws SQLException if parameterName does not correspond to a named1797* parameter; if a database access error occurs or1798* this method is called on a closed {@code CallableStatement}1799* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1800* this method1801* @since 1.61802*/1803void setRowId(String parameterName, RowId x) throws SQLException;18041805/**1806* Sets the designated parameter to the given {@code String} object.1807* The driver converts this to a SQL {@code NCHAR} or1808* {@code NVARCHAR} or {@code LONGNVARCHAR}1809* @param parameterName the name of the parameter to be set1810* @param value the parameter value1811* @throws SQLException if parameterName does not correspond to a named1812* parameter; if the driver does not support national1813* character sets; if the driver can detect that a data conversion1814* error could occur; if a database access error occurs or1815* this method is called on a closed {@code CallableStatement}1816* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1817* this method1818* @since 1.61819*/1820void setNString(String parameterName, String value)1821throws SQLException;18221823/**1824* Sets the designated parameter to a {@code Reader} object. The1825* {@code Reader} reads the data till end-of-file is reached. The1826* driver does the necessary conversion from Java character format to1827* the national character set in the database.1828* @param parameterName the name of the parameter to be set1829* @param value the parameter value1830* @param length the number of characters in the parameter data.1831* @throws SQLException if parameterName does not correspond to a named1832* parameter; if the driver does not support national1833* character sets; if the driver can detect that a data conversion1834* error could occur; if a database access error occurs or1835* this method is called on a closed {@code CallableStatement}1836* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1837* this method1838* @since 1.61839*/1840void setNCharacterStream(String parameterName, Reader value, long length)1841throws SQLException;18421843/**1844* Sets the designated parameter to a {@code java.sql.NClob} object. The object1845* implements the {@code java.sql.NClob} interface. This {@code NClob}1846* object maps to a SQL {@code NCLOB}.1847* @param parameterName the name of the parameter to be set1848* @param value the parameter value1849* @throws SQLException if parameterName does not correspond to a named1850* parameter; if the driver does not support national1851* character sets; if the driver can detect that a data conversion1852* error could occur; if a database access error occurs or1853* this method is called on a closed {@code CallableStatement}1854* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1855* this method1856* @since 1.61857*/1858void setNClob(String parameterName, NClob value) throws SQLException;18591860/**1861* Sets the designated parameter to a {@code Reader} object. The {@code reader} must contain the number1862* of characters specified by length otherwise a {@code SQLException} will be1863* generated when the {@code CallableStatement} is executed.1864* This method differs from the {@code setCharacterStream (int, Reader, int)} method1865* because it informs the driver that the parameter value should be sent to1866* the server as a {@code CLOB}. When the {@code setCharacterStream} method is used, the1867* driver may have to do extra work to determine whether the parameter1868* data should be send to the server as a {@code LONGVARCHAR} or a {@code CLOB}1869* @param parameterName the name of the parameter to be set1870* @param reader An object that contains the data to set the parameter value to.1871* @param length the number of characters in the parameter data.1872* @throws SQLException if parameterName does not correspond to a named1873* parameter; if the length specified is less than zero;1874* a database access error occurs or1875* this method is called on a closed {@code CallableStatement}1876* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1877* this method1878*1879* @since 1.61880*/1881void setClob(String parameterName, Reader reader, long length)1882throws SQLException;18831884/**1885* Sets the designated parameter to an {@code InputStream} object.1886* The {@code Inputstream} must contain the number1887* of characters specified by length, otherwise a {@code SQLException} will be1888* generated when the {@code CallableStatement} is executed.1889* This method differs from the {@code setBinaryStream (int, InputStream, int)}1890* method because it informs the driver that the parameter value should be1891* sent to the server as a {@code BLOB}. When the {@code setBinaryStream} method is used,1892* the driver may have to do extra work to determine whether the parameter1893* data should be sent to the server as a {@code LONGVARBINARY} or a {@code BLOB}1894*1895* @param parameterName the name of the parameter to be set1896* the second is 2, ...1897*1898* @param inputStream An object that contains the data to set the parameter1899* value to.1900* @param length the number of bytes in the parameter data.1901* @throws SQLException if parameterName does not correspond to a named1902* parameter; if the length specified1903* is less than zero; if the number of bytes in the {@code InputStream}1904* does not match the specified length; if a database access error occurs or1905* this method is called on a closed {@code CallableStatement}1906* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1907* this method1908*1909* @since 1.61910*/1911void setBlob(String parameterName, InputStream inputStream, long length)1912throws SQLException;1913/**1914* Sets the designated parameter to a {@code Reader} object. The {@code reader} must contain the number1915* of characters specified by length otherwise a {@code SQLException} will be1916* generated when the {@code CallableStatement} is executed.1917* This method differs from the {@code setCharacterStream (int, Reader, int)} method1918* because it informs the driver that the parameter value should be sent to1919* the server as a {@code NCLOB}. When the {@code setCharacterStream} method is used, the1920* driver may have to do extra work to determine whether the parameter1921* data should be send to the server as a {@code LONGNVARCHAR} or a {@code NCLOB}1922*1923* @param parameterName the name of the parameter to be set1924* @param reader An object that contains the data to set the parameter value to.1925* @param length the number of characters in the parameter data.1926* @throws SQLException if parameterName does not correspond to a named1927* parameter; if the length specified is less than zero;1928* if the driver does not support national1929* character sets; if the driver can detect that a data conversion1930* error could occur; if a database access error occurs or1931* this method is called on a closed {@code CallableStatement}1932* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1933* this method1934* @since 1.61935*/1936void setNClob(String parameterName, Reader reader, long length)1937throws SQLException;19381939/**1940* Retrieves the value of the designated JDBC {@code NCLOB} parameter as a1941* {@code java.sql.NClob} object in the Java programming language.1942*1943* @param parameterIndex the first parameter is 1, the second is 2, and1944* so on1945* @return the parameter value as a {@code NClob} object in the1946* Java programming language. If the value was SQL {@code NULL}, the1947* value {@code null} is returned.1948* @throws SQLException if the parameterIndex is not valid;1949* if the driver does not support national1950* character sets; if the driver can detect that a data conversion1951* error could occur; if a database access error occurs or1952* this method is called on a closed {@code CallableStatement}1953* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1954* this method1955* @since 1.61956*/1957NClob getNClob (int parameterIndex) throws SQLException;195819591960/**1961* Retrieves the value of a JDBC {@code NCLOB} parameter as a1962* {@code java.sql.NClob} object in the Java programming language.1963* @param parameterName the name of the parameter1964* @return the parameter value as a {@code NClob} object in the1965* Java programming language. If the value was SQL {@code NULL},1966* the value {@code null} is returned.1967* @throws SQLException if parameterName does not correspond to a named1968* parameter; if the driver does not support national1969* character sets; if the driver can detect that a data conversion1970* error could occur; if a database access error occurs or1971* this method is called on a closed {@code CallableStatement}1972* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1973* this method1974* @since 1.61975*/1976NClob getNClob (String parameterName) throws SQLException;19771978/**1979* Sets the designated parameter to the given {@code java.sql.SQLXML} object. The driver converts this to an1980* {@code SQL XML} value when it sends it to the database.1981*1982* @param parameterName the name of the parameter1983* @param xmlObject a {@code SQLXML} object that maps an {@code SQL XML} value1984* @throws SQLException if parameterName does not correspond to a named1985* parameter; if a database access error occurs;1986* this method is called on a closed {@code CallableStatement} or1987* the {@code java.xml.transform.Result},1988* {@code Writer} or {@code OutputStream} has not been closed for the {@code SQLXML} object1989* @throws SQLFeatureNotSupportedException if the JDBC driver does not support1990* this method1991*1992* @since 1.61993*/1994void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException;19951996/**1997* Retrieves the value of the designated {@code SQL XML} parameter as a1998* {@code java.sql.SQLXML} object in the Java programming language.1999* @param parameterIndex index of the first parameter is 1, the second is 2, ...2000* @return a {@code SQLXML} object that maps an {@code SQL XML} value2001* @throws SQLException if the parameterIndex is not valid;2002* if a database access error occurs or2003* this method is called on a closed {@code CallableStatement}2004* @throws SQLFeatureNotSupportedException if the JDBC driver does not support2005* this method2006* @since 1.62007*/2008SQLXML getSQLXML(int parameterIndex) throws SQLException;20092010/**2011* Retrieves the value of the designated {@code SQL XML} parameter as a2012* {@code java.sql.SQLXML} object in the Java programming language.2013* @param parameterName the name of the parameter2014* @return a {@code SQLXML} object that maps an {@code SQL XML} value2015* @throws SQLException if parameterName does not correspond to a named2016* parameter; if a database access error occurs or2017* this method is called on a closed {@code CallableStatement}2018* @throws SQLFeatureNotSupportedException if the JDBC driver does not support2019* this method2020* @since 1.62021*/2022SQLXML getSQLXML(String parameterName) throws SQLException;20232024/**2025* Retrieves the value of the designated {@code NCHAR},2026* {@code NVARCHAR}2027* or {@code LONGNVARCHAR} parameter as2028* a {@code String} in the Java programming language.2029* <p>2030* For the fixed-length type JDBC {@code NCHAR},2031* the {@code String} object2032* returned has exactly the same value the SQL2033* {@code NCHAR} value had in the2034* database, including any padding added by the database.2035*2036* @param parameterIndex index of the first parameter is 1, the second is 2, ...2037* @return a {@code String} object that maps an2038* {@code NCHAR}, {@code NVARCHAR} or {@code LONGNVARCHAR} value2039* @throws SQLException if the parameterIndex is not valid;2040* if a database access error occurs or2041* this method is called on a closed {@code CallableStatement}2042* @throws SQLFeatureNotSupportedException if the JDBC driver does not support2043* this method2044* @since 1.62045* @see #setNString2046*/2047String getNString(int parameterIndex) throws SQLException;204820492050/**2051* Retrieves the value of the designated {@code NCHAR},2052* {@code NVARCHAR}2053* or {@code LONGNVARCHAR} parameter as2054* a {@code String} in the Java programming language.2055* <p>2056* For the fixed-length type JDBC {@code NCHAR},2057* the {@code String} object2058* returned has exactly the same value the SQL2059* {@code NCHAR} value had in the2060* database, including any padding added by the database.2061*2062* @param parameterName the name of the parameter2063* @return a {@code String} object that maps an2064* {@code NCHAR}, {@code NVARCHAR} or {@code LONGNVARCHAR} value2065* @throws SQLException if parameterName does not correspond to a named2066* parameter;2067* if a database access error occurs or2068* this method is called on a closed {@code CallableStatement}2069* @throws SQLFeatureNotSupportedException if the JDBC driver does not support2070* this method2071* @since 1.62072* @see #setNString2073*/2074String getNString(String parameterName) throws SQLException;20752076/**2077* Retrieves the value of the designated parameter as a2078* {@code java.io.Reader} object in the Java programming language.2079* It is intended for use when2080* accessing {@code NCHAR},{@code NVARCHAR}2081* and {@code LONGNVARCHAR} parameters.2082*2083* @return a {@code java.io.Reader} object that contains the parameter2084* value; if the value is SQL {@code NULL}, the value returned is2085* {@code null} in the Java programming language.2086* @param parameterIndex the first parameter is 1, the second is 2, ...2087* @throws SQLException if the parameterIndex is not valid;2088* if a database access error occurs or2089* this method is called on a closed {@code CallableStatement}2090* @throws SQLFeatureNotSupportedException if the JDBC driver does not support2091* this method2092* @since 1.62093*/2094java.io.Reader getNCharacterStream(int parameterIndex) throws SQLException;20952096/**2097* Retrieves the value of the designated parameter as a2098* {@code java.io.Reader} object in the Java programming language.2099* It is intended for use when2100* accessing {@code NCHAR},{@code NVARCHAR}2101* and {@code LONGNVARCHAR} parameters.2102*2103* @param parameterName the name of the parameter2104* @return a {@code java.io.Reader} object that contains the parameter2105* value; if the value is SQL {@code NULL}, the value returned is2106* {@code null} in the Java programming language2107* @throws SQLException if parameterName does not correspond to a named2108* parameter; if a database access error occurs or2109* this method is called on a closed {@code CallableStatement}2110* @throws SQLFeatureNotSupportedException if the JDBC driver does not support2111* this method2112* @since 1.62113*/2114java.io.Reader getNCharacterStream(String parameterName) throws SQLException;21152116/**2117* Retrieves the value of the designated parameter as a2118* {@code java.io.Reader} object in the Java programming language.2119*2120* @return a {@code java.io.Reader} object that contains the parameter2121* value; if the value is SQL {@code NULL}, the value returned is2122* {@code null} in the Java programming language.2123* @param parameterIndex the first parameter is 1, the second is 2, ...2124* @throws SQLException if the parameterIndex is not valid; if a database access error occurs or2125* this method is called on a closed {@code CallableStatement}2126* @since 1.62127*/2128java.io.Reader getCharacterStream(int parameterIndex) throws SQLException;21292130/**2131* Retrieves the value of the designated parameter as a2132* {@code java.io.Reader} object in the Java programming language.2133*2134* @param parameterName the name of the parameter2135* @return a {@code java.io.Reader} object that contains the parameter2136* value; if the value is SQL {@code NULL}, the value returned is2137* {@code null} in the Java programming language2138* @throws SQLException if parameterName does not correspond to a named2139* parameter; if a database access error occurs or2140* this method is called on a closed {@code CallableStatement}2141* @throws SQLFeatureNotSupportedException if the JDBC driver does not support2142* this method2143* @since 1.62144*/2145java.io.Reader getCharacterStream(String parameterName) throws SQLException;21462147/**2148* Sets the designated parameter to the given {@code java.sql.Blob} object.2149* The driver converts this to an SQL {@code BLOB} value when it2150* sends it to the database.2151*2152* @param parameterName the name of the parameter2153* @param x a {@code Blob} object that maps an SQL {@code BLOB} value2154* @throws SQLException if parameterName does not correspond to a named2155* parameter; if a database access error occurs or2156* this method is called on a closed {@code CallableStatement}2157* @throws SQLFeatureNotSupportedException if the JDBC driver does not support2158* this method2159* @since 1.62160*/2161void setBlob (String parameterName, Blob x) throws SQLException;21622163/**2164* Sets the designated parameter to the given {@code java.sql.Clob} object.2165* The driver converts this to an SQL {@code CLOB} value when it2166* sends it to the database.2167*2168* @param parameterName the name of the parameter2169* @param x a {@code Clob} object that maps an SQL {@code CLOB} value2170* @throws SQLException if parameterName does not correspond to a named2171* parameter; if a database access error occurs or2172* this method is called on a closed {@code CallableStatement}2173* @throws SQLFeatureNotSupportedException if the JDBC driver does not support2174* this method2175* @since 1.62176*/2177void setClob (String parameterName, Clob x) throws SQLException;2178/**2179* Sets the designated parameter to the given input stream, which will have2180* the specified number of bytes.2181* When a very large ASCII value is input to a {@code LONGVARCHAR}2182* parameter, it may be more practical to send it via a2183* {@code java.io.InputStream}. Data will be read from the stream2184* as needed until end-of-file is reached. The JDBC driver will2185* do any necessary conversion from ASCII to the database char format.2186*2187* <P><B>Note:</B> This stream object can either be a standard2188* Java stream object or your own subclass that implements the2189* standard interface.2190*2191* @param parameterName the name of the parameter2192* @param x the Java input stream that contains the ASCII parameter value2193* @param length the number of bytes in the stream2194* @throws SQLException if parameterName does not correspond to a named2195* parameter; if a database access error occurs or2196* this method is called on a closed {@code CallableStatement}2197* @throws SQLFeatureNotSupportedException if the JDBC driver does not support2198* this method2199* @since 1.62200*/2201void setAsciiStream(String parameterName, java.io.InputStream x, long length)2202throws SQLException;22032204/**2205* Sets the designated parameter to the given input stream, which will have2206* the specified number of bytes.2207* When a very large binary value is input to a {@code LONGVARBINARY}2208* parameter, it may be more practical to send it via a2209* {@code java.io.InputStream} object. The data will be read from the stream2210* as needed until end-of-file is reached.2211*2212* <P><B>Note:</B> This stream object can either be a standard2213* Java stream object or your own subclass that implements the2214* standard interface.2215*2216* @param parameterName the name of the parameter2217* @param x the java input stream which contains the binary parameter value2218* @param length the number of bytes in the stream2219* @throws SQLException if parameterName does not correspond to a named2220* parameter; if a database access error occurs or2221* this method is called on a closed {@code CallableStatement}2222* @throws SQLFeatureNotSupportedException if the JDBC driver does not support2223* this method2224* @since 1.62225*/2226void setBinaryStream(String parameterName, java.io.InputStream x,2227long length) throws SQLException;2228/**2229* Sets the designated parameter to the given {@code Reader}2230* object, which is the given number of characters long.2231* When a very large UNICODE value is input to a {@code LONGVARCHAR}2232* parameter, it may be more practical to send it via a2233* {@code java.io.Reader} object. The data will be read from the stream2234* as needed until end-of-file is reached. The JDBC driver will2235* do any necessary conversion from UNICODE to the database char format.2236*2237* <P><B>Note:</B> This stream object can either be a standard2238* Java stream object or your own subclass that implements the2239* standard interface.2240*2241* @param parameterName the name of the parameter2242* @param reader the {@code java.io.Reader} object that2243* contains the UNICODE data used as the designated parameter2244* @param length the number of characters in the stream2245* @throws SQLException if parameterName does not correspond to a named2246* parameter; if a database access error occurs or2247* this method is called on a closed {@code CallableStatement}2248* @throws SQLFeatureNotSupportedException if the JDBC driver does not support2249* this method2250* @since 1.62251*/2252void setCharacterStream(String parameterName,2253java.io.Reader reader,2254long length) throws SQLException;2255//--2256/**2257* Sets the designated parameter to the given input stream.2258* When a very large ASCII value is input to a {@code LONGVARCHAR}2259* parameter, it may be more practical to send it via a2260* {@code java.io.InputStream}. Data will be read from the stream2261* as needed until end-of-file is reached. The JDBC driver will2262* do any necessary conversion from ASCII to the database char format.2263*2264* <P><B>Note:</B> This stream object can either be a standard2265* Java stream object or your own subclass that implements the2266* standard interface.2267* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2268* it might be more efficient to use a version of2269* {@code setAsciiStream} which takes a length parameter.2270*2271* @param parameterName the name of the parameter2272* @param x the Java input stream that contains the ASCII parameter value2273* @throws SQLException if parameterName does not correspond to a named2274* parameter; if a database access error occurs or2275* this method is called on a closed {@code CallableStatement}2276* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2277* @since 1.62278*/2279void setAsciiStream(String parameterName, java.io.InputStream x)2280throws SQLException;2281/**2282* Sets the designated parameter to the given input stream.2283* When a very large binary value is input to a {@code LONGVARBINARY}2284* parameter, it may be more practical to send it via a2285* {@code java.io.InputStream} object. The data will be read from the2286* stream as needed until end-of-file is reached.2287*2288* <P><B>Note:</B> This stream object can either be a standard2289* Java stream object or your own subclass that implements the2290* standard interface.2291* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2292* it might be more efficient to use a version of2293* {@code setBinaryStream} which takes a length parameter.2294*2295* @param parameterName the name of the parameter2296* @param x the java input stream which contains the binary parameter value2297* @throws SQLException if parameterName does not correspond to a named2298* parameter; if a database access error occurs or2299* this method is called on a closed {@code CallableStatement}2300* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2301* @since 1.62302*/2303void setBinaryStream(String parameterName, java.io.InputStream x)2304throws SQLException;2305/**2306* Sets the designated parameter to the given {@code Reader}2307* object.2308* When a very large UNICODE value is input to a {@code LONGVARCHAR}2309* parameter, it may be more practical to send it via a2310* {@code java.io.Reader} object. The data will be read from the stream2311* as needed until end-of-file is reached. The JDBC driver will2312* do any necessary conversion from UNICODE to the database char format.2313*2314* <P><B>Note:</B> This stream object can either be a standard2315* Java stream object or your own subclass that implements the2316* standard interface.2317* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2318* it might be more efficient to use a version of2319* {@code setCharacterStream} which takes a length parameter.2320*2321* @param parameterName the name of the parameter2322* @param reader the {@code java.io.Reader} object that contains the2323* Unicode data2324* @throws SQLException if parameterName does not correspond to a named2325* parameter; if a database access error occurs or2326* this method is called on a closed {@code CallableStatement}2327* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2328* @since 1.62329*/2330void setCharacterStream(String parameterName,2331java.io.Reader reader) throws SQLException;2332/**2333* Sets the designated parameter to a {@code Reader} object. The2334* {@code Reader} reads the data till end-of-file is reached. The2335* driver does the necessary conversion from Java character format to2336* the national character set in the database.23372338* <P><B>Note:</B> This stream object can either be a standard2339* Java stream object or your own subclass that implements the2340* standard interface.2341* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2342* it might be more efficient to use a version of2343* {@code setNCharacterStream} which takes a length parameter.2344*2345* @param parameterName the name of the parameter2346* @param value the parameter value2347* @throws SQLException if parameterName does not correspond to a named2348* parameter; if the driver does not support national2349* character sets; if the driver can detect that a data conversion2350* error could occur; if a database access error occurs; or2351* this method is called on a closed {@code CallableStatement}2352* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2353* @since 1.62354*/2355void setNCharacterStream(String parameterName, Reader value) throws SQLException;23562357/**2358* Sets the designated parameter to a {@code Reader} object.2359* This method differs from the {@code setCharacterStream (int, Reader)} method2360* because it informs the driver that the parameter value should be sent to2361* the server as a {@code CLOB}. When the {@code setCharacterStream} method is used, the2362* driver may have to do extra work to determine whether the parameter2363* data should be send to the server as a {@code LONGVARCHAR} or a {@code CLOB}2364*2365* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2366* it might be more efficient to use a version of2367* {@code setClob} which takes a length parameter.2368*2369* @param parameterName the name of the parameter2370* @param reader An object that contains the data to set the parameter value to.2371* @throws SQLException if parameterName does not correspond to a named2372* parameter; if a database access error occurs or this method is called on2373* a closed {@code CallableStatement}2374*2375* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2376* @since 1.62377*/2378void setClob(String parameterName, Reader reader)2379throws SQLException;23802381/**2382* Sets the designated parameter to an {@code InputStream} object.2383* This method differs from the {@code setBinaryStream (int, InputStream)}2384* method because it informs the driver that the parameter value should be2385* sent to the server as a {@code BLOB}. When the {@code setBinaryStream} method is used,2386* the driver may have to do extra work to determine whether the parameter2387* data should be send to the server as a {@code LONGVARBINARY} or a {@code BLOB}2388*2389* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2390* it might be more efficient to use a version of2391* {@code setBlob} which takes a length parameter.2392*2393* @param parameterName the name of the parameter2394* @param inputStream An object that contains the data to set the parameter2395* value to.2396* @throws SQLException if parameterName does not correspond to a named2397* parameter; if a database access error occurs or2398* this method is called on a closed {@code CallableStatement}2399* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2400*2401* @since 1.62402*/2403void setBlob(String parameterName, InputStream inputStream)2404throws SQLException;2405/**2406* Sets the designated parameter to a {@code Reader} object.2407* This method differs from the {@code setCharacterStream (int, Reader)} method2408* because it informs the driver that the parameter value should be sent to2409* the server as a {@code NCLOB}. When the {@code setCharacterStream} method is used, the2410* driver may have to do extra work to determine whether the parameter2411* data should be send to the server as a {@code LONGNVARCHAR} or a {@code NCLOB}2412* <P><B>Note:</B> Consult your JDBC driver documentation to determine if2413* it might be more efficient to use a version of2414* {@code setNClob} which takes a length parameter.2415*2416* @param parameterName the name of the parameter2417* @param reader An object that contains the data to set the parameter value to.2418* @throws SQLException if parameterName does not correspond to a named2419* parameter; if the driver does not support national character sets;2420* if the driver can detect that a data conversion2421* error could occur; if a database access error occurs or2422* this method is called on a closed {@code CallableStatement}2423* @throws SQLFeatureNotSupportedException if the JDBC driver does not support this method2424*2425* @since 1.62426*/2427void setNClob(String parameterName, Reader reader)2428throws SQLException;24292430//------------------------- JDBC 4.1 -----------------------------------243124322433/**2434* Returns an object representing the value of OUT parameter2435* {@code parameterIndex} and will convert from the2436* SQL type of the parameter to the requested Java data type, if the2437* conversion is supported. If the conversion is not2438* supported or null is specified for the type, a2439* {@code SQLException} is thrown.2440*<p>2441* At a minimum, an implementation must support the conversions defined in2442* Appendix B, Table B-3 and conversion of appropriate user defined SQL2443* types to a Java type which implements {@code SQLData}, or {@code Struct}.2444* Additional conversions may be supported and are vendor defined.2445*2446* @param parameterIndex the first parameter is 1, the second is 2, and so on2447* @param type Class representing the Java data type to convert the2448* designated parameter to.2449* @param <T> the type of the class modeled by this Class object2450* @return an instance of {@code type} holding the OUT parameter value2451* @throws SQLException if conversion is not supported, type is null or2452* another error occurs. The getCause() method of the2453* exception may provide a more detailed exception, for example, if2454* a conversion error occurs2455* @throws SQLFeatureNotSupportedException if the JDBC driver does not support2456* this method2457* @since 1.72458*/2459public <T> T getObject(int parameterIndex, Class<T> type) throws SQLException;246024612462/**2463* Returns an object representing the value of OUT parameter2464* {@code parameterName} and will convert from the2465* SQL type of the parameter to the requested Java data type, if the2466* conversion is supported. If the conversion is not2467* supported or null is specified for the type, a2468* {@code SQLException} is thrown.2469*<p>2470* At a minimum, an implementation must support the conversions defined in2471* Appendix B, Table B-3 and conversion of appropriate user defined SQL2472* types to a Java type which implements {@code SQLData}, or {@code Struct}.2473* Additional conversions may be supported and are vendor defined.2474*2475* @param parameterName the name of the parameter2476* @param type Class representing the Java data type to convert2477* the designated parameter to.2478* @param <T> the type of the class modeled by this Class object2479* @return an instance of {@code type} holding the OUT parameter2480* value2481* @throws SQLException if conversion is not supported, type is null or2482* another error occurs. The getCause() method of the2483* exception may provide a more detailed exception, for example, if2484* a conversion error occurs2485* @throws SQLFeatureNotSupportedException if the JDBC driver does not support2486* this method2487* @since 1.72488*/2489public <T> T getObject(String parameterName, Class<T> type) throws SQLException;24902491//------------------------- JDBC 4.2 -----------------------------------24922493/**2494* Sets the value of the designated parameter with the given object.2495*2496* If the second argument is an {@code InputStream} then the stream2497* must contain the number of bytes specified by scaleOrLength.2498* If the second argument is a {@code Reader} then the reader must2499* contain the number of characters specified2500* by scaleOrLength. If these conditions are not true the driver2501* will generate a2502* {@code SQLException} when the prepared statement is executed.2503*2504* <p>The given Java object will be converted to the given targetSqlType2505* before being sent to the database.2506*2507* If the object has a custom mapping (is of a class implementing the2508* interface {@code SQLData}),2509* the JDBC driver should call the method {@code SQLData.writeSQL} to2510* write it to the SQL data stream.2511* If, on the other hand, the object is of a class implementing2512* {@code Ref}, {@code Blob}, {@code Clob}, {@code NClob},2513* {@code Struct}, {@code java.net.URL},2514* or {@code Array}, the driver should pass it to the database as a2515* value of the corresponding SQL type.2516*2517* <p>Note that this method may be used to pass database-specific2518* abstract data types.2519*<P>2520* The default implementation will throw {@code SQLFeatureNotSupportedException}2521*2522* @param parameterName the name of the parameter2523* @param x the object containing the input parameter value2524* @param targetSqlType the SQL type to be2525* sent to the database. The scale argument may further qualify this type.2526* @param scaleOrLength for {@code java.sql.JDBCType.DECIMAL}2527* or {@code java.sql.JDBCType.NUMERIC types},2528* this is the number of digits after the decimal point. For2529* Java Object types {@code InputStream} and {@code Reader},2530* this is the length2531* of the data in the stream or reader. For all other types,2532* this value will be ignored.2533* @throws SQLException if parameterName does not correspond to a named2534* parameter; if a database access error occurs2535* or this method is called on a closed {@code CallableStatement} or2536* if the Java Object specified by x is an InputStream2537* or Reader object and the value of the scale parameter is less2538* than zero2539* @throws SQLFeatureNotSupportedException if2540* the JDBC driver does not support the specified targetSqlType2541* @see JDBCType2542* @see SQLType2543*2544* @since 1.82545*/2546default void setObject(String parameterName, Object x, SQLType targetSqlType,2547int scaleOrLength) throws SQLException {2548throw new SQLFeatureNotSupportedException("setObject not implemented");2549}2550/**2551* Sets the value of the designated parameter with the given object.2552*2553* This method is similar to {@link #setObject(String parameterName,2554* Object x, SQLType targetSqlType, int scaleOrLength)},2555* except that it assumes a scale of zero.2556*<P>2557* The default implementation will throw {@code SQLFeatureNotSupportedException}2558*2559* @param parameterName the name of the parameter2560* @param x the object containing the input parameter value2561* @param targetSqlType the SQL type to be sent to the database2562* @throws SQLException if parameterName does not correspond to a named2563* parameter; if a database access error occurs2564* or this method is called on a closed {@code CallableStatement}2565* @throws SQLFeatureNotSupportedException if2566* the JDBC driver does not support the specified targetSqlType2567* @see JDBCType2568* @see SQLType2569* @since 1.82570*/2571default void setObject(String parameterName, Object x, SQLType targetSqlType)2572throws SQLException {2573throw new SQLFeatureNotSupportedException("setObject not implemented");2574}25752576/**2577* Registers the OUT parameter in ordinal position2578* {@code parameterIndex} to the JDBC type2579* {@code sqlType}. All OUT parameters must be registered2580* before a stored procedure is executed.2581* <p>2582* The JDBC type specified by {@code sqlType} for an OUT2583* parameter determines the Java type that must be used2584* in the {@code get} method to read the value of that parameter.2585* <p>2586* If the JDBC type expected to be returned to this output parameter2587* is specific to this particular database, {@code sqlType}2588* may be {@code JDBCType.OTHER} or a {@code SQLType} that is supported by2589* the JDBC driver. The method2590* {@link #getObject} retrieves the value.2591*<P>2592* The default implementation will throw {@code SQLFeatureNotSupportedException}2593*2594* @param parameterIndex the first parameter is 1, the second is 2,2595* and so on2596* @param sqlType the JDBC type code defined by {@code SQLType} to use to2597* register the OUT Parameter.2598* If the parameter is of JDBC type {@code JDBCType.NUMERIC}2599* or {@code JDBCType.DECIMAL}, the version of2600* {@code registerOutParameter} that accepts a scale value2601* should be used.2602*2603* @throws SQLException if the parameterIndex is not valid;2604* if a database access error occurs or2605* this method is called on a closed {@code CallableStatement}2606* @throws SQLFeatureNotSupportedException if2607* the JDBC driver does not support the specified sqlType2608* @see JDBCType2609* @see SQLType2610* @since 1.82611*/2612default void registerOutParameter(int parameterIndex, SQLType sqlType)2613throws SQLException {2614throw new SQLFeatureNotSupportedException("registerOutParameter not implemented");2615}26162617/**2618* Registers the parameter in ordinal position2619* {@code parameterIndex} to be of JDBC type2620* {@code sqlType}. All OUT parameters must be registered2621* before a stored procedure is executed.2622* <p>2623* The JDBC type specified by {@code sqlType} for an OUT2624* parameter determines the Java type that must be used2625* in the {@code get} method to read the value of that parameter.2626* <p>2627* This version of {@code registerOutParameter} should be2628* used when the parameter is of JDBC type {@code JDBCType.NUMERIC}2629* or {@code JDBCType.DECIMAL}.2630*<P>2631* The default implementation will throw {@code SQLFeatureNotSupportedException}2632*2633* @param parameterIndex the first parameter is 1, the second is 2,2634* and so on2635* @param sqlType the JDBC type code defined by {@code SQLType} to use to2636* register the OUT Parameter.2637* @param scale the desired number of digits to the right of the2638* decimal point. It must be greater than or equal to zero.2639* @throws SQLException if the parameterIndex is not valid;2640* if a database access error occurs or2641* this method is called on a closed {@code CallableStatement}2642* @throws SQLFeatureNotSupportedException if2643* the JDBC driver does not support the specified sqlType2644* @see JDBCType2645* @see SQLType2646* @since 1.82647*/2648default void registerOutParameter(int parameterIndex, SQLType sqlType,2649int scale) throws SQLException {2650throw new SQLFeatureNotSupportedException("registerOutParameter not implemented");2651}2652/**2653* Registers the designated output parameter.2654* This version of2655* the method {@code registerOutParameter}2656* should be used for a user-defined or {@code REF} output parameter.2657* Examples2658* of user-defined types include: {@code STRUCT}, {@code DISTINCT},2659* {@code JAVA_OBJECT}, and named array types.2660*<p>2661* All OUT parameters must be registered2662* before a stored procedure is executed.2663* <p> For a user-defined parameter, the fully-qualified SQL2664* type name of the parameter should also be given, while a {@code REF}2665* parameter requires that the fully-qualified type name of the2666* referenced type be given. A JDBC driver that does not need the2667* type code and type name information may ignore it. To be portable,2668* however, applications should always provide these values for2669* user-defined and {@code REF} parameters.2670*2671* Although it is intended for user-defined and {@code REF} parameters,2672* this method may be used to register a parameter of any JDBC type.2673* If the parameter does not have a user-defined or {@code REF} type, the2674* <i>typeName</i> parameter is ignored.2675*2676* <P><B>Note:</B> When reading the value of an out parameter, you2677* must use the getter method whose Java type corresponds to the2678* parameter's registered SQL type.2679*<P>2680* The default implementation will throw {@code SQLFeatureNotSupportedException}2681*2682* @param parameterIndex the first parameter is 1, the second is 2,...2683* @param sqlType the JDBC type code defined by {@code SQLType} to use to2684* register the OUT Parameter.2685* @param typeName the fully-qualified name of an SQL structured type2686* @throws SQLException if the parameterIndex is not valid;2687* if a database access error occurs or2688* this method is called on a closed {@code CallableStatement}2689* @throws SQLFeatureNotSupportedException if2690* the JDBC driver does not support the specified sqlType2691* @see JDBCType2692* @see SQLType2693* @since 1.82694*/2695default void registerOutParameter (int parameterIndex, SQLType sqlType,2696String typeName) throws SQLException {2697throw new SQLFeatureNotSupportedException("registerOutParameter not implemented");2698}26992700/**2701* Registers the OUT parameter named2702* {@code parameterName} to the JDBC type2703* {@code sqlType}. All OUT parameters must be registered2704* before a stored procedure is executed.2705* <p>2706* The JDBC type specified by {@code sqlType} for an OUT2707* parameter determines the Java type that must be used2708* in the {@code get} method to read the value of that parameter.2709* <p>2710* If the JDBC type expected to be returned to this output parameter2711* is specific to this particular database, {@code sqlType}2712* should be {@code JDBCType.OTHER} or a {@code SQLType} that is supported2713* by the JDBC driver.. The method2714* {@link #getObject} retrieves the value.2715*<P>2716* The default implementation will throw {@code SQLFeatureNotSupportedException}2717*2718* @param parameterName the name of the parameter2719* @param sqlType the JDBC type code defined by {@code SQLType} to use to2720* register the OUT Parameter.2721* If the parameter is of JDBC type {@code JDBCType.NUMERIC}2722* or {@code JDBCType.DECIMAL}, the version of2723* {@code registerOutParameter} that accepts a scale value2724* should be used.2725* @throws SQLException if parameterName does not correspond to a named2726* parameter; if a database access error occurs or2727* this method is called on a closed {@code CallableStatement}2728* @throws SQLFeatureNotSupportedException if2729* the JDBC driver does not support the specified sqlType2730* or if the JDBC driver does not support2731* this method2732* @since 1.82733* @see JDBCType2734* @see SQLType2735*/2736default void registerOutParameter(String parameterName, SQLType sqlType)2737throws SQLException {2738throw new SQLFeatureNotSupportedException("registerOutParameter not implemented");2739}27402741/**2742* Registers the parameter named2743* {@code parameterName} to be of JDBC type2744* {@code sqlType}. All OUT parameters must be registered2745* before a stored procedure is executed.2746* <p>2747* The JDBC type specified by {@code sqlType} for an OUT2748* parameter determines the Java type that must be used2749* in the {@code get} method to read the value of that parameter.2750* <p>2751* This version of {@code registerOutParameter} should be2752* used when the parameter is of JDBC type {@code JDBCType.NUMERIC}2753* or {@code JDBCType.DECIMAL}.2754*<P>2755* The default implementation will throw {@code SQLFeatureNotSupportedException}2756*2757* @param parameterName the name of the parameter2758* @param sqlType the JDBC type code defined by {@code SQLType} to use to2759* register the OUT Parameter.2760* @param scale the desired number of digits to the right of the2761* decimal point. It must be greater than or equal to zero.2762* @throws SQLException if parameterName does not correspond to a named2763* parameter; if a database access error occurs or2764* this method is called on a closed {@code CallableStatement}2765* @throws SQLFeatureNotSupportedException if2766* the JDBC driver does not support the specified sqlType2767* or if the JDBC driver does not support2768* this method2769* @since 1.82770* @see JDBCType2771* @see SQLType2772*/2773default void registerOutParameter(String parameterName, SQLType sqlType,2774int scale) throws SQLException {2775throw new SQLFeatureNotSupportedException("registerOutParameter not implemented");2776}27772778/**2779* Registers the designated output parameter. This version of2780* the method {@code registerOutParameter}2781* should be used for a user-named or REF output parameter. Examples2782* of user-named types include: STRUCT, DISTINCT, JAVA_OBJECT, and2783* named array types.2784*<p>2785* All OUT parameters must be registered2786* before a stored procedure is executed.2787* </p>2788* For a user-named parameter the fully-qualified SQL2789* type name of the parameter should also be given, while a REF2790* parameter requires that the fully-qualified type name of the2791* referenced type be given. A JDBC driver that does not need the2792* type code and type name information may ignore it. To be portable,2793* however, applications should always provide these values for2794* user-named and REF parameters.2795*2796* Although it is intended for user-named and REF parameters,2797* this method may be used to register a parameter of any JDBC type.2798* If the parameter does not have a user-named or REF type, the2799* typeName parameter is ignored.2800*2801* <P><B>Note:</B> When reading the value of an out parameter, you2802* must use the {@code getXXX} method whose Java type XXX corresponds to the2803* parameter's registered SQL type.2804*<P>2805* The default implementation will throw {@code SQLFeatureNotSupportedException}2806*2807* @param parameterName the name of the parameter2808* @param sqlType the JDBC type code defined by {@code SQLType} to use to2809* register the OUT Parameter.2810* @param typeName the fully-qualified name of an SQL structured type2811* @throws SQLException if parameterName does not correspond to a named2812* parameter; if a database access error occurs or2813* this method is called on a closed {@code CallableStatement}2814* @throws SQLFeatureNotSupportedException if2815* the JDBC driver does not support the specified sqlType2816* or if the JDBC driver does not support this method2817* @see JDBCType2818* @see SQLType2819* @since 1.82820*/2821default void registerOutParameter (String parameterName, SQLType sqlType,2822String typeName) throws SQLException {2823throw new SQLFeatureNotSupportedException("registerOutParameter not implemented");2824}2825}282628272828