JDBC Type 4 Driver Programmer's Reference for SQL/MX Release 3.2.1

Before running the JDBC application that uses BLOB and CLOB data through the JDBC API, the
database administrator must create the LOB tables. For information on creating LOB tables, see
Managing LOB Data with the Lob Admin Utility.
The JDBC applications that access BLOB or CLOB data must specify the associated LOB table
names and, optionally, configure the reserveDataLocators property.
Specifying the LOB Table
At run time, a user JDBC application notifies the Type 4 driver of the name or names of the LOB
tables associated with the CLOB or BLOB columns of the base tables being accessed by the
application. One LOB table or separate tables can be used for BLOB and CLOB data. The JDBC
application specifies a LOB table name either through a system parameter or through a Java
Property object by using one of the following properties, depending on the LOB column type:
Property nameLOB Column Type
blobTableNameBLOB
clobTableNameCLOB
For more information about using these properties, see “LOB Table Name Properties (page 42).
Reserving Data Locators
A data locator is the reference pointer value (SQL LARGEINT data type) that is substituted for the
BLOB or CLOB column in the base table definition. Each object stored into the LOB table is assigned
a unique data locator value. Because the LOB table is a shared resource among all accessors that
use the particular LOB table, reserving data locators reduces contention for getting the next value.
The default setting is 100 reserved data locators; therefore, each JVM instance can insert 100
large objects (not chunks) before needing a new allocation.
Specify the number of data locators (n) to reserve for your application by using the Type 4 driver
property t4sqlmx.reserveDataLocators. For information about specifying this property, see
reserveDataLocators (page 46).
Storing CLOB Data
“Inserting CLOB Columns by Using the Clob Interface (page 56)
“Writing ASCII or MBCS Data to a CLOB Column (page 57)
“Inserting CLOB Data by Using the PreparedStatement Interface (page 57)
“Inserting a Clob Object by Using the setClob Method” (page 58)
“Inserting a CLOB column with Unicode data using a Reader (page 58)
“Writing Unicode data to a CLOB column (page 58)
Inserting CLOB Columns by Using the Clob Interface
When you insert a row containing a CLOB data type, and before the column can be updated with
real CLOB data, you can insert a row that has an empty CLOB value. To insert an empty CLOB
value in a NonStop SQL/MX database, specify the EMPTY_CLOB() function for the CLOB column
in the insert statement.
56 Working with BLOB and CLOB Data