Neoview JDBC Type 4 Driver Programmer's Reference (R2.2, R2.3, R2.4, R2.5)
Make updates to CLOB data in the following ways:
• “Updating Clob Objects with the updateClob Method” (page 55)
• “Replacing Clob Objects” (page 55)
Updating Clob Objects with the updateClob Method
Unlike some LOB support implementations, the Type 4 driver updates the CLOB data directly
in the database. So, when the Clob object is same in the updateClob method as the Clob object
obtained using getClob, the updateRow method of the ResultSet interface does nothing
with the Clob object.
When the Clob objects differ, the Clob object in the updateClob method behaves as if the
setClob method was issued. See “Inserting a Clob Object by Using the setClob Method”
(page 54).
Replacing Clob Objects
You can replace Clob objects in the following ways:
• Use the EMPTY_CLOB() function to replace the Clob object with the empty Clob object,
then insert new data as described under Inserting CLOB Columns by Using the Clob Interface.
• Use the PreparedStatement.setAsciiStream() or setCharacterStream() method
to replace the existing Clob object with new CLOB data.
• Use the setClob or updateClob method to replace the existing CLOB objects as explained
under “Inserting a Clob Object by Using the setClob Method” (page 54) and “Updating
Clob Objects with the updateClob Method” (page 55).
Deleting CLOB Data
To delete CLOB data, the JDBC application uses the SQL DELETE statement to delete the row in
the base table.
When the row containing the CLOB column is deleted by the JDBC application, the corresponding
CLOB data is automatically deleted by the delete trigger associated with the base table. For
information about triggers, see “Using SQL Triggers to Delete LOB Data” (page 62).
See also “NULL and Empty BLOB or Empty CLOB Value” (page 58).
Storing BLOB Data
Perform operations on BLOB columns that are similar to those operations used on CLOB columns.
• Use the EMPTY_BLOB() function in the insert statement to create an empty BLOB column
in the database.
• Use setBinaryStream method of the Blob interface to obtain the InputStream to read
BLOB data.
• Use getBinaryStream method of the Blob interface to obtain the OutputStream to
write BLOB data.
• Use setBinaryStream of the PreparedStatement interface to write the data to the
BLOB column.
Inserting a BLOB Column by Using the Blob Interface
When you insert a row containing a BLOB data type, you can insert the row using an empty BLOB
value before the column can be updated with real BLOB data. To insert an empty BLOB value in
a Neoview database, specify EMPTY_BLOB() function for the BLOB column in the insert statement.
The Type 4 driver scans the SQL string for the EMPTY_BLOB() function and substitutes the
next-available data locator.
Deleting CLOB Data 55