Movatterモバイル変換


[0]ホーム

URL:



          
Java™ Platform
Standard Ed. 6


Interface CallableStatement

All Superinterfaces:
PreparedStatement,Statement,Wrapper

public interfaceCallableStatement
extendsPreparedStatement

The interface used to execute SQL stored procedures. The JDBC API provides a stored procedure SQL escape syntax that allows stored procedures to be called in a standard way for all RDBMSs. This escape syntax has one form that includes a result parameter and one that does not. If used, the result parameter must be registered as an OUT parameter. The other parameters can be used for input, output or both. Parameters are referred to sequentially, by number, with the first parameter being 1.

   {?= call <procedure-name>[(<arg1>,<arg2>, ...)]}   {call <procedure-name>[(<arg1>,<arg2>, ...)]}

IN parameter values are set using theset methods inherited fromPreparedStatement. The type of all OUT parameters must be registered prior to executing the stored procedure; their values are retrieved after execution via theget methods provided here.

ACallableStatement can return oneResultSet object or multipleResultSet objects. MultipleResultSet objects are handled using operations inherited fromStatement.

For maximum portability, a call'sResultSet objects and update counts should be processed prior to getting the values of output parameters.

See Also:
Connection.prepareCall(java.lang.String),ResultSet

 
Fields inherited from interface java.sql.Statement
CLOSE_ALL_RESULTS,CLOSE_CURRENT_RESULT,EXECUTE_FAILED,KEEP_CURRENT_RESULT,NO_GENERATED_KEYS,RETURN_GENERATED_KEYS,SUCCESS_NO_INFO
 
getArray(int parameterIndex)
          Retrieves the value of the designated JDBCARRAY parameter as anArray object in the Java programming language.
getArray(String parameterName)
          Retrieves the value of a JDBCARRAY parameter as anArray object in the Java programming language.
getBigDecimal(int parameterIndex)
          Retrieves the value of the designated JDBCNUMERIC parameter as ajava.math.BigDecimal object with as many digits to the right of the decimal point as the value contains.
getBigDecimal(int parameterIndex, int scale)
          Deprecated. usegetBigDecimal(int parameterIndex) orgetBigDecimal(String parameterName)
getBigDecimal(String parameterName)
          Retrieves the value of a JDBCNUMERIC parameter as ajava.math.BigDecimal object with as many digits to the right of the decimal point as the value contains.
getBlob(int parameterIndex)
          Retrieves the value of the designated JDBCBLOB parameter as aBlob object in the Java programming language.
getBlob(String parameterName)
          Retrieves the value of a JDBCBLOB parameter as aBlob object in the Java programming language.
getBoolean(int parameterIndex)
          Retrieves the value of the designated JDBCBIT orBOOLEAN parameter as aboolean in the Java programming language.
getBoolean(String parameterName)
          Retrieves the value of a JDBCBIT orBOOLEAN parameter as aboolean in the Java programming language.
getByte(int parameterIndex)
          Retrieves the value of the designated JDBCTINYINT parameter as abyte in the Java programming language.
getByte(String parameterName)
          Retrieves the value of a JDBCTINYINT parameter as abyte in the Java programming language.
getBytes(int parameterIndex)
          Retrieves the value of the designated JDBCBINARY orVARBINARY parameter as an array ofbyte values in the Java programming language.
getBytes(String parameterName)
          Retrieves the value of a JDBCBINARY orVARBINARY parameter as an array ofbyte values in the Java programming language.
getCharacterStream(int parameterIndex)
          Retrieves the value of the designated parameter as ajava.io.Reader object in the Java programming language.
getCharacterStream(String parameterName)
          Retrieves the value of the designated parameter as ajava.io.Reader object in the Java programming language.
getClob(int parameterIndex)
          Retrieves the value of the designated JDBCCLOB parameter as ajava.sql.Clob object in the Java programming language.
getClob(String parameterName)
          Retrieves the value of a JDBCCLOB parameter as ajava.sql.Clob object in the Java programming language.
getDate(int parameterIndex)
          Retrieves the value of the designated JDBCDATE parameter as ajava.sql.Date object.
getDate(int parameterIndex,Calendar cal)
          Retrieves the value of the designated JDBCDATE parameter as ajava.sql.Date object, using the givenCalendar object to construct the date.
getDate(String parameterName)
          Retrieves the value of a JDBCDATE parameter as ajava.sql.Date object.
getDate(String parameterName,Calendar cal)
          Retrieves the value of a JDBCDATE parameter as ajava.sql.Date object, using the givenCalendar object to construct the date.
getDouble(int parameterIndex)
          Retrieves the value of the designated JDBCDOUBLE parameter as adouble in the Java programming language.
getDouble(String parameterName)
          Retrieves the value of a JDBCDOUBLE parameter as adouble in the Java programming language.
getFloat(int parameterIndex)
          Retrieves the value of the designated JDBCFLOAT parameter as afloat in the Java programming language.
getFloat(String parameterName)
          Retrieves the value of a JDBCFLOAT parameter as afloat in the Java programming language.
getInt(int parameterIndex)
          Retrieves the value of the designated JDBCINTEGER parameter as anint in the Java programming language.
getInt(String parameterName)
          Retrieves the value of a JDBCINTEGER parameter as anint in the Java programming language.
getLong(int parameterIndex)
          Retrieves the value of the designated JDBCBIGINT parameter as along in the Java programming language.
getLong(String parameterName)
          Retrieves the value of a JDBCBIGINT parameter as along in the Java programming language.
getNCharacterStream(int parameterIndex)
          Retrieves the value of the designated parameter as ajava.io.Reader object in the Java programming language.
getNCharacterStream(String parameterName)
          Retrieves the value of the designated parameter as ajava.io.Reader object in the Java programming language.
getNClob(int parameterIndex)
          Retrieves the value of the designated JDBCNCLOB parameter as ajava.sql.NClob object in the Java programming language.
getNClob(String parameterName)
          Retrieves the value of a JDBCNCLOB parameter as ajava.sql.NClob object in the Java programming language.
getNString(int parameterIndex)
          Retrieves the value of the designatedNCHAR,NVARCHAR orLONGNVARCHAR parameter as aString in the Java programming language.
getNString(String parameterName)
          Retrieves the value of the designatedNCHAR,NVARCHAR orLONGNVARCHAR parameter as aString in the Java programming language.
getObject(int parameterIndex)
          Retrieves the value of the designated parameter as anObject in the Java programming language.
getObject(int parameterIndex,Map<String,Class<?>> map)
          Returns an object representing the value of OUT parameterparameterIndex and usesmap for the custom mapping of the parameter value.
getObject(String parameterName)
          Retrieves the value of a parameter as anObject in the Java programming language.
getObject(String parameterName,Map<String,Class<?>> map)
          Returns an object representing the value of OUT parameterparameterName and usesmap for the custom mapping of the parameter value.
getRef(int parameterIndex)
          Retrieves the value of the designated JDBCREF(<structured-type>) parameter as aRef object in the Java programming language.
getRef(String parameterName)
          Retrieves the value of a JDBCREF(<structured-type>) parameter as aRef object in the Java programming language.
getRowId(int parameterIndex)
          Retrieves the value of the designated JDBCROWID parameter as ajava.sql.RowId object.
getRowId(String parameterName)
          Retrieves the value of the designated JDBCROWID parameter as ajava.sql.RowId object.
getShort(int parameterIndex)
          Retrieves the value of the designated JDBCSMALLINT parameter as ashort in the Java programming language.
getShort(String parameterName)
          Retrieves the value of a JDBCSMALLINT parameter as ashort in the Java programming language.
getSQLXML(int parameterIndex)
          Retrieves the value of the designatedSQL XML parameter as ajava.sql.SQLXML object in the Java programming language.
getSQLXML(String parameterName)
          Retrieves the value of the designatedSQL XML parameter as ajava.sql.SQLXML object in the Java programming language.
getString(int parameterIndex)
          Retrieves the value of the designated JDBCCHAR,VARCHAR, orLONGVARCHAR parameter as aString in the Java programming language.
getString(String parameterName)
          Retrieves the value of a JDBCCHAR,VARCHAR, orLONGVARCHAR parameter as aString in the Java programming language.
getTime(int parameterIndex)
          Retrieves the value of the designated JDBCTIME parameter as ajava.sql.Time object.
getTime(int parameterIndex,Calendar cal)
          Retrieves the value of the designated JDBCTIME parameter as ajava.sql.Time object, using the givenCalendar object to construct the time.
getTime(String parameterName)
          Retrieves the value of a JDBCTIME parameter as ajava.sql.Time object.
getTime(String parameterName,Calendar cal)
          Retrieves the value of a JDBCTIME parameter as ajava.sql.Time object, using the givenCalendar object to construct the time.
getTimestamp(int parameterIndex)
          Retrieves the value of the designated JDBCTIMESTAMP parameter as ajava.sql.Timestamp object.
getTimestamp(int parameterIndex,Calendar cal)
          Retrieves the value of the designated JDBCTIMESTAMP parameter as ajava.sql.Timestamp object, using the givenCalendar object to construct theTimestamp object.
getTimestamp(String parameterName)
          Retrieves the value of a JDBCTIMESTAMP parameter as ajava.sql.Timestamp object.
getTimestamp(String parameterName,Calendar cal)
          Retrieves the value of a JDBCTIMESTAMP parameter as ajava.sql.Timestamp object, using the givenCalendar object to construct theTimestamp object.
getURL(int parameterIndex)
          Retrieves the value of the designated JDBCDATALINK parameter as ajava.net.URL object.
getURL(String parameterName)
          Retrieves the value of a JDBCDATALINK parameter as ajava.net.URL object.
registerOutParameter(int parameterIndex, int sqlType)
          Registers the OUT parameter in ordinal positionparameterIndex to the JDBC typesqlType.
registerOutParameter(int parameterIndex, int sqlType, int scale)
          Registers the parameter in ordinal positionparameterIndex to be of JDBC typesqlType.
registerOutParameter(int parameterIndex, int sqlType,String typeName)
          Registers the designated output parameter.
registerOutParameter(String parameterName, int sqlType)
          Registers the OUT parameter namedparameterName to the JDBC typesqlType.
registerOutParameter(String parameterName, int sqlType, int scale)
          Registers the parameter namedparameterName to be of JDBC typesqlType.
registerOutParameter(String parameterName, int sqlType,String typeName)
          Registers the designated output parameter.
setAsciiStream(String parameterName,InputStream x)
          Sets the designated parameter to the given input stream.
setAsciiStream(String parameterName,InputStream x, int length)
          Sets the designated parameter to the given input stream, which will have the specified number of bytes.
setAsciiStream(String parameterName,InputStream x, long length)
          Sets the designated parameter to the given input stream, which will have the specified number of bytes.
setBigDecimal(String parameterName,BigDecimal x)
          Sets the designated parameter to the givenjava.math.BigDecimal value.
setBinaryStream(String parameterName,InputStream x)
          Sets the designated parameter to the given input stream.
setBinaryStream(String parameterName,InputStream x, int length)
          Sets the designated parameter to the given input stream, which will have the specified number of bytes.
setBinaryStream(String parameterName,InputStream x, long length)
          Sets the designated parameter to the given input stream, which will have the specified number of bytes.
setBlob(String parameterName,Blob x)
          Sets the designated parameter to the givenjava.sql.Blob object.
setBlob(String parameterName,InputStream inputStream)
          Sets the designated parameter to aInputStream object.
setBlob(String parameterName,InputStream inputStream, long length)
          Sets the designated parameter to aInputStream object.
setBoolean(String parameterName, boolean x)
          Sets the designated parameter to the given Javaboolean value.
setByte(String parameterName, byte x)
          Sets the designated parameter to the given Javabyte value.
setBytes(String parameterName, byte[] x)
          Sets the designated parameter to the given Java array of bytes.
setCharacterStream(String parameterName,Reader reader)
          Sets the designated parameter to the givenReader object.
setCharacterStream(String parameterName,Reader reader, int length)
          Sets the designated parameter to the givenReader object, which is the given number of characters long.
setCharacterStream(String parameterName,Reader reader, long length)
          Sets the designated parameter to the givenReader object, which is the given number of characters long.
setClob(String parameterName,Clob x)
          Sets the designated parameter to the givenjava.sql.Clob object.
setClob(String parameterName,Reader reader)
          Sets the designated parameter to aReader object.
setClob(String parameterName,Reader reader, long length)
          Sets the designated parameter to aReader object.
setDate(String parameterName,Date x)
          Sets the designated parameter to the givenjava.sql.Date value using the default time zone of the virtual machine that is running the application.
setDate(String parameterName,Date x,Calendar cal)
          Sets the designated parameter to the givenjava.sql.Date value, using the givenCalendar object.
setDouble(String parameterName, double x)
          Sets the designated parameter to the given Javadouble value.
setFloat(String parameterName, float x)
          Sets the designated parameter to the given Javafloat value.
setInt(String parameterName, int x)
          Sets the designated parameter to the given Javaint value.
setLong(String parameterName, long x)
          Sets the designated parameter to the given Javalong value.
setNCharacterStream(String parameterName,Reader value)
          Sets the designated parameter to aReader object.
setNCharacterStream(String parameterName,Reader value, long length)
          Sets the designated parameter to aReader object.
setNClob(String parameterName,NClob value)
          Sets the designated parameter to ajava.sql.NClob object.
setNClob(String parameterName,Reader reader)
          Sets the designated parameter to aReader object.
setNClob(String parameterName,Reader reader, long length)
          Sets the designated parameter to aReader object.
setNString(String parameterName,String value)
          Sets the designated parameter to the givenString object.
setNull(String parameterName, int sqlType)
          Sets the designated parameter to SQLNULL.
setNull(String parameterName, int sqlType,String typeName)
          Sets the designated parameter to SQLNULL.
setObject(String parameterName,Object x)
          Sets the value of the designated parameter with the given object.
setObject(String parameterName,Object x, int targetSqlType)
          Sets the value of the designated parameter with the given object.
setObject(String parameterName,Object x, int targetSqlType, int scale)
          Sets the value of the designated parameter with the given object.
setRowId(String parameterName,RowId x)
          Sets the designated parameter to the givenjava.sql.RowId object.
setShort(String parameterName, short x)
          Sets the designated parameter to the given Javashort value.
setSQLXML(String parameterName,SQLXML xmlObject)
          Sets the designated parameter to the givenjava.sql.SQLXML object.
setString(String parameterName,String x)
          Sets the designated parameter to the given JavaString value.
setTime(String parameterName,Time x)
          Sets the designated parameter to the givenjava.sql.Time value.
setTime(String parameterName,Time x,Calendar cal)
          Sets the designated parameter to the givenjava.sql.Time value, using the givenCalendar object.
setTimestamp(String parameterName,Timestamp x)
          Sets the designated parameter to the givenjava.sql.Timestamp value.
setTimestamp(String parameterName,Timestamp x,Calendar cal)
          Sets the designated parameter to the givenjava.sql.Timestamp value, using the givenCalendar object.
setURL(String parameterName,URL val)
          Sets the designated parameter to the givenjava.net.URL object.
wasNull()
          Retrieves whether the last OUT parameter read had the value of SQLNULL.
 
Methods inherited from interface java.sql.PreparedStatement
addBatch,clearParameters,execute,executeQuery,executeUpdate,getMetaData,getParameterMetaData,setArray,setAsciiStream,setAsciiStream,setAsciiStream,setBigDecimal,setBinaryStream,setBinaryStream,setBinaryStream,setBlob,setBlob,setBlob,setBoolean,setByte,setBytes,setCharacterStream,setCharacterStream,setCharacterStream,setClob,setClob,setClob,setDate,setDate,setDouble,setFloat,setInt,setLong,setNCharacterStream,setNCharacterStream,setNClob,setNClob,setNClob,setNString,setNull,setNull,setObject,setObject,setObject,setRef,setRowId,setShort,setSQLXML,setString,setTime,setTime,setTimestamp,setTimestamp,setUnicodeStream,setURL
 
Methods inherited from interface java.sql.Statement
addBatch,cancel,clearBatch,clearWarnings,close,execute,execute,execute,execute,executeBatch,executeQuery,executeUpdate,executeUpdate,executeUpdate,executeUpdate,getConnection,getFetchDirection,getFetchSize,getGeneratedKeys,getMaxFieldSize,getMaxRows,getMoreResults,getMoreResults,getQueryTimeout,getResultSet,getResultSetConcurrency,getResultSetHoldability,getResultSetType,getUpdateCount,getWarnings,isClosed,isPoolable,setCursorName,setEscapeProcessing,setFetchDirection,setFetchSize,setMaxFieldSize,setMaxRows,setPoolable,setQueryTimeout
 
Methods inherited from interface java.sql.Wrapper
isWrapperFor,unwrap
 

registerOutParameter

voidregisterOutParameter(int parameterIndex,                          int sqlType)                          throwsSQLException
Registers the OUT parameter in ordinal positionparameterIndex to the JDBC typesqlType. All OUT parameters must be registered before a stored procedure is executed.

The JDBC type specified bysqlType for an OUT parameter determines the Java type that must be used in theget method to read the value of that parameter.

If the JDBC type expected to be returned to this output parameter is specific to this particular database,sqlType should bejava.sql.Types.OTHER. The methodgetObject(int) retrieves the value.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
sqlType - the JDBC type code defined byjava.sql.Types. If the parameter is of JDBC typeNUMERIC orDECIMAL, the version ofregisterOutParameter that accepts a scale value should be used.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - ifsqlType is aARRAY,BLOB,CLOB,DATALINK,JAVA_OBJECT,NCHAR,NCLOB,NVARCHAR,LONGNVARCHAR,REF,ROWID,SQLXML orSTRUCT data type and the JDBC driver does not support this data type
See Also:
Types

registerOutParameter

voidregisterOutParameter(int parameterIndex,                          int sqlType,                          int scale)                          throwsSQLException
Registers the parameter in ordinal positionparameterIndex to be of JDBC typesqlType. All OUT parameters must be registered before a stored procedure is executed.

The JDBC type specified bysqlType for an OUT parameter determines the Java type that must be used in theget method to read the value of that parameter.

This version ofregisterOutParameter should be used when the parameter is of JDBC typeNUMERIC orDECIMAL.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
sqlType - the SQL type code defined byjava.sql.Types.
scale - the desired number of digits to the right of the decimal point. It must be greater than or equal to zero.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - ifsqlType is aARRAY,BLOB,CLOB,DATALINK,JAVA_OBJECT,NCHAR,NCLOB,NVARCHAR,LONGNVARCHAR,REF,ROWID,SQLXML orSTRUCT data type and the JDBC driver does not support this data type
See Also:
Types

wasNull

booleanwasNull()                throwsSQLException
Retrieves whether the last OUT parameter read had the value of SQLNULL. Note that this method should be called only after calling a getter method; otherwise, there is no value to use in determining whether it isnull or not.

Returns:
true if the last parameter read was SQLNULL;false otherwise
Throws:
SQLException - if a database access error occurs or this method is called on a closedCallableStatement

getString

StringgetString(int parameterIndex)                 throwsSQLException
Retrieves the value of the designated JDBCCHAR,VARCHAR, orLONGVARCHAR parameter as aString in the Java programming language.

For the fixed-length type JDBCCHAR, theString object returned has exactly the same value the SQLCHAR value had in the database, including any padding added by the database.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
the parameter value. If the value is SQLNULL, the result isnull.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
See Also:
setString(java.lang.String, java.lang.String)

getBoolean

booleangetBoolean(int parameterIndex)                   throwsSQLException
Retrieves the value of the designated JDBCBIT orBOOLEAN parameter as aboolean in the Java programming language.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
the parameter value. If the value is SQLNULL, the result isfalse.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
See Also:
setBoolean(java.lang.String, boolean)

getByte

bytegetByte(int parameterIndex)             throwsSQLException
Retrieves the value of the designated JDBCTINYINT parameter as abyte in the Java programming language.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
the parameter value. If the value is SQLNULL, the result is0.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
See Also:
setByte(java.lang.String, byte)

getShort

shortgetShort(int parameterIndex)               throwsSQLException
Retrieves the value of the designated JDBCSMALLINT parameter as ashort in the Java programming language.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
the parameter value. If the value is SQLNULL, the result is0.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
See Also:
setShort(java.lang.String, short)

getInt

intgetInt(int parameterIndex)           throwsSQLException
Retrieves the value of the designated JDBCINTEGER parameter as anint in the Java programming language.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
the parameter value. If the value is SQLNULL, the result is0.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
See Also:
setInt(java.lang.String, int)

getLong

longgetLong(int parameterIndex)             throwsSQLException
Retrieves the value of the designated JDBCBIGINT parameter as along in the Java programming language.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
the parameter value. If the value is SQLNULL, the result is0.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
See Also:
setLong(java.lang.String, long)

getFloat

floatgetFloat(int parameterIndex)               throwsSQLException
Retrieves the value of the designated JDBCFLOAT parameter as afloat in the Java programming language.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
the parameter value. If the value is SQLNULL, the result is0.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
See Also:
setFloat(java.lang.String, float)

getDouble

doublegetDouble(int parameterIndex)                 throwsSQLException
Retrieves the value of the designated JDBCDOUBLE parameter as adouble in the Java programming language.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
the parameter value. If the value is SQLNULL, the result is0.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
See Also:
setDouble(java.lang.String, double)

getBigDecimal

BigDecimalgetBigDecimal(int parameterIndex,                         int scale)                         throwsSQLException
Deprecated. usegetBigDecimal(int parameterIndex) orgetBigDecimal(String parameterName)

Retrieves the value of the designated JDBCNUMERIC parameter as ajava.math.BigDecimal object withscale digits to the right of the decimal point.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
scale - the number of digits to the right of the decimal point
Returns:
the parameter value. If the value is SQLNULL, the result isnull.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
See Also:
setBigDecimal(java.lang.String, java.math.BigDecimal)

getBytes

byte[]getBytes(int parameterIndex)                throwsSQLException
Retrieves the value of the designated JDBCBINARY orVARBINARY parameter as an array ofbyte values in the Java programming language.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
the parameter value. If the value is SQLNULL, the result isnull.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
See Also:
setBytes(java.lang.String, byte[])

getDate

DategetDate(int parameterIndex)             throwsSQLException
Retrieves the value of the designated JDBCDATE parameter as ajava.sql.Date object.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
the parameter value. If the value is SQLNULL, the result isnull.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
See Also:
setDate(java.lang.String, java.sql.Date)

getTime

TimegetTime(int parameterIndex)             throwsSQLException
Retrieves the value of the designated JDBCTIME parameter as ajava.sql.Time object.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
the parameter value. If the value is SQLNULL, the result isnull.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
See Also:
setTime(java.lang.String, java.sql.Time)

getTimestamp

TimestampgetTimestamp(int parameterIndex)                       throwsSQLException
Retrieves the value of the designated JDBCTIMESTAMP parameter as ajava.sql.Timestamp object.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
the parameter value. If the value is SQLNULL, the result isnull.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
See Also:
setTimestamp(java.lang.String, java.sql.Timestamp)

getObject

ObjectgetObject(int parameterIndex)                 throwsSQLException
Retrieves the value of the designated parameter as anObject in the Java programming language. If the value is an SQLNULL, the driver returns a Javanull.

This method returns a Java object whose type corresponds to the JDBC type that was registered for this parameter using the methodregisterOutParameter. By registering the target JDBC type asjava.sql.Types.OTHER, this method can be used to read database-specific abstract data types.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
Ajava.lang.Object holding the OUT parameter value
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
See Also:
Types,setObject(java.lang.String, java.lang.Object, int, int)

getBigDecimal

BigDecimalgetBigDecimal(int parameterIndex)                         throwsSQLException
Retrieves the value of the designated JDBCNUMERIC parameter as ajava.math.BigDecimal object with as many digits to the right of the decimal point as the value contains.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
the parameter value in full precision. If the value is SQLNULL, the result isnull.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
Since:
1.2
See Also:
setBigDecimal(java.lang.String, java.math.BigDecimal)

getObject

ObjectgetObject(int parameterIndex,Map<String,Class<?>> map)                 throwsSQLException
Returns an object representing the value of OUT parameterparameterIndex and usesmap for the custom mapping of the parameter value.

This method returns a Java object whose type corresponds to the JDBC type that was registered for this parameter using the methodregisterOutParameter. By registering the target JDBC type asjava.sql.Types.OTHER, this method can be used to read database-specific abstract data types.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
map - the mapping from SQL type names to Java classes
Returns:
ajava.lang.Object holding the OUT parameter value
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.2
See Also:
setObject(java.lang.String, java.lang.Object, int, int)

getRef

RefgetRef(int parameterIndex)           throwsSQLException
Retrieves the value of the designated JDBCREF(<structured-type>) parameter as aRef object in the Java programming language.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
the parameter value as aRef object in the Java programming language. If the value was SQLNULL, the valuenull is returned.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.2

getBlob

BlobgetBlob(int parameterIndex)             throwsSQLException
Retrieves the value of the designated JDBCBLOB parameter as aBlob object in the Java programming language.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
the parameter value as aBlob object in the Java programming language. If the value was SQLNULL, the valuenull is returned.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.2

getClob

ClobgetClob(int parameterIndex)             throwsSQLException
Retrieves the value of the designated JDBCCLOB parameter as ajava.sql.Clob object in the Java programming language.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
the parameter value as aClob object in the Java programming language. If the value was SQLNULL, the valuenull is returned.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.2

getArray

ArraygetArray(int parameterIndex)               throwsSQLException
Retrieves the value of the designated JDBCARRAY parameter as anArray object in the Java programming language.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
the parameter value as anArray object in the Java programming language. If the value was SQLNULL, the valuenull is returned.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.2

getDate

DategetDate(int parameterIndex,Calendar cal)             throwsSQLException
Retrieves the value of the designated JDBCDATE parameter as ajava.sql.Date object, using the givenCalendar object to construct the date. With aCalendar object, the driver can calculate the date taking into account a custom timezone and locale. If noCalendar object is specified, the driver uses the default timezone and locale.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
cal - theCalendar object the driver will use to construct the date
Returns:
the parameter value. If the value is SQLNULL, the result isnull.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
Since:
1.2
See Also:
setDate(java.lang.String, java.sql.Date)

getTime

TimegetTime(int parameterIndex,Calendar cal)             throwsSQLException
Retrieves the value of the designated JDBCTIME parameter as ajava.sql.Time object, using the givenCalendar object to construct the time. With aCalendar object, the driver can calculate the time taking into account a custom timezone and locale. If noCalendar object is specified, the driver uses the default timezone and locale.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
cal - theCalendar object the driver will use to construct the time
Returns:
the parameter value; if the value is SQLNULL, the result isnull.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
Since:
1.2
See Also:
setTime(java.lang.String, java.sql.Time)

getTimestamp

TimestampgetTimestamp(int parameterIndex,Calendar cal)                       throwsSQLException
Retrieves the value of the designated JDBCTIMESTAMP parameter as ajava.sql.Timestamp object, using the givenCalendar object to construct theTimestamp object. With aCalendar object, the driver can calculate the timestamp taking into account a custom timezone and locale. If noCalendar object is specified, the driver uses the default timezone and locale.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
cal - theCalendar object the driver will use to construct the timestamp
Returns:
the parameter value. If the value is SQLNULL, the result isnull.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
Since:
1.2
See Also:
setTimestamp(java.lang.String, java.sql.Timestamp)

registerOutParameter

voidregisterOutParameter(int parameterIndex,                          int sqlType,String typeName)                          throwsSQLException
Registers the designated output parameter. This version of the methodregisterOutParameter should be used for a user-defined orREF output parameter. Examples of user-defined types include:STRUCT,DISTINCT,JAVA_OBJECT, and named array types.

All OUT parameters must be registered before a stored procedure is executed.

For a user-defined parameter, the fully-qualified SQL type name of the parameter should also be given, while aREF parameter requires that the fully-qualified type name of the referenced type be given. A JDBC driver that does not need the type code and type name information may ignore it. To be portable, however, applications should always provide these values for user-defined andREF parameters. Although it is intended for user-defined andREF parameters, this method may be used to register a parameter of any JDBC type. If the parameter does not have a user-defined orREF type, thetypeName parameter is ignored.

Note: When reading the value of an out parameter, you must use the getter method whose Java type corresponds to the parameter's registered SQL type.

Parameters:
parameterIndex - the first parameter is 1, the second is 2,...
sqlType - a value fromTypes
typeName - the fully-qualified name of an SQL structured type
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - ifsqlType is aARRAY,BLOB,CLOB,DATALINK,JAVA_OBJECT,NCHAR,NCLOB,NVARCHAR,LONGNVARCHAR,REF,ROWID,SQLXML orSTRUCT data type and the JDBC driver does not support this data type
Since:
1.2
See Also:
Types

registerOutParameter

voidregisterOutParameter(String parameterName,                          int sqlType)                          throwsSQLException
Registers the OUT parameter namedparameterName to the JDBC typesqlType. All OUT parameters must be registered before a stored procedure is executed.

The JDBC type specified bysqlType for an OUT parameter determines the Java type that must be used in theget method to read the value of that parameter.

If the JDBC type expected to be returned to this output parameter is specific to this particular database,sqlType should bejava.sql.Types.OTHER. The methodgetObject(int) retrieves the value.

Parameters:
parameterName - the name of the parameter
sqlType - the JDBC type code defined byjava.sql.Types. If the parameter is of JDBC typeNUMERIC orDECIMAL, the version ofregisterOutParameter that accepts a scale value should be used.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - ifsqlType is aARRAY,BLOB,CLOB,DATALINK,JAVA_OBJECT,NCHAR,NCLOB,NVARCHAR,LONGNVARCHAR,REF,ROWID,SQLXML orSTRUCT data type and the JDBC driver does not support this data type or if the JDBC driver does not support this method
Since:
1.4
See Also:
Types

registerOutParameter

voidregisterOutParameter(String parameterName,                          int sqlType,                          int scale)                          throwsSQLException
Registers the parameter namedparameterName to be of JDBC typesqlType. All OUT parameters must be registered before a stored procedure is executed.

The JDBC type specified bysqlType for an OUT parameter determines the Java type that must be used in theget method to read the value of that parameter.

This version ofregisterOutParameter should be used when the parameter is of JDBC typeNUMERIC orDECIMAL.

Parameters:
parameterName - the name of the parameter
sqlType - SQL type code defined byjava.sql.Types.
scale - the desired number of digits to the right of the decimal point. It must be greater than or equal to zero.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - ifsqlType is aARRAY,BLOB,CLOB,DATALINK,JAVA_OBJECT,NCHAR,NCLOB,NVARCHAR,LONGNVARCHAR,REF,ROWID,SQLXML orSTRUCT data type and the JDBC driver does not support this data type or if the JDBC driver does not support this method
Since:
1.4
See Also:
Types

registerOutParameter

voidregisterOutParameter(String parameterName,                          int sqlType,String typeName)                          throwsSQLException
Registers the designated output parameter. This version of the methodregisterOutParameter should be used for a user-named or REF output parameter. Examples of user-named types include: STRUCT, DISTINCT, JAVA_OBJECT, and named array types.

All OUT parameters must be registered before a stored procedure is executed.

For a user-named parameter the fully-qualified SQL type name of the parameter should also be given, while a REF parameter requires that the fully-qualified type name of the referenced type be given. A JDBC driver that does not need the type code and type name information may ignore it. To be portable, however, applications should always provide these values for user-named and REF parameters. Although it is intended for user-named and REF parameters, this method may be used to register a parameter of any JDBC type. If the parameter does not have a user-named or REF type, the typeName parameter is ignored.

Note: When reading the value of an out parameter, you must use thegetXXX method whose Java type XXX corresponds to the parameter's registered SQL type.

Parameters:
parameterName - the name of the parameter
sqlType - a value fromTypes
typeName - the fully-qualified name of an SQL structured type
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - ifsqlType is aARRAY,BLOB,CLOB,DATALINK,JAVA_OBJECT,NCHAR,NCLOB,NVARCHAR,LONGNVARCHAR,REF,ROWID,SQLXML orSTRUCT data type and the JDBC driver does not support this data type or if the JDBC driver does not support this method
Since:
1.4
See Also:
Types

getURL

URLgetURL(int parameterIndex)           throwsSQLException
Retrieves the value of the designated JDBCDATALINK parameter as ajava.net.URL object.

Parameters:
parameterIndex - the first parameter is 1, the second is 2,...
Returns:
ajava.net.URL object that represents the JDBCDATALINK value used as the designated parameter
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs, this method is called on a closedCallableStatement, or if the URL being returned is not a valid URL on the Java platform
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
setURL(java.lang.String, java.net.URL)

setURL

voidsetURL(String parameterName,URL val)            throwsSQLException
Sets the designated parameter to the givenjava.net.URL object. The driver converts this to an SQLDATALINK value when it sends it to the database.

Parameters:
parameterName - the name of the parameter
val - the parameter value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs; this method is called on a closedCallableStatement or if a URL is malformed
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
getURL(int)

setNull

voidsetNull(String parameterName,             int sqlType)             throwsSQLException
Sets the designated parameter to SQLNULL.

Note: You must specify the parameter's SQL type.

Parameters:
parameterName - the name of the parameter
sqlType - the SQL type code defined injava.sql.Types
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4

setBoolean

voidsetBoolean(String parameterName,                boolean x)                throwsSQLException
Sets the designated parameter to the given Javaboolean value. The driver converts this to an SQLBIT orBOOLEAN value when it sends it to the database.

Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
getBoolean(int)

setByte

voidsetByte(String parameterName,             byte x)             throwsSQLException
Sets the designated parameter to the given Javabyte value. The driver converts this to an SQLTINYINT value when it sends it to the database.

Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
getByte(int)

setShort

voidsetShort(String parameterName,              short x)              throwsSQLException
Sets the designated parameter to the given Javashort value. The driver converts this to an SQLSMALLINT value when it sends it to the database.

Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
getShort(int)

setInt

voidsetInt(String parameterName,            int x)            throwsSQLException
Sets the designated parameter to the given Javaint value. The driver converts this to an SQLINTEGER value when it sends it to the database.

Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
getInt(int)

setLong

voidsetLong(String parameterName,             long x)             throwsSQLException
Sets the designated parameter to the given Javalong value. The driver converts this to an SQLBIGINT value when it sends it to the database.

Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
getLong(int)

setFloat

voidsetFloat(String parameterName,              float x)              throwsSQLException
Sets the designated parameter to the given Javafloat value. The driver converts this to an SQLFLOAT value when it sends it to the database.

Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
getFloat(int)

setDouble

voidsetDouble(String parameterName,               double x)               throwsSQLException
Sets the designated parameter to the given Javadouble value. The driver converts this to an SQLDOUBLE value when it sends it to the database.

Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
getDouble(int)

setBigDecimal

voidsetBigDecimal(String parameterName,BigDecimal x)                   throwsSQLException
Sets the designated parameter to the givenjava.math.BigDecimal value. The driver converts this to an SQLNUMERIC value when it sends it to the database.

Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
getBigDecimal(int, int)

setString

voidsetString(String parameterName,String x)               throwsSQLException
Sets the designated parameter to the given JavaString value. The driver converts this to an SQLVARCHAR orLONGVARCHAR value (depending on the argument's size relative to the driver's limits onVARCHAR values) when it sends it to the database.

Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
getString(int)

setBytes

voidsetBytes(String parameterName,              byte[] x)              throwsSQLException
Sets the designated parameter to the given Java array of bytes. The driver converts this to an SQLVARBINARY orLONGVARBINARY (depending on the argument's size relative to the driver's limits onVARBINARY values) when it sends it to the database.

Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
getBytes(int)

setDate

voidsetDate(String parameterName,Date x)             throwsSQLException
Sets the designated parameter to the givenjava.sql.Date value using the default time zone of the virtual machine that is running the application. The driver converts this to an SQLDATE value when it sends it to the database.

Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
getDate(int)

setTime

voidsetTime(String parameterName,Time x)             throwsSQLException
Sets the designated parameter to the givenjava.sql.Time value. The driver converts this to an SQLTIME value when it sends it to the database.

Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
getTime(int)

setTimestamp

voidsetTimestamp(String parameterName,Timestamp x)                  throwsSQLException
Sets the designated parameter to the givenjava.sql.Timestamp value. The driver converts this to an SQLTIMESTAMP value when it sends it to the database.

Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
getTimestamp(int)

setAsciiStream

voidsetAsciiStream(String parameterName,InputStream x,                    int length)                    throwsSQLException
Sets the designated parameter to the given input stream, which will have the specified number of bytes. When a very large ASCII value is input to aLONGVARCHAR parameter, it may be more practical to send it via ajava.io.InputStream. Data will be read from the stream as needed until end-of-file is reached. The JDBC driver will do any necessary conversion from ASCII to the database char format.

Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

Parameters:
parameterName - the name of the parameter
x - the Java input stream that contains the ASCII parameter value
length - the number of bytes in the stream
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4

setBinaryStream

voidsetBinaryStream(String parameterName,InputStream x,                     int length)                     throwsSQLException
Sets the designated parameter to the given input stream, which will have the specified number of bytes. When a very large binary value is input to aLONGVARBINARY parameter, it may be more practical to send it via ajava.io.InputStream object. The data will be read from the stream as needed until end-of-file is reached.

Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

Parameters:
parameterName - the name of the parameter
x - the java input stream which contains the binary parameter value
length - the number of bytes in the stream
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4

setObject

voidsetObject(String parameterName,Object x,               int targetSqlType,               int scale)               throwsSQLException
Sets the value of the designated parameter with the given object. The second argument must be an object type; for integral values, thejava.lang equivalent objects should be used.

The given Java object will be converted to the given targetSqlType before being sent to the database. If the object has a custom mapping (is of a class implementing the interfaceSQLData), the JDBC driver should call the methodSQLData.writeSQL to write it to the SQL data stream. If, on the other hand, the object is of a class implementingRef,Blob,Clob,NClob,Struct,java.net.URL, orArray, the driver should pass it to the database as a value of the corresponding SQL type.

Note that this method may be used to pass datatabase- specific abstract data types.

Parameters:
parameterName - the name of the parameter
x - the object containing the input parameter value
targetSqlType - the SQL type (as defined in java.sql.Types) to be sent to the database. The scale argument may further qualify this type.
scale - for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types, this is the number of digits after the decimal point. For all other types, this value will be ignored.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - iftargetSqlType is aARRAY,BLOB,CLOB,DATALINK,JAVA_OBJECT,NCHAR,NCLOB,NVARCHAR,LONGNVARCHAR,REF,ROWID,SQLXML orSTRUCT data type and the JDBC driver does not support this data type
Since:
1.4
See Also:
Types,getObject(int)

setObject

voidsetObject(String parameterName,Object x,               int targetSqlType)               throwsSQLException
Sets the value of the designated parameter with the given object. This method is like the methodsetObject above, except that it assumes a scale of zero.

Parameters:
parameterName - the name of the parameter
x - the object containing the input parameter value
targetSqlType - the SQL type (as defined in java.sql.Types) to be sent to the database
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - iftargetSqlType is aARRAY,BLOB,CLOB,DATALINK,JAVA_OBJECT,NCHAR,NCLOB,NVARCHAR,LONGNVARCHAR,REF,ROWID,SQLXML orSTRUCT data type and the JDBC driver does not support this data type
Since:
1.4
See Also:
getObject(int)

setObject

voidsetObject(String parameterName,Object x)               throwsSQLException
Sets the value of the designated parameter with the given object. The second parameter must be of typeObject; therefore, thejava.lang equivalent objects should be used for built-in types.

The JDBC specification specifies a standard mapping from JavaObject types to SQL types. The given argument will be converted to the corresponding SQL type before being sent to the database.

Note that this method may be used to pass datatabase- specific abstract data types, by using a driver-specific Java type. If the object is of a class implementing the interfaceSQLData, the JDBC driver should call the methodSQLData.writeSQL to write it to the SQL data stream. If, on the other hand, the object is of a class implementingRef,Blob,Clob,NClob,Struct,java.net.URL, orArray, the driver should pass it to the database as a value of the corresponding SQL type.

This method throws an exception if there is an ambiguity, for example, if the object is of a class implementing more than one of the interfaces named above.

Note: Not all databases allow for a non-typed Null to be sent to the backend. For maximum portability, thesetNull or thesetObject(String parameterName, Object x, int sqlType) method should be used instead ofsetObject(String parameterName, Object x).

Parameters:
parameterName - the name of the parameter
x - the object containing the input parameter value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs, this method is called on a closedCallableStatement or if the givenObject parameter is ambiguous
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
getObject(int)

setCharacterStream

voidsetCharacterStream(String parameterName,Reader reader,                        int length)                        throwsSQLException
Sets the designated parameter to the givenReader object, which is the given number of characters long. When a very large UNICODE value is input to aLONGVARCHAR parameter, it may be more practical to send it via ajava.io.Reader object. The data will be read from the stream as needed until end-of-file is reached. The JDBC driver will do any necessary conversion from UNICODE to the database char format.

Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

Parameters:
parameterName - the name of the parameter
reader - thejava.io.Reader object that contains the UNICODE data used as the designated parameter
length - the number of characters in the stream
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4

setDate

voidsetDate(String parameterName,Date x,Calendar cal)             throwsSQLException
Sets the designated parameter to the givenjava.sql.Date value, using the givenCalendar object. The driver uses theCalendar object to construct an SQLDATE value, which the driver then sends to the database. With a aCalendar object, the driver can calculate the date taking into account a custom timezone. If noCalendar object is specified, the driver uses the default timezone, which is that of the virtual machine running the application.

Parameters:
parameterName - the name of the parameter
x - the parameter value
cal - theCalendar object the driver will use to construct the date
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
getDate(int)

setTime

voidsetTime(String parameterName,Time x,Calendar cal)             throwsSQLException
Sets the designated parameter to the givenjava.sql.Time value, using the givenCalendar object. The driver uses theCalendar object to construct an SQLTIME value, which the driver then sends to the database. With a aCalendar object, the driver can calculate the time taking into account a custom timezone. If noCalendar object is specified, the driver uses the default timezone, which is that of the virtual machine running the application.

Parameters:
parameterName - the name of the parameter
x - the parameter value
cal - theCalendar object the driver will use to construct the time
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
getTime(int)

setTimestamp

voidsetTimestamp(String parameterName,Timestamp x,Calendar cal)                  throwsSQLException
Sets the designated parameter to the givenjava.sql.Timestamp value, using the givenCalendar object. The driver uses theCalendar object to construct an SQLTIMESTAMP value, which the driver then sends to the database. With a aCalendar object, the driver can calculate the timestamp taking into account a custom timezone. If noCalendar object is specified, the driver uses the default timezone, which is that of the virtual machine running the application.

Parameters:
parameterName - the name of the parameter
x - the parameter value
cal - theCalendar object the driver will use to construct the timestamp
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
getTimestamp(int)

setNull

voidsetNull(String parameterName,             int sqlType,String typeName)             throwsSQLException
Sets the designated parameter to SQLNULL. This version of the methodsetNull should be used for user-defined types and REF type parameters. Examples of user-defined types include: STRUCT, DISTINCT, JAVA_OBJECT, and named array types.

Note: To be portable, applications must give the SQL type code and the fully-qualified SQL type name when specifying a NULL user-defined or REF parameter. In the case of a user-defined type the name is the type name of the parameter itself. For a REF parameter, the name is the type name of the referenced type.

Although it is intended for user-defined and Ref parameters, this method may be used to set a null parameter of any JDBC type. If the parameter does not have a user-defined or REF type, the given typeName is ignored.

Parameters:
parameterName - the name of the parameter
sqlType - a value fromjava.sql.Types
typeName - the fully-qualified name of an SQL user-defined type; ignored if the parameter is not a user-defined type or SQLREF value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4

getString

StringgetString(String parameterName)                 throwsSQLException
Retrieves the value of a JDBCCHAR,VARCHAR, orLONGVARCHAR parameter as aString in the Java programming language.

For the fixed-length type JDBCCHAR, theString object returned has exactly the same value the SQLCHAR value had in the database, including any padding added by the database.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter value. If the value is SQLNULL, the result isnull.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
setString(java.lang.String, java.lang.String)

getBoolean

booleangetBoolean(String parameterName)                   throwsSQLException
Retrieves the value of a JDBCBIT orBOOLEAN parameter as aboolean in the Java programming language.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter value. If the value is SQLNULL, the result isfalse.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
setBoolean(java.lang.String, boolean)

getByte

bytegetByte(String parameterName)             throwsSQLException
Retrieves the value of a JDBCTINYINT parameter as abyte in the Java programming language.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter value. If the value is SQLNULL, the result is0.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
setByte(java.lang.String, byte)

getShort

shortgetShort(String parameterName)               throwsSQLException
Retrieves the value of a JDBCSMALLINT parameter as ashort in the Java programming language.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter value. If the value is SQLNULL, the result is0.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
setShort(java.lang.String, short)

getInt

intgetInt(String parameterName)           throwsSQLException
Retrieves the value of a JDBCINTEGER parameter as anint in the Java programming language.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter value. If the value is SQLNULL, the result is0.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
setInt(java.lang.String, int)

getLong

longgetLong(String parameterName)             throwsSQLException
Retrieves the value of a JDBCBIGINT parameter as along in the Java programming language.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter value. If the value is SQLNULL, the result is0.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
setLong(java.lang.String, long)

getFloat

floatgetFloat(String parameterName)               throwsSQLException
Retrieves the value of a JDBCFLOAT parameter as afloat in the Java programming language.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter value. If the value is SQLNULL, the result is0.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
setFloat(java.lang.String, float)

getDouble

doublegetDouble(String parameterName)                 throwsSQLException
Retrieves the value of a JDBCDOUBLE parameter as adouble in the Java programming language.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter value. If the value is SQLNULL, the result is0.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
setDouble(java.lang.String, double)

getBytes

byte[]getBytes(String parameterName)                throwsSQLException
Retrieves the value of a JDBCBINARY orVARBINARY parameter as an array ofbyte values in the Java programming language.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter value. If the value is SQLNULL, the result isnull.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
setBytes(java.lang.String, byte[])

getDate

DategetDate(String parameterName)             throwsSQLException
Retrieves the value of a JDBCDATE parameter as ajava.sql.Date object.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter value. If the value is SQLNULL, the result isnull.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
setDate(java.lang.String, java.sql.Date)

getTime

TimegetTime(String parameterName)             throwsSQLException
Retrieves the value of a JDBCTIME parameter as ajava.sql.Time object.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter value. If the value is SQLNULL, the result isnull.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
setTime(java.lang.String, java.sql.Time)

getTimestamp

TimestampgetTimestamp(String parameterName)                       throwsSQLException
Retrieves the value of a JDBCTIMESTAMP parameter as ajava.sql.Timestamp object.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter value. If the value is SQLNULL, the result isnull.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
setTimestamp(java.lang.String, java.sql.Timestamp)

getObject

ObjectgetObject(String parameterName)                 throwsSQLException
Retrieves the value of a parameter as anObject in the Java programming language. If the value is an SQLNULL, the driver returns a Javanull.

This method returns a Java object whose type corresponds to the JDBC type that was registered for this parameter using the methodregisterOutParameter. By registering the target JDBC type asjava.sql.Types.OTHER, this method can be used to read database-specific abstract data types.

Parameters:
parameterName - the name of the parameter
Returns:
Ajava.lang.Object holding the OUT parameter value.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
Types,setObject(java.lang.String, java.lang.Object, int, int)

getBigDecimal

BigDecimalgetBigDecimal(String parameterName)                         throwsSQLException
Retrieves the value of a JDBCNUMERIC parameter as ajava.math.BigDecimal object with as many digits to the right of the decimal point as the value contains.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter value in full precision. If the value is SQLNULL, the result isnull.
Throws:
SQLExceptionif - parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
SQLException
Since:
1.4
See Also:
setBigDecimal(java.lang.String, java.math.BigDecimal)

getObject

ObjectgetObject(String parameterName,Map<String,Class<?>> map)                 throwsSQLException
Returns an object representing the value of OUT parameterparameterName and usesmap for the custom mapping of the parameter value.

This method returns a Java object whose type corresponds to the JDBC type that was registered for this parameter using the methodregisterOutParameter. By registering the target JDBC type asjava.sql.Types.OTHER, this method can be used to read database-specific abstract data types.

Parameters:
parameterName - the name of the parameter
map - the mapping from SQL type names to Java classes
Returns:
ajava.lang.Object holding the OUT parameter value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
setObject(java.lang.String, java.lang.Object, int, int)

getRef

RefgetRef(String parameterName)           throwsSQLException
Retrieves the value of a JDBCREF(<structured-type>) parameter as aRef object in the Java programming language.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter value as aRef object in the Java programming language. If the value was SQLNULL, the valuenull is returned.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4

getBlob

BlobgetBlob(String parameterName)             throwsSQLException
Retrieves the value of a JDBCBLOB parameter as aBlob object in the Java programming language.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter value as aBlob object in the Java programming language. If the value was SQLNULL, the valuenull is returned.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4

getClob

ClobgetClob(String parameterName)             throwsSQLException
Retrieves the value of a JDBCCLOB parameter as ajava.sql.Clob object in the Java programming language.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter value as aClob object in the Java programming language. If the value was SQLNULL, the valuenull is returned.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4

getArray

ArraygetArray(String parameterName)               throwsSQLException
Retrieves the value of a JDBCARRAY parameter as anArray object in the Java programming language.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter value as anArray object in Java programming language. If the value was SQLNULL, the valuenull is returned.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4

getDate

DategetDate(String parameterName,Calendar cal)             throwsSQLException
Retrieves the value of a JDBCDATE parameter as ajava.sql.Date object, using the givenCalendar object to construct the date. With aCalendar object, the driver can calculate the date taking into account a custom timezone and locale. If noCalendar object is specified, the driver uses the default timezone and locale.

Parameters:
parameterName - the name of the parameter
cal - theCalendar object the driver will use to construct the date
Returns:
the parameter value. If the value is SQLNULL, the result isnull.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
setDate(java.lang.String, java.sql.Date)

getTime

TimegetTime(String parameterName,Calendar cal)             throwsSQLException
Retrieves the value of a JDBCTIME parameter as ajava.sql.Time object, using the givenCalendar object to construct the time. With aCalendar object, the driver can calculate the time taking into account a custom timezone and locale. If noCalendar object is specified, the driver uses the default timezone and locale.

Parameters:
parameterName - the name of the parameter
cal - theCalendar object the driver will use to construct the time
Returns:
the parameter value; if the value is SQLNULL, the result isnull.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
setTime(java.lang.String, java.sql.Time)

getTimestamp

TimestampgetTimestamp(String parameterName,Calendar cal)                       throwsSQLException
Retrieves the value of a JDBCTIMESTAMP parameter as ajava.sql.Timestamp object, using the givenCalendar object to construct theTimestamp object. With aCalendar object, the driver can calculate the timestamp taking into account a custom timezone and locale. If noCalendar object is specified, the driver uses the default timezone and locale.

Parameters:
parameterName - the name of the parameter
cal - theCalendar object the driver will use to construct the timestamp
Returns:
the parameter value. If the value is SQLNULL, the result isnull.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
setTimestamp(java.lang.String, java.sql.Timestamp)

getURL

URLgetURL(String parameterName)           throwsSQLException
Retrieves the value of a JDBCDATALINK parameter as ajava.net.URL object.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter value as ajava.net.URL object in the Java programming language. If the value was SQLNULL, the valuenull is returned.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs, this method is called on a closedCallableStatement, or if there is a problem with the URL
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.4
See Also:
setURL(java.lang.String, java.net.URL)

getRowId

RowIdgetRowId(int parameterIndex)               throwsSQLException
Retrieves the value of the designated JDBCROWID parameter as ajava.sql.RowId object.

Parameters:
parameterIndex - the first parameter is 1, the second is 2,...
Returns:
aRowId object that represents the JDBCROWID value is used as the designated parameter. If the parameter contains a SQLNULL, then anull value is returned.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

getRowId

RowIdgetRowId(String parameterName)               throwsSQLException
Retrieves the value of the designated JDBCROWID parameter as ajava.sql.RowId object.

Parameters:
parameterName - the name of the parameter
Returns:
aRowId object that represents the JDBCROWID value is used as the designated parameter. If the parameter contains a SQLNULL, then anull value is returned.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

setRowId

voidsetRowId(String parameterName,RowId x)              throwsSQLException
Sets the designated parameter to the givenjava.sql.RowId object. The driver converts this to a SQLROWID when it sends it to the database.

Parameters:
parameterName - the name of the parameter
x - the parameter value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

setNString

voidsetNString(String parameterName,String value)                throwsSQLException
Sets the designated parameter to the givenString object. The driver converts this to a SQLNCHAR orNVARCHAR orLONGNVARCHAR

Parameters:
parameterName - the name of the parameter to be set
value - the parameter value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

setNCharacterStream

voidsetNCharacterStream(String parameterName,Reader value,                         long length)                         throwsSQLException
Sets the designated parameter to aReader object. TheReader reads the data till end-of-file is reached. The driver does the necessary conversion from Java character format to the national character set in the database.

Parameters:
parameterName - the name of the parameter to be set
value - the parameter value
length - the number of characters in the parameter data.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

setNClob

voidsetNClob(String parameterName,NClob value)              throwsSQLException
Sets the designated parameter to ajava.sql.NClob object. The object implements thejava.sql.NClob interface. ThisNClob object maps to a SQLNCLOB.

Parameters:
parameterName - the name of the parameter to be set
value - the parameter value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

setClob

voidsetClob(String parameterName,Reader reader,             long length)             throwsSQLException
Sets the designated parameter to aReader object. Thereader must contain the number of characters specified by length otherwise aSQLException will be generated when theCallableStatement is executed. This method differs from thesetCharacterStream (int, Reader, int) method because it informs the driver that the parameter value should be sent to the server as aCLOB. When thesetCharacterStream method is used, the driver may have to do extra work to determine whether the parameter data should be send to the server as aLONGVARCHAR or aCLOB

Parameters:
parameterName - the name of the parameter to be set
reader - An object that contains the data to set the parameter value to.
length - the number of characters in the parameter data.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if the length specified is less than zero; a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

setBlob

voidsetBlob(String parameterName,InputStream inputStream,             long length)             throwsSQLException
Sets the designated parameter to aInputStream object. Theinputstream must contain the number of characters specified by length, otherwise aSQLException will be generated when theCallableStatement is executed. This method differs from thesetBinaryStream (int, InputStream, int) method because it informs the driver that the parameter value should be sent to the server as aBLOB. When thesetBinaryStream method is used, the driver may have to do extra work to determine whether the parameter data should be sent to the server as aLONGVARBINARY or aBLOB

Parameters:
parameterName - the name of the parameter to be set the second is 2, ...
inputStream - An object that contains the data to set the parameter value to.
length - the number of bytes in the parameter data.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if the length specified is less than zero; if the number of bytes in the inputstream does not match the specfied length; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

setNClob

voidsetNClob(String parameterName,Reader reader,              long length)              throwsSQLException
Sets the designated parameter to aReader object. Thereader must contain the number of characters specified by length otherwise aSQLException will be generated when theCallableStatement is executed. This method differs from thesetCharacterStream (int, Reader, int) method because it informs the driver that the parameter value should be sent to the server as aNCLOB. When thesetCharacterStream method is used, the driver may have to do extra work to determine whether the parameter data should be send to the server as aLONGNVARCHAR or aNCLOB

Parameters:
parameterName - the name of the parameter to be set
reader - An object that contains the data to set the parameter value to.
length - the number of characters in the parameter data.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if the length specified is less than zero; if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

getNClob

NClobgetNClob(int parameterIndex)               throwsSQLException
Retrieves the value of the designated JDBCNCLOB parameter as ajava.sql.NClob object in the Java programming language.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, and so on
Returns:
the parameter value as aNClob object in the Java programming language. If the value was SQLNULL, the valuenull is returned.
Throws:
SQLException - if the parameterIndex is not valid; if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

getNClob

NClobgetNClob(String parameterName)               throwsSQLException
Retrieves the value of a JDBCNCLOB parameter as ajava.sql.NClob object in the Java programming language.

Parameters:
parameterName - the name of the parameter
Returns:
the parameter value as aNClob object in the Java programming language. If the value was SQLNULL, the valuenull is returned.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

setSQLXML

voidsetSQLXML(String parameterName,SQLXML xmlObject)               throwsSQLException
Sets the designated parameter to the givenjava.sql.SQLXML object. The driver converts this to anSQL XML value when it sends it to the database.

Parameters:
parameterName - the name of the parameter
xmlObject - aSQLXML object that maps anSQL XML value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs; this method is called on a closedCallableStatement or thejava.xml.transform.Result,Writer orOutputStream has not been closed for theSQLXML object
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

getSQLXML

SQLXMLgetSQLXML(int parameterIndex)                 throwsSQLException
Retrieves the value of the designatedSQL XML parameter as ajava.sql.SQLXML object in the Java programming language.

Parameters:
parameterIndex - index of the first parameter is 1, the second is 2, ...
Returns:
aSQLXML object that maps anSQL XML value
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

getSQLXML

SQLXMLgetSQLXML(String parameterName)                 throwsSQLException
Retrieves the value of the designatedSQL XML parameter as ajava.sql.SQLXML object in the Java programming language.

Parameters:
parameterName - the name of the parameter
Returns:
aSQLXML object that maps anSQL XML value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

getNString

StringgetNString(int parameterIndex)                  throwsSQLException
Retrieves the value of the designatedNCHAR,NVARCHAR orLONGNVARCHAR parameter as aString in the Java programming language.

For the fixed-length type JDBCNCHAR, theString object returned has exactly the same value the SQLNCHAR value had in the database, including any padding added by the database.

Parameters:
parameterIndex - index of the first parameter is 1, the second is 2, ...
Returns:
aString object that maps anNCHAR,NVARCHAR orLONGNVARCHAR value
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6
See Also:
setNString(java.lang.String, java.lang.String)

getNString

StringgetNString(String parameterName)                  throwsSQLException
Retrieves the value of the designatedNCHAR,NVARCHAR orLONGNVARCHAR parameter as aString in the Java programming language.

For the fixed-length type JDBCNCHAR, theString object returned has exactly the same value the SQLNCHAR value had in the database, including any padding added by the database.

Parameters:
parameterName - the name of the parameter
Returns:
aString object that maps anNCHAR,NVARCHAR orLONGNVARCHAR value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6
See Also:
setNString(java.lang.String, java.lang.String)

getNCharacterStream

ReadergetNCharacterStream(int parameterIndex)                           throwsSQLException
Retrieves the value of the designated parameter as ajava.io.Reader object in the Java programming language. It is intended for use when accessingNCHAR,NVARCHAR andLONGNVARCHAR parameters.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
Returns:
ajava.io.Reader object that contains the parameter value; if the value is SQLNULL, the value returned isnull in the Java programming language.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

getNCharacterStream

ReadergetNCharacterStream(String parameterName)                           throwsSQLException
Retrieves the value of the designated parameter as ajava.io.Reader object in the Java programming language. It is intended for use when accessingNCHAR,NVARCHAR andLONGNVARCHAR parameters.

Parameters:
parameterName - the name of the parameter
Returns:
ajava.io.Reader object that contains the parameter value; if the value is SQLNULL, the value returned isnull in the Java programming language
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

getCharacterStream

ReadergetCharacterStream(int parameterIndex)                          throwsSQLException
Retrieves the value of the designated parameter as ajava.io.Reader object in the Java programming language.

Parameters:
parameterIndex - the first parameter is 1, the second is 2, ...
Returns:
ajava.io.Reader object that contains the parameter value; if the value is SQLNULL, the value returned isnull in the Java programming language.
Throws:
SQLException - if the parameterIndex is not valid; if a database access error occurs or this method is called on a closedCallableStatement
Since:
1.6

getCharacterStream

ReadergetCharacterStream(String parameterName)                          throwsSQLException
Retrieves the value of the designated parameter as ajava.io.Reader object in the Java programming language.

Parameters:
parameterName - the name of the parameter
Returns:
ajava.io.Reader object that contains the parameter value; if the value is SQLNULL, the value returned isnull in the Java programming language
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

setBlob

voidsetBlob(String parameterName,Blob x)             throwsSQLException
Sets the designated parameter to the givenjava.sql.Blob object. The driver converts this to an SQLBLOB value when it sends it to the database.

Parameters:
parameterName - the name of the parameter
x - aBlob object that maps an SQLBLOB value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

setClob

voidsetClob(String parameterName,Clob x)             throwsSQLException
Sets the designated parameter to the givenjava.sql.Clob object. The driver converts this to an SQLCLOB value when it sends it to the database.

Parameters:
parameterName - the name of the parameter
x - aClob object that maps an SQLCLOB value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

setAsciiStream

voidsetAsciiStream(String parameterName,InputStream x,                    long length)                    throwsSQLException
Sets the designated parameter to the given input stream, which will have the specified number of bytes. When a very large ASCII value is input to aLONGVARCHAR parameter, it may be more practical to send it via ajava.io.InputStream. Data will be read from the stream as needed until end-of-file is reached. The JDBC driver will do any necessary conversion from ASCII to the database char format.

Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

Parameters:
parameterName - the name of the parameter
x - the Java input stream that contains the ASCII parameter value
length - the number of bytes in the stream
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

setBinaryStream

voidsetBinaryStream(String parameterName,InputStream x,                     long length)                     throwsSQLException
Sets the designated parameter to the given input stream, which will have the specified number of bytes. When a very large binary value is input to aLONGVARBINARY parameter, it may be more practical to send it via ajava.io.InputStream object. The data will be read from the stream as needed until end-of-file is reached.

Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

Parameters:
parameterName - the name of the parameter
x - the java input stream which contains the binary parameter value
length - the number of bytes in the stream
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

setCharacterStream

voidsetCharacterStream(String parameterName,Reader reader,                        long length)                        throwsSQLException
Sets the designated parameter to the givenReader object, which is the given number of characters long. When a very large UNICODE value is input to aLONGVARCHAR parameter, it may be more practical to send it via ajava.io.Reader object. The data will be read from the stream as needed until end-of-file is reached. The JDBC driver will do any necessary conversion from UNICODE to the database char format.

Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

Parameters:
parameterName - the name of the parameter
reader - thejava.io.Reader object that contains the UNICODE data used as the designated parameter
length - the number of characters in the stream
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

setAsciiStream

voidsetAsciiStream(String parameterName,InputStream x)                    throwsSQLException
Sets the designated parameter to the given input stream. When a very large ASCII value is input to aLONGVARCHAR parameter, it may be more practical to send it via ajava.io.InputStream. Data will be read from the stream as needed until end-of-file is reached. The JDBC driver will do any necessary conversion from ASCII to the database char format.

Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version ofsetAsciiStream which takes a length parameter.

Parameters:
parameterName - the name of the parameter
x - the Java input stream that contains the ASCII parameter value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

setBinaryStream

voidsetBinaryStream(String parameterName,InputStream x)                     throwsSQLException
Sets the designated parameter to the given input stream. When a very large binary value is input to aLONGVARBINARY parameter, it may be more practical to send it via ajava.io.InputStream object. The data will be read from the stream as needed until end-of-file is reached.

Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version ofsetBinaryStream which takes a length parameter.

Parameters:
parameterName - the name of the parameter
x - the java input stream which contains the binary parameter value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

setCharacterStream

voidsetCharacterStream(String parameterName,Reader reader)                        throwsSQLException
Sets the designated parameter to the givenReader object. When a very large UNICODE value is input to aLONGVARCHAR parameter, it may be more practical to send it via ajava.io.Reader object. The data will be read from the stream as needed until end-of-file is reached. The JDBC driver will do any necessary conversion from UNICODE to the database char format.

Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version ofsetCharacterStream which takes a length parameter.

Parameters:
parameterName - the name of the parameter
reader - thejava.io.Reader object that contains the Unicode data
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

setNCharacterStream

voidsetNCharacterStream(String parameterName,Reader value)                         throwsSQLException
Sets the designated parameter to aReader object. TheReader reads the data till end-of-file is reached. The driver does the necessary conversion from Java character format to the national character set in the database.

Note: This stream object can either be a standard Java stream object or your own subclass that implements the standard interface.

Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version ofsetNCharacterStream which takes a length parameter.

Parameters:
parameterName - the name of the parameter
value - the parameter value
Throws:
SQLException - if parameterName does not correspond to a named parameter; if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; if a database access error occurs; or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

setClob

voidsetClob(String parameterName,Reader reader)             throwsSQLException
Sets the designated parameter to aReader object. This method differs from thesetCharacterStream (int, Reader) method because it informs the driver that the parameter value should be sent to the server as aCLOB. When thesetCharacterStream method is used, the driver may have to do extra work to determine whether the parameter data should be send to the server as aLONGVARCHAR or aCLOB

Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version ofsetClob which takes a length parameter.

Parameters:
parameterName - the name of the parameter
reader - An object that contains the data to set the parameter value to.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

setBlob

voidsetBlob(String parameterName,InputStream inputStream)             throwsSQLException
Sets the designated parameter to aInputStream object. This method differs from thesetBinaryStream (int, InputStream) method because it informs the driver that the parameter value should be sent to the server as aBLOB. When thesetBinaryStream method is used, the driver may have to do extra work to determine whether the parameter data should be send to the server as aLONGVARBINARY or aBLOB

Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version ofsetBlob which takes a length parameter.

Parameters:
parameterName - the name of the parameter
inputStream - An object that contains the data to set the parameter value to.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

setNClob

voidsetNClob(String parameterName,Reader reader)              throwsSQLException
Sets the designated parameter to aReader object. This method differs from thesetCharacterStream (int, Reader) method because it informs the driver that the parameter value should be sent to the server as aNCLOB. When thesetCharacterStream method is used, the driver may have to do extra work to determine whether the parameter data should be send to the server as aLONGNVARCHAR or aNCLOB

Note: Consult your JDBC driver documentation to determine if it might be more efficient to use a version ofsetNClob which takes a length parameter.

Parameters:
parameterName - the name of the parameter
reader - An object that contains the data to set the parameter value to.
Throws:
SQLException - if parameterName does not correspond to a named parameter; if the driver does not support national character sets; if the driver can detect that a data conversion error could occur; if a database access error occurs or this method is called on a closedCallableStatement
SQLFeatureNotSupportedException - if the JDBC driver does not support this method
Since:
1.6

          
Java™ Platform
Standard Ed. 6


[8]ページ先頭

©2009-2025 Movatter.jp