Sets the designated parameter to a Reader
object. The reader must contain the number
of characters specified by length otherwise a SQLException
will be
generated when the PreparedStatement
is executed.
This method differs from the setCharacterStream (int, Reader, int)
method
because it informs the driver that the parameter value should be sent to
the server as a NCLOB
. When the setCharacterStream
method is used, the
driver may have to do extra work to determine whether the parameter
data should be sent to the server as a LONGNVARCHAR
or a NCLOB
parameterIndex | index of the first parameter is 1, the second is 2, ... | |
reader | An object that contains the data to set the parameter value to. | |
length | the number of characters in the parameter data. |
SQLException | if parameterIndex does not correspond to a parameter
marker in the SQL statement; 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 closed PreparedStatement | |
SQLFeatureNotSupportedException | if the JDBC driver does not support this method |
Diagram: Statement