Class JdbcPreparedStatement
- All Implemented Interfaces:
AutoCloseable,PreparedStatement,Statement,Wrapper
- Direct Known Subclasses:
JdbcCallableStatement
Thread safety: the prepared statement is not thread-safe. If the same prepared statement is used by multiple threads access to it must be synchronized. The single synchronized block must include assignment of parameters, execution of the command and all operations with its result.
synchronized (prep) {
prep.setInt(1, 10);
try (ResultSet rs = prep.executeQuery()) {
while (rs.next) {
// Do something
}
}
}
synchronized (prep) {
prep.setInt(1, 15);
updateCount = prep.executeUpdate();
}
-
Field Summary
FieldsFields inherited from class org.h2.jdbc.JdbcStatement
conn, fetchSize, generatedKeys, maxRows, resultSet, resultSetConcurrency, resultSetType, session, updateCountFields inherited from class org.h2.message.TraceObject
ARRAY, BLOB, CALLABLE_STATEMENT, CLOB, CONNECTION, DATA_SOURCE, DATABASE_META_DATA, PARAMETER_META_DATA, PREPARED_STATEMENT, RESULT_SET, RESULT_SET_META_DATA, SAVEPOINT, SQLXML, STATEMENT, trace, XA_DATA_SOURCE, XIDFields 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 TypeMethodDescriptionvoidaddBatch()Adds the current settings to the batch.voidCalling this method is not legal on a PreparedStatement.voidClears the batch.voidClears all parameters.voidclose()Closes this statement.booleanexecute()Executes an arbitrary statement.int[]Executes the batch.long[]Executes the batch.longExecutes a statement (insert, update, delete, create, drop) and returns the update count.Executes a query (select statement) and returns the result set.executeQuery(String sql) Calling this method is not legal on a PreparedStatement.intExecutes a statement (insert, update, delete, create, drop) and returns the update count.Gets the result set metadata of the query returned when the statement is executed.Get the parameter meta data of this prepared statement.voidSets the value of a parameter as an Array.voidsetAsciiStream(int parameterIndex, InputStream x) Sets the value of a parameter as an ASCII stream.voidsetAsciiStream(int parameterIndex, InputStream x, int length) Sets the value of a parameter as an ASCII stream.voidsetAsciiStream(int parameterIndex, InputStream x, long length) Sets the value of a parameter as an ASCII stream.voidsetBigDecimal(int parameterIndex, BigDecimal x) Sets the value of a parameter.voidsetBinaryStream(int parameterIndex, InputStream x) Sets the value of a parameter as an input stream.voidsetBinaryStream(int parameterIndex, InputStream x, int length) Sets the value of a parameter as an input stream.voidsetBinaryStream(int parameterIndex, InputStream x, long length) Sets the value of a parameter as an input stream.voidsetBlob(int parameterIndex, InputStream x) Sets the value of a parameter as a Blob.voidsetBlob(int parameterIndex, InputStream x, long length) Sets the value of a parameter as a Blob.voidSets the value of a parameter as a Blob.voidsetBoolean(int parameterIndex, boolean x) Sets the value of a parameter.voidsetByte(int parameterIndex, byte x) Sets the value of a parameter.voidsetBytes(int parameterIndex, byte[] x) Sets the value of a parameter as a byte array.voidsetCharacterStream(int parameterIndex, Reader x) Sets the value of a parameter as a character stream.voidsetCharacterStream(int parameterIndex, Reader x, int length) Sets the value of a parameter as a character stream.voidsetCharacterStream(int parameterIndex, Reader x, long length) Sets the value of a parameter as a character stream.voidSets the value of a parameter as a Clob.voidSets the value of a parameter as a Clob.voidSets the value of a parameter as a Clob.voidSets the value of a parameter.voidSets the date using a specified time zone.voidsetDouble(int parameterIndex, double x) Sets the value of a parameter.voidsetFloat(int parameterIndex, float x) Sets the value of a parameter.voidsetInt(int parameterIndex, int x) Sets the value of a parameter.voidsetLong(int parameterIndex, long x) Sets the value of a parameter.voidsetNCharacterStream(int parameterIndex, Reader x) Sets the value of a parameter as a character stream.voidsetNCharacterStream(int parameterIndex, Reader x, long length) Sets the value of a parameter as a character stream.voidSets the value of a parameter as a Clob.voidSets the value of a parameter as a Clob.voidSets the value of a parameter as a Clob.voidsetNString(int parameterIndex, String x) Sets the value of a parameter.voidsetNull(int parameterIndex, int sqlType) Sets a parameter to null.voidSets a parameter to null.voidSets the value of a parameter.voidSets the value of a parameter.voidSets the value of a parameter.voidSets the value of a parameter.voidSets the value of a parameter.void[Not supported] Sets the value of a column as a reference.void[Not supported] Sets the value of a parameter as a row id.voidsetShort(int parameterIndex, short x) Sets the value of a parameter.voidSets the value of a parameter as a SQLXML.voidSets the value of a parameter.voidSets the value of a parameter.voidSets the time using a specified time zone.voidsetTimestamp(int parameterIndex, Timestamp x) Sets the value of a parameter.voidsetTimestamp(int parameterIndex, Timestamp x, Calendar calendar) Sets the timestamp using a specified time zone.voidsetUnicodeStream(int parameterIndex, InputStream x, int length) Deprecated.since JDBC 2.0, use setCharacterStreamvoid[Not supported]toString()INTERNALMethods inherited from class org.h2.jdbc.JdbcStatement
cancel, clearWarnings, closeOldResultSet, closeOnCompletion, enquoteIdentifier, execute, execute, execute, execute, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isCancelled, isClosed, isCloseOnCompletion, isPoolable, isSimpleIdentifier, isWrapperFor, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeout, unwrapMethods inherited from class org.h2.message.TraceObject
debugCode, debugCodeAssign, debugCodeCall, debugCodeCall, debugCodeCall, getNextId, getTraceId, getTraceObjectName, isDebugEnabled, isInfoEnabled, logAndConvert, quote, quoteArray, quoteBigDecimal, quoteBytes, quoteDate, quoteIntArray, quoteMap, quoteTime, quoteTimestamp, setTrace, unsupportedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.sql.Statement
cancel, clearWarnings, closeOnCompletion, enquoteIdentifier, enquoteLiteral, enquoteNCharLiteral, execute, execute, execute, execute, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getConnection, getFetchDirection, getFetchSize, getGeneratedKeys, getLargeMaxRows, getLargeUpdateCount, getMaxFieldSize, getMaxRows, getMoreResults, getMoreResults, getQueryTimeout, getResultSet, getResultSetConcurrency, getResultSetHoldability, getResultSetType, getUpdateCount, getWarnings, isClosed, isCloseOnCompletion, isPoolable, isSimpleIdentifier, setCursorName, setEscapeProcessing, setFetchDirection, setFetchSize, setLargeMaxRows, setMaxFieldSize, setMaxRows, setPoolable, setQueryTimeoutMethods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
Field Details
-
command
protected org.h2.command.CommandInterface command
-
-
Method Details
-
executeQuery
Executes a query (select statement) and returns the result set. If another result set exists for this statement, this will be closed (even if this statement fails).- Specified by:
executeQueryin interfacePreparedStatement- Returns:
- the result set
- Throws:
SQLException- if this object is closed or invalid
-
executeUpdate
Executes a statement (insert, update, delete, create, drop) and returns the update count. If another result set exists for this statement, this will be closed (even if this statement fails). If auto commit is on, this statement will be committed. If the statement is a DDL statement (create, drop, alter) and does not throw an exception, the current transaction (if any) is committed after executing the statement.- Specified by:
executeUpdatein interfacePreparedStatement- Returns:
- the update count (number of affected rows by a DML statement or
other statement able to return number of rows, or 0 if no rows
were affected or the statement returns nothing, or
Statement.SUCCESS_NO_INFOif number of rows is too large forintdata type) - Throws:
SQLException- if this object is closed or invalid- See Also:
-
executeLargeUpdate
Executes a statement (insert, update, delete, create, drop) and returns the update count. If another result set exists for this statement, this will be closed (even if this statement fails). If auto commit is on, this statement will be committed. If the statement is a DDL statement (create, drop, alter) and does not throw an exception, the current transaction (if any) is committed after executing the statement.- Specified by:
executeLargeUpdatein interfacePreparedStatement- Returns:
- the update count (number of affected rows by a DML statement or other statement able to return number of rows, or 0 if no rows were affected or the statement returns nothing)
- Throws:
SQLException- if this object is closed or invalid
-
execute
Executes an arbitrary statement. If another result set exists for this statement, this will be closed (even if this statement fails). If auto commit is on, and the statement is not a select, this statement will be committed.- Specified by:
executein interfacePreparedStatement- Returns:
- true if a result set is available, false if not
- Throws:
SQLException- if this object is closed or invalid
-
clearParameters
Clears all parameters.- Specified by:
clearParametersin interfacePreparedStatement- Throws:
SQLException- if this object is closed or invalid
-
executeQuery
Calling this method is not legal on a PreparedStatement.- Specified by:
executeQueryin interfaceStatement- Overrides:
executeQueryin classJdbcStatement- Parameters:
sql- ignored- Returns:
- the result set
- Throws:
SQLException- Unsupported Feature
-
addBatch
Calling this method is not legal on a PreparedStatement.- Specified by:
addBatchin interfaceStatement- Overrides:
addBatchin classJdbcStatement- Parameters:
sql- ignored- Throws:
SQLException- Unsupported Feature
-
setNull
Sets a parameter to null.- Specified by:
setNullin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)sqlType- the data type (Types.x)- Throws:
SQLException- if this object is closed
-
setInt
Sets the value of a parameter.- Specified by:
setIntin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setString
Sets the value of a parameter.- Specified by:
setStringin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setBigDecimal
Sets the value of a parameter.- Specified by:
setBigDecimalin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setDate
Sets the value of a parameter.Usage of this method is discouraged. Use
setObject(parameterIndex, value)withLocalDateparameter instead.- Specified by:
setDatein interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed- See Also:
-
setTime
Sets the value of a parameter.Usage of this method is discouraged. Use
setObject(parameterIndex, value)withLocalTimeparameter instead.- Specified by:
setTimein interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed- See Also:
-
setTimestamp
Sets the value of a parameter.Usage of this method is discouraged. Use
setObject(parameterIndex, value)withLocalDateTimeparameter instead.- Specified by:
setTimestampin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed- See Also:
-
setObject
Sets the value of a parameter. Objects of unknown classes are serialized (on the client side).- Specified by:
setObjectin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setObject
Sets the value of a parameter. The object is converted, if required, to the specified data type before sending to the database. Objects of unknown classes are serialized (on the client side).- Specified by:
setObjectin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value, null is allowedtargetSqlType- the type as defined in java.sql.Types- Throws:
SQLException- if this object is closed
-
setObject
public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException Sets the value of a parameter. The object is converted, if required, to the specified data type before sending to the database. Objects of unknown classes are serialized (on the client side).- Specified by:
setObjectin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value, null is allowedtargetSqlType- the type as defined in java.sql.Typesscale- is ignored- Throws:
SQLException- if this object is closed
-
setObject
Sets the value of a parameter. The object is converted, if required, to the specified data type before sending to the database. Objects of unknown classes are serialized (on the client side).- Specified by:
setObjectin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value, null is allowedtargetSqlType- the SQL type- Throws:
SQLException- if this object is closed
-
setObject
public void setObject(int parameterIndex, Object x, SQLType targetSqlType, int scaleOrLength) throws SQLException Sets the value of a parameter. The object is converted, if required, to the specified data type before sending to the database. Objects of unknown classes are serialized (on the client side).- Specified by:
setObjectin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value, null is allowedtargetSqlType- the SQL typescaleOrLength- is ignored- Throws:
SQLException- if this object is closed
-
setBoolean
Sets the value of a parameter.- Specified by:
setBooleanin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setByte
Sets the value of a parameter.- Specified by:
setBytein interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setShort
Sets the value of a parameter.- Specified by:
setShortin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setLong
Sets the value of a parameter.- Specified by:
setLongin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setFloat
Sets the value of a parameter.- Specified by:
setFloatin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setDouble
Sets the value of a parameter.- Specified by:
setDoublein interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setRef
[Not supported] Sets the value of a column as a reference.- Specified by:
setRefin interfacePreparedStatement- Throws:
SQLException
-
setDate
Sets the date using a specified time zone. The value will be converted to the local time zone.Usage of this method is discouraged. Use
setObject(parameterIndex, value)withLocalDateparameter instead.- Specified by:
setDatein interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the valuecalendar- the calendar- Throws:
SQLException- if this object is closed- See Also:
-
setTime
Sets the time using a specified time zone. The value will be converted to the local time zone.Usage of this method is discouraged. Use
setObject(parameterIndex, value)withLocalTimeparameter instead.- Specified by:
setTimein interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the valuecalendar- the calendar- Throws:
SQLException- if this object is closed- See Also:
-
setTimestamp
Sets the timestamp using a specified time zone. The value will be converted to the local time zone.Usage of this method is discouraged. Use
setObject(parameterIndex, value)withLocalDateTimeparameter instead.- Specified by:
setTimestampin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the valuecalendar- the calendar- Throws:
SQLException- if this object is closed- See Also:
-
setUnicodeStream
@Deprecated public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException Deprecated.since JDBC 2.0, use setCharacterStream[Not supported] This feature is deprecated and not supported.- Specified by:
setUnicodeStreamin interfacePreparedStatement- Throws:
SQLException
-
setNull
Sets a parameter to null.- Specified by:
setNullin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)sqlType- the data type (Types.x)typeName- this parameter is ignored- Throws:
SQLException- if this object is closed
-
setBlob
Sets the value of a parameter as a Blob.- Specified by:
setBlobin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setBlob
Sets the value of a parameter as a Blob. This method does not close the stream. The stream may be closed after executing the statement.- Specified by:
setBlobin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setClob
Sets the value of a parameter as a Clob.- Specified by:
setClobin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setClob
Sets the value of a parameter as a Clob. This method does not close the reader. The reader may be closed after executing the statement.- Specified by:
setClobin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setArray
Sets the value of a parameter as an Array.- Specified by:
setArrayin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setBytes
Sets the value of a parameter as a byte array.- Specified by:
setBytesin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setBinaryStream
Sets the value of a parameter as an input stream. This method does not close the stream. The stream may be closed after executing the statement.- Specified by:
setBinaryStreamin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the valuelength- the maximum number of bytes- Throws:
SQLException- if this object is closed
-
setBinaryStream
Sets the value of a parameter as an input stream. This method does not close the stream. The stream may be closed after executing the statement.- Specified by:
setBinaryStreamin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the valuelength- the maximum number of bytes- Throws:
SQLException- if this object is closed
-
setBinaryStream
Sets the value of a parameter as an input stream. This method does not close the stream. The stream may be closed after executing the statement.- Specified by:
setBinaryStreamin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setAsciiStream
Sets the value of a parameter as an ASCII stream. This method does not close the stream. The stream may be closed after executing the statement.- Specified by:
setAsciiStreamin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the valuelength- the maximum number of bytes- Throws:
SQLException- if this object is closed
-
setAsciiStream
Sets the value of a parameter as an ASCII stream. This method does not close the stream. The stream may be closed after executing the statement.- Specified by:
setAsciiStreamin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the valuelength- the maximum number of bytes- Throws:
SQLException- if this object is closed
-
setAsciiStream
Sets the value of a parameter as an ASCII stream. This method does not close the stream. The stream may be closed after executing the statement.- Specified by:
setAsciiStreamin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setCharacterStream
Sets the value of a parameter as a character stream. This method does not close the reader. The reader may be closed after executing the statement.- Specified by:
setCharacterStreamin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the valuelength- the maximum number of characters- Throws:
SQLException- if this object is closed
-
setCharacterStream
Sets the value of a parameter as a character stream. This method does not close the reader. The reader may be closed after executing the statement.- Specified by:
setCharacterStreamin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setCharacterStream
Sets the value of a parameter as a character stream. This method does not close the reader. The reader may be closed after executing the statement.- Specified by:
setCharacterStreamin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the valuelength- the maximum number of characters- Throws:
SQLException- if this object is closed
-
setURL
[Not supported]- Specified by:
setURLin interfacePreparedStatement- Throws:
SQLException
-
getMetaData
Gets the result set metadata of the query returned when the statement is executed. If this is not a query, this method returns null.- Specified by:
getMetaDatain interfacePreparedStatement- Returns:
- the meta data or null if this is not a query
- Throws:
SQLException- if this object is closed
-
clearBatch
Clears the batch.- Specified by:
clearBatchin interfaceStatement- Overrides:
clearBatchin classJdbcStatement- Throws:
SQLException
-
close
Closes this statement. All result sets that where created by this statement become invalid after calling this method.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceStatement- Overrides:
closein classJdbcStatement- Throws:
SQLException
-
executeBatch
Executes the batch. If one of the batched statements fails, this database will continue.- Specified by:
executeBatchin interfaceStatement- Overrides:
executeBatchin classJdbcStatement- Returns:
- the array of update counts
- Throws:
SQLException- See Also:
-
executeLargeBatch
Executes the batch. If one of the batched statements fails, this database will continue.- Specified by:
executeLargeBatchin interfaceStatement- Overrides:
executeLargeBatchin classJdbcStatement- Returns:
- the array of update counts
- Throws:
SQLException
-
addBatch
Adds the current settings to the batch.- Specified by:
addBatchin interfacePreparedStatement- Throws:
SQLException
-
getParameterMetaData
Get the parameter meta data of this prepared statement.- Specified by:
getParameterMetaDatain interfacePreparedStatement- Returns:
- the meta data
- Throws:
SQLException
-
setRowId
[Not supported] Sets the value of a parameter as a row id.- Specified by:
setRowIdin interfacePreparedStatement- Throws:
SQLException
-
setNString
Sets the value of a parameter.- Specified by:
setNStringin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setNCharacterStream
Sets the value of a parameter as a character stream. This method does not close the reader. The reader may be closed after executing the statement.- Specified by:
setNCharacterStreamin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the valuelength- the maximum number of characters- Throws:
SQLException- if this object is closed
-
setNCharacterStream
Sets the value of a parameter as a character stream. This method does not close the reader. The reader may be closed after executing the statement.- Specified by:
setNCharacterStreamin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setNClob
Sets the value of a parameter as a Clob.- Specified by:
setNClobin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setNClob
Sets the value of a parameter as a Clob. This method does not close the reader. The reader may be closed after executing the statement.- Specified by:
setNClobin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
setClob
Sets the value of a parameter as a Clob. This method does not close the reader. The reader may be closed after executing the statement.- Specified by:
setClobin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the valuelength- the maximum number of characters- Throws:
SQLException- if this object is closed
-
setBlob
Sets the value of a parameter as a Blob. This method does not close the stream. The stream may be closed after executing the statement.- Specified by:
setBlobin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the valuelength- the maximum number of bytes- Throws:
SQLException- if this object is closed
-
setNClob
Sets the value of a parameter as a Clob. This method does not close the reader. The reader may be closed after executing the statement.- Specified by:
setNClobin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the valuelength- the maximum number of characters- Throws:
SQLException- if this object is closed
-
setSQLXML
Sets the value of a parameter as a SQLXML.- Specified by:
setSQLXMLin interfacePreparedStatement- Parameters:
parameterIndex- the parameter index (1, 2, ...)x- the value- Throws:
SQLException- if this object is closed
-
toString
INTERNAL- Overrides:
toStringin classJdbcStatement
-