Inserting a smart large object into a column

About this task

After creating a smart large object, you must insert it into a BLOB or CLOB column to save it in the database. To do this, you must convert the IfxLocator object to an IfxBblob or IfxCblob object, depending upon the column type.

To insert a smart large object into a BLOB or CLOB column:

Procedure

  1. Create an IfxBblob or IfxCblob object, as follows:
    IfxBblob blb = new IfxBblob(loPtr);

    The loPtr parameter is an IfxLocator object obtained from one of the previous sets of steps.

  2. Use the PreparedStatement.setBlob() or setClob() method to insert the object into the column.

Results

Important: The sbspace for the smart large object must exist in the database server before the insertion executes.