Interface PreparedStatement
- All Superinterfaces:
AutoCloseable,Statement,Wrapper
- All Known Subinterfaces:
CallableStatement
- All Known Implementing Classes:
JDBCPreparedStatement
public interface PreparedStatement extends Statement
An SQL Statement is put into a PreparedStatement and is precompiled
so that it can be executed efficiently multiple times.
Setter methods are supplied in the PreparedStatement interface for
the setting of IN parameters for the statement. The setter method
used for each IN parameter must match the parameter's type.
-
Field Summary
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 -
Method Summary
Modifier and Type Method Description voidaddBatch()Add a set of parameters to thePreparedStatement's command batch.voidclearParameters()Clear the current parameter values.booleanexecute()Executes the SQL statement in thisPreparedStatement.ResultSetexecuteQuery()Executes the SQL query in thePreparedStatementand returns theResultSetgenerated by the query.intexecuteUpdate()Invokes the SQL command contained within the prepared statement.ResultSetMetaDatagetMetaData()Returns aResultSetMetaDatadescribing theResultSetthat would be produced by execution of thePreparedStatement.ParameterMetaDatagetParameterMetaData()Gets information about the parameters of thePreparedStatement.voidsetArray(int parameterIndex, Array theArray)Sets the value of a specified parameter to the suppliedArray.voidsetAsciiStream(int parameterIndex, InputStream inputStream)Sets the value of the specified parameter to the bytes frominputStream.voidsetAsciiStream(int parameterIndex, InputStream theInputStream, int length)Sets the value of a specified parameter to the content of a suppliedInputStream, which has a specified number of bytes.voidsetAsciiStream(int parameterIndex, InputStream inputStream, long length)Sets the value of the specified parameter to the nextlengthbytes frominputStream.voidsetBigDecimal(int parameterIndex, BigDecimal theBigDecimal)Sets the value of a specified parameter to a suppliedjava.math.BigDecimalvalue.voidsetBinaryStream(int parameterIndex, InputStream inputStream)Sets the value of the specified parameter to the bytes frominputStream.voidsetBinaryStream(int parameterIndex, InputStream theInputStream, int length)Sets the value of a specified parameter to the content of a supplied binaryInputStream, which has a specified number of bytes.voidsetBinaryStream(int parameterIndex, InputStream inputStream, long length)Sets the value of the specified parameter to the nextlengthbytes frominputStream.voidsetBlob(int parameterIndex, InputStream inputStream)Sets the value of the specified parameter to the bytes frominputStream.voidsetBlob(int parameterIndex, InputStream inputStream, long length)Sets the value of the specified parameter to the nextlengthbytes frominputStream.voidsetBlob(int parameterIndex, Blob theBlob)Sets the value of a specified parameter to the givenBlobobject.voidsetBoolean(int parameterIndex, boolean theBoolean)Sets the value of a specified parameter to a suppliedbooleanvalue.voidsetByte(int parameterIndex, byte theByte)Sets the value of a specified parameter to a suppliedbytevalue.voidsetBytes(int parameterIndex, byte[] theBytes)Sets the value of a specified parameter to a supplied array of bytes.voidsetCharacterStream(int parameterIndex, Reader reader)Sets the value of the specified parameter to the characters fromreader.voidsetCharacterStream(int parameterIndex, Reader reader, int length)Sets the value of a specified parameter to the character content of aReaderobject, with the specified length of character data.voidsetCharacterStream(int parameterIndex, Reader reader, long length)Sets the value of the specified parameter to the nextlengthcharacters fromreader.voidsetClob(int parameterIndex, Reader reader)Sets the value of the specified parameter to the characters fromreader.voidsetClob(int parameterIndex, Reader reader, long length)Sets the value of the specified parameter to the nextlengthcharacters fromreader.voidsetClob(int parameterIndex, Clob theClob)Sets the value of a specified parameter to the givenClobobject.voidsetDate(int parameterIndex, Date theDate)Sets the value of a specified parameter to a suppliedjava.sql.Datevalue.voidsetDate(int parameterIndex, Date theDate, Calendar cal)Sets the value of a specified parameter to a suppliedjava.sql.Datevalue, using a suppliedCalendarto map the Date.voidsetDouble(int parameterIndex, double theDouble)Sets the value of a specified parameter to a supplieddoublevalue.voidsetFloat(int parameterIndex, float theFloat)Sets the value of a specified parameter to to a suppliedfloatvalue.voidsetInt(int parameterIndex, int theInt)Sets the value of a specified parameter to a suppliedintvalue.voidsetLong(int parameterIndex, long theLong)Sets the value of a specified parameter to a suppliedlongvalue.voidsetNCharacterStream(int parameterIndex, Reader reader)Sets the value of the specified parameter to the characters fromreader.voidsetNCharacterStream(int parameterIndex, Reader reader, long length)Sets the value of the specified parameter to the nextlengthcharacters fromreader.voidsetNClob(int parameterIndex, Reader reader)Sets the value of the specified parameter to the characters fromreader.voidsetNClob(int parameterIndex, Reader reader, long length)Sets the value of the specified parameter to the nextlengthcharacters fromreader.voidsetNClob(int parameterIndex, NClob value)Sets the value of the specified parameter tovalue.voidsetNString(int parameterIndex, String theString)Sets the value of a specified parameter to a supplied string.voidsetNull(int parameterIndex, int sqlType)Sets the value of a specified parameter to SQLNULL.voidsetNull(int paramIndex, int sqlType, String typeName)Sets the value of a specified parameter to SQLNULL.voidsetObject(int parameterIndex, Object theObject)Sets the value of a specified parameter using a supplied object.voidsetObject(int parameterIndex, Object theObject, int targetSqlType)Sets the value of a specified parameter using a supplied object.voidsetObject(int parameterIndex, Object theObject, int targetSqlType, int scale)Sets the value of a specified parameter using a supplied object.voidsetRef(int parameterIndex, Ref theRef)Sets the value of a specified parameter to a suppliedREF(<structured-type>)value.voidsetRowId(int parameterIndex, RowId theRowId)Sets the value of a specified parameter to a suppliedjava.sql.RowId.voidsetShort(int parameterIndex, short theShort)Sets the value of a specified parameter to a suppliedshortvalue.voidsetSQLXML(int parameterIndex, SQLXML xmlObject)Sets the value of the specified parameter to the value ofxmlObject.voidsetString(int parameterIndex, String theString)Sets the value of a specified parameter to a supplied string.voidsetTime(int parameterIndex, Time theTime)Sets the value of a specified parameter to a suppliedjava.sql.Timevalue.voidsetTime(int parameterIndex, Time theTime, Calendar cal)Sets the value of a specified parameter to a suppliedjava.sql.Timevalue, using a suppliedCalendar.voidsetTimestamp(int parameterIndex, Timestamp theTimestamp)Sets the value of a specified parameter to a supplied java.sql.Timestamp value.voidsetTimestamp(int parameterIndex, Timestamp theTimestamp, Calendar cal)Sets the value of a specified parameter to a suppliedjava.sql.Timestampvalue, using the suppliedCalendar.voidsetUnicodeStream(int parameterIndex, InputStream theInputStream, int length)Deprecated.voidsetURL(int parameterIndex, URL theURL)Sets the value of a specified parameter to a suppliedjava.net.URL.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, setQueryTimeoutMethods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
Method Details
-
addBatch
Add a set of parameters to thePreparedStatement's command batch.- Throws:
SQLException- if a database error happens.
-
clearParameters
Clear the current parameter values.Typically, parameter values are retained for multiple executions of the
Statement. Setting a parameter value replaces the previous value. This method clears the values for all parameters, releasing all resources used by those parameters.- Throws:
SQLException- if a database error happens.
-
execute
Executes the SQL statement in thisPreparedStatement.A
PreparedStatementmay return multiple results. The execute method executes thePreparedStatementand returns a flag indicating the kind of result produced by the action. The methodsgetResultSetorgetUpdateCountare used to retrieve the first result, and the second and subsequent results are retrieved withgetMoreResults.- Returns:
trueif the result of the execution is aResultSet,falseif there is no result or if the result is an update count.- Throws:
SQLException- if a database error happens.
-
executeQuery
Executes the SQL query in thePreparedStatementand returns theResultSetgenerated by the query.- Returns:
- the
ResultSetgenerated by the query, nevernull. - Throws:
SQLException- if a database error happens or if the SQL statement does not produce aResultSet.
-
executeUpdate
Invokes the SQL command contained within the prepared statement. This must beINSERT,UPDATE,DELETE, or a command that returns nothing.- Returns:
- the number of affected rows for
INSERT,UPDATEorDELETEstatements,0for statements that return nothing. - Throws:
SQLException- if a database error happens or if the SQL statement returns aResultSet.
-
getMetaData
Returns aResultSetMetaDatadescribing theResultSetthat would be produced by execution of thePreparedStatement.It is possible to know the metadata for the
ResultSetwithout executing thePreparedStatement, because thePreparedStatementis precompiled. As a result the metadata can be queried ahead of time without actually executing the statement.- Returns:
- a
ResultSetMetaDataobject with the information about the columns of theResultSet, if the driver can return aResultSetMetaData.nullotherwise. - Throws:
SQLException- if there is a database error.
-
getParameterMetaData
Gets information about the parameters of thePreparedStatement.- Returns:
- a
ParameterMetaDataobject which holds information about the number, type, and properties of the parameters of thisPreparedStatement. - Throws:
SQLException- if a database error happens.
-
setArray
Sets the value of a specified parameter to the suppliedArray.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theArray- ajava.sql.Arraygiving the new value of the parameter atparameterIndex.- Throws:
SQLException- if a database error happens.- See Also:
Array
-
setAsciiStream
void setAsciiStream(int parameterIndex, InputStream theInputStream, int length) throws SQLExceptionSets the value of a specified parameter to the content of a suppliedInputStream, which has a specified number of bytes.This is a good method for setting an SQL
LONGVARCHARparameter where the length of the data is large. Data is read from theInputStreamuntil end-of-file is reached or the specified number of bytes is copied.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theInputStream- the ASCIIInputStreamcarrying the data to which the parameter atparameterIndexis set.length- the number of bytes in theInputStreamto copy to the parameter.- Throws:
SQLException- if a database error happens.
-
setBigDecimal
Sets the value of a specified parameter to a suppliedjava.math.BigDecimalvalue.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theBigDecimal- the value to which the parameter atparameterIndexis set.- Throws:
SQLException- if a database error happens.- See Also:
BigDecimal
-
setBinaryStream
void setBinaryStream(int parameterIndex, InputStream theInputStream, int length) throws SQLExceptionSets the value of a specified parameter to the content of a supplied binaryInputStream, which has a specified number of bytes.Use this method when a large amount of data needs to be set into a
LONGVARBINARYparameter.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theInputStream- the binaryInputStreamcarrying the data to update the parameter.length- the number of bytes in theInputStreamto copy to the parameter.- Throws:
SQLException- if a database error happens.
-
setBlob
Sets the value of a specified parameter to the givenBlobobject.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theBlob- thejava.sql.Blobto which the parameter atparameterIndexis set.- Throws:
SQLException- if a database error happens.- See Also:
Blob
-
setBoolean
Sets the value of a specified parameter to a suppliedbooleanvalue.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theBoolean- the boolean value to which the parameter atparameterIndexis set.- Throws:
SQLException- if a database error happens.
-
setByte
Sets the value of a specified parameter to a suppliedbytevalue.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theByte- the byte value to which the parameter atparameterIndexis set.- Throws:
SQLException- if a database error happens.
-
setBytes
Sets the value of a specified parameter to a supplied array of bytes. The array is mapped to aVARBINARYorLONGVARBINARYin the database.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theBytes- the array of bytes to which the parameter atparameterIndexis set.- Throws:
SQLException- if a database error happens.
-
setCharacterStream
Sets the value of a specified parameter to the character content of aReaderobject, with the specified length of character data.Data is read from the
Readeruntil end-of-file is reached or the specified number of characters are copied.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1reader- thejava.io.Readercontaining the character data.length- the number of characters to be read.- Throws:
SQLException- if a database error happens.
-
setClob
Sets the value of a specified parameter to the givenClobobject.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theClob- ajava.sql.Clobholding the data to which the parameter atparameterIndexis set.- Throws:
SQLException- if a database error happens.
-
setDate
Sets the value of a specified parameter to a suppliedjava.sql.Datevalue.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theDate- ajava.sql.Dateto which the parameter atparameterIndexis set.- Throws:
SQLException- if a database error happens.
-
setDate
Sets the value of a specified parameter to a suppliedjava.sql.Datevalue, using a suppliedCalendarto map the Date. TheCalendarallows the application to control the timezone used to compute the SQLDATEin the database - without the suppliedCalendar, the driver uses the VM defaults. See "Be wary of the default locale".- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theDate- ajava.sql.Dateto which the parameter atparameterIndexis set.cal- aCalendarto use to construct the SQLDATEvalue.- Throws:
SQLException- if a database error happens.- See Also:
Date,Calendar
-
setDouble
Sets the value of a specified parameter to a supplieddoublevalue.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theDouble- thedoublevalue to which the parameter atparameterIndexis set.- Throws:
SQLException- if a database error happens.
-
setFloat
Sets the value of a specified parameter to to a suppliedfloatvalue.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theFloat- thefloatvalue to update the parameter.- Throws:
SQLException- if a database error happens.
-
setInt
Sets the value of a specified parameter to a suppliedintvalue.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theInt- theintvalue to which the parameter atparameterIndexis set.- Throws:
SQLException- if a database error happens.
-
setLong
Sets the value of a specified parameter to a suppliedlongvalue.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theLong- thelongvalue to which the parameter atparameterIndexis set.- Throws:
SQLException- if a database error happens.
-
setNull
Sets the value of a specified parameter to SQLNULL. Don't use this version ofsetNullfor User Defined Types (UDT) or for REF type parameters.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.sqlType- the SQL type of the parameter, as defined injava.sql.Types.- Throws:
SQLException- if a database error happens.
-
setNull
Sets the value of a specified parameter to SQLNULL. This version ofsetNullshould be used for User Defined Types (UDTs) and also REF types. UDTs can beSTRUCT,DISTINCT,JAVA_OBJECTand named array types.Applications must provide the SQL type code and also a fully qualified SQL type name when supplying a
NULLUDT or REF. For a UDT, the type name is the type name of the parameter itself, but for a REF parameter the type name is the type name of the referenced type.- Parameters:
paramIndex- the parameter number index, where the first parameter has index 1.sqlType- the SQL type of the parameter, as defined injava.sql.Types.typeName- the fully qualified name of a UDT or REF type - ignored if the parameter is not a UDT.- Throws:
SQLException- if a database error happens.- See Also:
Types
-
setObject
Sets the value of a specified parameter using a supplied object.There is a standard mapping from Java types to SQL types, defined in the JDBC specification. The passed object is then transformed into the appropriate SQL type, and then transferred to the database.
setObjectcan be used to pass abstract data types unique to the database, by using a JDBC driver specific Java type. If the object's class implements the interfaceSQLData, the JDBC driver callsSQLData.writeSQLto write it to the SQL data stream. If the object's class implementsRef,Blob,Clob,Struct, orArray, the driver passes it to the database as a value of the corresponding SQL type.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theObject- the object containing the value to which the parameter atparameterIndexis set.- Throws:
SQLException- if a database error happens.
-
setObject
Sets the value of a specified parameter using a supplied object.The object is converted to the given
targetSqlTypebefore it is sent to the database. If the object has a custom mapping (its class implements the interfaceSQLData), the JDBC driver will call the methodSQLData.writeSQLto write it to the SQL data stream. If the object's class implementsRef,Blob,Clob,Struct, orArray, the driver will pass it to the database in the form of the relevant SQL type.- Parameters:
parameterIndex- the parameter index, where the first parameter has index 1.theObject- the Object containing the value to which the parameter atparameterIndexis set.targetSqlType- the SQL type to send to the database, as defined injava.sql.Types.- Throws:
SQLException- if a database error happens.
-
setObject
void setObject(int parameterIndex, Object theObject, int targetSqlType, int scale) throws SQLExceptionSets the value of a specified parameter using a supplied object.The object is converted to the given
targetSqlTypebefore it is sent to the database. If the object has a custom mapping (its class implements the interfaceSQLData), the JDBC driver will call the methodSQLData.writeSQLto write it to the SQL data stream. If the object's class implementsRef,Blob,Clob,Struct, orArray, the driver will pass it to the database in the form of the relevant SQL type.- Parameters:
parameterIndex- the parameter index, where the first parameter has index 1.theObject- the Object containing the value to which the parameter atparameterIndexis set.targetSqlType- the SQL type to send to the database, as defined injava.sql.Types.scale- the number of digits after the decimal point - only applies to the typesjava.sql.Types.DECIMALandjava.sql.Types.NUMERIC- ignored for all other types.- Throws:
SQLException- if a database error happens.
-
setRef
Sets the value of a specified parameter to a suppliedREF(<structured-type>)value. This is stored as an SQLREF.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theRef- ajava.sql.Refvalue to which the parameter atparameterIndexis set.- Throws:
SQLException- if a database error happens.- See Also:
Ref
-
setShort
Sets the value of a specified parameter to a suppliedshortvalue.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theShort- ashortvalue to which the parameter atparameterIndexis set.- Throws:
SQLException- if a database error happens.
-
setString
Sets the value of a specified parameter to a supplied string.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theString- the value to which the parameter atparameterIndexis set.- Throws:
SQLException- if a database error happens.
-
setTime
Sets the value of a specified parameter to a suppliedjava.sql.Timevalue.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theTime- ajava.sql.Timevalue to which the parameter atparameterIndexis set.- Throws:
SQLException- if a database error happens.
-
setTime
Sets the value of a specified parameter to a suppliedjava.sql.Timevalue, using a suppliedCalendar.The driver uses the supplied
Calendarto create the SQLTIMEvalue, which allows it to use a custom timezone - otherwise the driver uses the VM defaults. See "Be wary of the default locale".- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theTime- ajava.sql.Timevalue to which the parameter atparameterIndexis set.cal- aCalendarto use to construct the SQLTIMEvalue.- Throws:
SQLException- if a database error happens.- See Also:
Time,Calendar
-
setTimestamp
Sets the value of a specified parameter to a supplied java.sql.Timestamp value.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theTimestamp- the java.sql.Timestamp value to which the parameter atparameterIndexis set.- Throws:
SQLException- if a database error happens.
-
setTimestamp
Sets the value of a specified parameter to a suppliedjava.sql.Timestampvalue, using the suppliedCalendar.The driver uses the supplied
Calendarto create the SQLTIMESTAMPvalue, which allows it to use a custom timezone - otherwise the driver uses the VM defaults. See "Be wary of the default locale".- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theTimestamp- thejava.sql.Timestampvalue to which the parameter atparameterIndexis set.cal- aCalendarto use to construct the SQLTIMESTAMPvalue- Throws:
SQLException- if a database error happens.- See Also:
Timestamp,Calendar
-
setUnicodeStream
@Deprecated void setUnicodeStream(int parameterIndex, InputStream theInputStream, int length) throws SQLExceptionDeprecated.Sets the value of a specified parameter to the characters from a suppliedInputStream, with a specified number of bytes.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theInputStream- theInputStreamwith the character data to which the parameter atparameterIndexis set.length- the number of bytes to read from theInputStream.- Throws:
SQLException- if a database error happens.
-
setURL
Sets the value of a specified parameter to a suppliedjava.net.URL.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theURL- theURLto which the parameter atparameterIndexis set.- Throws:
SQLException- if a database error happens.- See Also:
URL
-
setRowId
Sets the value of a specified parameter to a suppliedjava.sql.RowId.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theRowId- theRowIdto which the parameter atparameterIndexis set.- Throws:
SQLException- if a database error happens.
-
setNString
Sets the value of a specified parameter to a supplied string.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.theString- theStringto which the parameter atparameterIndexis set.- Throws:
SQLException- if a database error happens.
-
setNCharacterStream
Sets the value of the specified parameter to the nextlengthcharacters fromreader.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.reader- theReaderlength- character count- Throws:
SQLException- if a database error happens.
-
setNClob
Sets the value of the specified parameter tovalue.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.value- theNClobto which the parameter atparameterIndexis set.- Throws:
SQLException- if a database error happens.
-
setClob
Sets the value of the specified parameter to the nextlengthcharacters fromreader.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.reader- theReaderlength- character count- Throws:
SQLException- if a database error happens.
-
setBlob
Sets the value of the specified parameter to the nextlengthbytes frominputStream.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.inputStream- theInputStreamlength- character count- Throws:
SQLException- if a database error happens.
-
setNClob
Sets the value of the specified parameter to the nextlengthcharacters fromreader.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.reader- theReaderlength- character count- Throws:
SQLException- if a database error happens.
-
setSQLXML
Sets the value of the specified parameter to the value ofxmlObject.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.xmlObject- theSQLXML- Throws:
SQLException- if a database error happens.
-
setAsciiStream
Sets the value of the specified parameter to the nextlengthbytes frominputStream.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.inputStream- theInputStreamlength- character count- Throws:
SQLException- if a database error happens.
-
setBinaryStream
Sets the value of the specified parameter to the nextlengthbytes frominputStream.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.inputStream- theInputStreamlength- character count- Throws:
SQLException- if a database error happens.
-
setCharacterStream
Sets the value of the specified parameter to the nextlengthcharacters fromreader.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.reader- theReaderlength- character count- Throws:
SQLException- if a database error happens.
-
setAsciiStream
Sets the value of the specified parameter to the bytes frominputStream.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.inputStream- theInputStream- Throws:
SQLException- if a database error happens.
-
setBinaryStream
Sets the value of the specified parameter to the bytes frominputStream.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.inputStream- theInputStream- Throws:
SQLException- if a database error happens.
-
setCharacterStream
Sets the value of the specified parameter to the characters fromreader.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.reader- theReader- Throws:
SQLException- if a database error happens.
-
setNCharacterStream
Sets the value of the specified parameter to the characters fromreader.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.reader- theReader- Throws:
SQLException- if a database error happens.
-
setClob
Sets the value of the specified parameter to the characters fromreader.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.reader- theReader- Throws:
SQLException- if a database error happens.
-
setBlob
Sets the value of the specified parameter to the bytes frominputStream.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.inputStream- theInputStream- Throws:
SQLException- if a database error happens.
-
setNClob
Sets the value of the specified parameter to the characters fromreader.- Parameters:
parameterIndex- the parameter number index, where the first parameter has index 1.reader- theReader- Throws:
SQLException- if a database error happens.
-
setCharacterStream(int, Reader, int)