If you disable progressive streaming, the way in which the IBM Data Server Driver
for JDBC and SQLJ handles LOBs depends on the value of the
fullyMaterializeLobData property.
Use of progressive streaming is the preferred method of LOB or XML data
retrieval.
LOB locators with the IBM Data Server Driver for JDBC and
SQLJ
The IBM Data Server Driver for JDBC and SQLJ can use LOB locators to retrieve
data in LOB columns. You should use LOB locators only if the data source does
not support progressive streaming.
To cause JDBC to use LOB locators to retrieve data from LOB columns, you need
to set the fullyMaterializeLobData property to false and set the
progressiveStreaming property to NO (DB2BaseDataSource.NO in an application
program).
The effect of fullyMaterializeLobData depends on whether the data source
supports progressive locators:
v If the data source does not support progressive locators:
If the value of fullyMaterializeLobData is true, LOB data is fully materialized
within the JDBC driver when a row is fetched. If the value is false, LOB data is
streamed. The driver uses locators internally to retrieve LOB data in chunks on
an as-needed basis It is highly recommended that you set this value to false
when you retrieve LOBs that contain large amounts of data. The default is true.
v If the data source supports progressive streaming, also known as dynamic data
format:
The JDBC driver ignores the value of fullyMaterializeLobData if the
progressiveStreaming property is set to YES (DB2BaseDataSource.YES in an
application program) or is not set.
fullyMaterializeLobData has no effect on stored procedure parameters.
As in any other language, a LOB locator in a Java application is associated with
only one data source. You cannot use a single LOB locator to move data between
two different data sources. To move LOB data between two data sources, you need
to materialize the LOB data when you retrieve it from a table in the first data
source and then insert that data into the table in the second data source.
LOB operations with the IBM Data Server Driver for JDBC and
SQLJ
The IBM Data Server Driver for JDBC and SQLJ supports methods for updating
and retrieving data from BLOB, CLOB, and DBCLOB columns in a table, and for
calling stored procedures or user-defined functions with BLOB or CLOB
parameters.
Among the operations that you can perform on LOB data under the IBM Data
Server Driver for JDBC and SQLJ are:
v Specify a BLOB or column as an argument of the following ResultSet methods
to retrieve data from a BLOB or CLOB column:
For BLOB columns:
– getBinaryStream
– getBytes
Chapter 3. JDBC application programming 51