JDBC Type 2 Driver Programmer's Reference for SQL/MX Release 3.2.1 (H06.26+, J06.15+)

4 Working with BLOB and CLOB Data
This section describes working with BLOB and CLOB data in JDBC applications. You can use the
standard interface described in the JDBC 3.0 API specification to access BLOB and CLOB data in
NonStop SQL/MX tables with support provided by the JDBC/MX driver.
BLOB and CLOB are not native data types in an SQL/MX database. But, database administrators
can create SQL/MX tables that have BLOB and CLOB columns by using the JDBC/MX driver or
special SQL syntax in MXCI as described in the next section, “Managing the SQL/MX Tables for
BLOB and CLOB Data” (page 54).
For management purposes, CLOB and BLOB data is referred to as large object (LOB) data, which
can represent either data type.
NOTE: Support for BLOB and CLOB data requires SQL/MX tables.
The section is organized in topics by category as follows:
TopicCategory
The Physical Files
Architecture for LOB Support” (page 44)
“Setting Properties for the LOB Table” (page 45)
“Specifying the LOB Table (page 45)
Accessing CLOB Data
“Storing CLOB Data” (page 46)
“Reading CLOB Data (page 47)
“Updating CLOB Data” (page 48)
“Deleting CLOB Data” (page 49)
Accessing BLOB Data
“Storing BLOB Data” (page 49)
“Reading Binary Data from a BLOB Column (page 51)
“Updating BLOB Data” (page 51)
“Deleting BLOB Data” (page 51)
Miscellaneous
“NULL and Empty BLOB or CLOB Value” (page 52)
“Transactions Involving Blob and Clob Access (page 52)
Access Considerations for Clob and Blob Objects (page 52)
For full working examples showing how to access BLOB and CLOB data, see Appendix A.
For information about creating and managing tables for BLOB and CLOB data, see “Managing
the SQL/MX Tables for BLOB and CLOB Data” (page 54).
Architecture for LOB Support
The tables that support LOB data are:
Base table
Referenced by JDBC applications to insert, store, read, and update BLOB and CLOB data. In the
base table, the JDBC/MX driver maps the BLOB and CLOB columns into a data-locator column.
The data-locator column points to the actual LOB data that is stored in a separate user table called
the LOB table.
LOB table
Actually contains the BLOB and CLOB data in chunks. A Clob or Blob object is identified by a data
locator. LOB tables have two formats: LOB table for BLOB data and a LOB table for CLOB data.
44 Working with BLOB and CLOB Data