IBM DB2 Manual page 68

Table of Contents

Advertisement

v Call the following ResultSet methods to update a BLOB or CLOB column in an
v Use the following PreparedStatement methods to set the values for parameters
v Retrieve the value of a JDBC CLOB parameter using the
Restriction: With IBM Data Server Driver for JDBC and SQLJ type 2 connectivity,
you cannot call a stored procedure that has DBCLOB OUT or INOUT parameters.
If you are using the IBM Data Server Driver for JDBC and SQLJ version 4.0 or
later, you can perform the following additional operations:
v Use ResultSet.updateXXX or PreparedStatement.setXXX methods to update a
v Use ResultSet.updateXXX or PreparedStatement.setXXX methods without the
52
Application Programming Guide and Reference for Java
For CLOB columns:
– getAsciiStream
– getCharacterStream
– getString
updatable ResultSet:
For BLOB columns:
– updateBinaryStream
– updateBlob
For CLOB columns:
– updateAsciiStream
– updateCharacterStream
– updateClob
If you specify -1 for the length parameter in any of the previously listed
methods, the IBM Data Server Driver for JDBC and SQLJ reads the input data
until it is exhausted.
that correspond to BLOB or CLOB columns:
For BLOB columns:
– setBytes
– setBinaryStream
– setObject, where the Object parameter value is an InputStream.
For CLOB columns:
– setString
– setAsciiStream
– setCharacterStream
– setObject, where the Object parameter value is a Reader.
If you specify -1 for length, the IBM Data Server Driver for JDBC and SQLJ reads
the input data until it is exhausted.
CallableStatement.getString method.
BLOB or CLOB with a length value of up to 2GB for a BLOB or CLOB. For
example, these methods are defined for BLOBs:
ResultSet.updateBlob(int columnIndex, InputStream x, long length)
ResultSet.updateBlob(String columnLabel, InputStream x, long length)
ResultSet.updateBinaryStream(int columnIndex, InputStream x, long length)
ResultSet.updateBinaryStream(String columnLabel, InputStream x, long length)
PreparedStatement.setBlob(int columnIndex, InputStream x, long length)
PreparedStatement.setBlob(String columnLabel, InputStream x, long length)
PreparedStatement.setBinaryStream(int columnIndex, InputStream x, long length)
PreparedStatement.setBinaryStream(String columnLabel, InputStream x, long length)
length parameter when you update a BLOB or CLOB, to cause the IBM Data
Server Driver for JDBC and SQLJ to read the input data until it is exhausted. For
example:

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents