JDBC Type 2 Driver Programmer's Reference for SQL/MX Release 3.1 (H06.23+, J06.12+)

See also NULL and Empty BLOB or CLOB Value.
NULL and Empty BLOB or CLOB Value
The data locator can have a NULL value if the BLOB or CLOB column is omitted in the insert statement. The JDBC/MX
driver returns NULL when the application retrieves the value for such a column.
When the application uses the EMPTY_BLOB() method or EMPTY_CLOB() method to insert empty BLOB or CLOB data into
the BLOB or CLOB column, JDBC/MX driver returns the Blob or Clob object with no data.
Transactions Involving Blob and Clob Access
HP recommends that your JDBC applications control the transactions when the BLOB columns or CLOB columns are
accessed either by using the external transaction or by setting the connection to manual commit mode.
If executing a prepared statement involving BLOB or CLOB data with autocommit mode enabled and an external
transaction does not exist, the JDBC/MX driver mimics autocommit mode. This operation ensures that inserts or
updates of LOB data are committed only after both the base table and LOB tables are modified.
In some instances an outputStream or Writer object is returned to the application when the object can be held for an
unknown period of time. Therefore, the following interfaces throw the exception, Autocommit is on and LOB
objects are involved
, exception when LOB data is involved, autocommit is enabled, and an external transaction
does not exist:
Clob.setAsciiStream
Clob.setCharacterStream
Blob.setBinaryStream
If an SQL/MX or FS exception occurs while the base table and LOB table are being updated, the internal transaction
used for this operation is rolled back, and an exception is thrown.
When an SQL/MX or file system exception occurs while JDBC/MX mimics autocommit mode for the base table and
the insert or update operations on a LOB table, the internal transaction used for this operation is rolled back and the
following exception is thrown:
Transaction error {0} - {1} while updating LOB tables
For the description, see the message information under sqlcode 29070.
The JDBC/MX driver reserves data locators in its own transaction to improve the concurrency among the different
processes trying to reserve the data locators.
For more information, see Transactions.
Access Considerations for Clob and Blob Objects
The JDBC/MX driver allows all the valid operations on the current Clob object or Blob object, called a LOB object.
LOB objects are current as long as the row that contains these LOB objects is the current row. The JDBC/MX driver