EasyManuals Logo

IBM DB2 User Manual

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
Page #66 background imageLoading...
Page #66 background image
With progressive streaming, the data source dynamically determines the most
efficient mode in which to return LOB or XML data, based on the size of the LOBs
or XML objects.
For IBM Data Server Driver for JDBC and SQLJ version 3.50 and later, progressive
streaming behavior is the default for LOB retrieval, for connections to DB2
Database for Linux, UNIX, and Windows Version 9.5 and later and IDS Version
11.50 and later.
DB2 for z/OS Version 9.1 and later supports progressive streaming for LOBs and
XML objects. DB2 Database for Linux, UNIX, and Windows Version 9.5 and later,
and IBM Informix Dynamic Server (IDS) Version 11.50 and later support
progressive streaming for LOBs.
For DB2 for z/OS Version 9.1 and later data sources, or DB2 Database for Linux,
UNIX, and Windows Version 9.5 and later data sources:
v If the IBM Data Server Driver for JDBC and SQLJ progressiveStreaming
property is DB2BaseDataSource.YES, your application uses progressive streaming
behavior.
v If you call
DB2Connection.setDB2ProgressiveStreaming(DB2BaseDataSource.YES), all
ResultSet objects that are created on the connection use progressive streaming
behavior.
When progressive streaming is enabled, you can control when the JDBC driver
materializes LOBs with the streamBufferSize property. If a LOB or XML object is
less than or equal to the streamBufferSize value, the object is materialized.
Important: With progressive streaming, when you retrieve a LOB or XML value
from a ResultSet into an application variable, you can manipulate the contents of
that application variable until you move the cursor or close the cursor on the
ResultSet. After that, the contents of the application variable are no longer
available to you. If you perform any actions on the LOB in the application variable,
you receive an SQLException. For example, suppose that progressive streaming is
enabled, and you execute statements like this:
...
ResultSet rs = stmt.executeQuery("SELECT CLOBCOL FROM MY_TABLE");
rs.next(); // Retrieve the first row of the ResultSet
Clob clobFromRow1 = rs.getClob(1);
// Put the CLOB from the first column of
// the first row in an application variable
String substr1Clob = clobFromRow1.getSubString(1,50);
// Retrieve the first 50 bytes of the CLOB
rs.next(); // Move the cursor to the next row.
// clobFromRow1 is no longer available.
// String substr2Clob = clobFromRow1.getSubString(51,100);
// This statement would yield an SQLException
Clob clobFromRow2 = rs.getClob(1);
// Put the CLOB from the first column of
// the second row in an application variable
rs.close(); // Close the ResultSet.
// clobFromRow2 is also no longer available.
After you execute rs.next() to position the cursor at the second row of the
ResultSet, the CLOB value in clobFromRow1 is no longer available to you.
Similarly, after you execute rs.close() to close the ResultSet, the values in
clobFromRow1 and clobFromRow2 are no longer available.
50 Application Programming Guide and Reference for Java
â„¢
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM DB2 and is the answer not in the manual?

IBM DB2 Specifications

General IconGeneral
DeveloperIBM
Initial Release1983
LicenseProprietary
Written inC, C++
CategoryDatabase Management System (RDBMS)
Operating SystemLinux, Windows
Programming LanguagesC, C++
Data ModelsRelational
EditionsCommunity, Standard, Advanced
Key Featureshigh availability, scalability