EasyManua.ls Logo

IBM DB2

IBM DB2
585 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
For CLOB columns:
getAsciiStream
getCharacterStream
getString
v Call the following ResultSet methods to update a BLOB or CLOB column in an
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.
v Use the following PreparedStatement methods to set the values for parameters
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.
v Retrieve the value of a JDBC CLOB parameter using the
CallableStatement.getString method.
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
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)
v Use ResultSet.updateXXX or PreparedStatement.setXXX methods without the
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:
52 Application Programming Guide and Reference for Java

Table of Contents