Accessing smart large objects

About this task

Follow these steps to use the HCL OneDB™ extensions to select a smart large object from a database column.

To access a smart large object:

Procedure

  1. Cast the java.sql.Blob or java.sql.Clob object to an IfxBblob or IfxCblob object.
  2. Use the IfxBblob.getLocator() or IfxCblob.getLocator() method to extract an IfxLocator object.
  3. Create an IfxSmartBlob object.
  4. Use the IfxSmartBlob.IfxLoOpen() method to open the smart large object.
  5. Use the IfxSmartBlob.IfxLoRead() method to read the data from the smart large object.
  6. Close the smart large object using the IfxSmartBlob.IfxLoClose() method.
  7. Release the locator pointer in the server by calling the IfxSmartBlob.IfxLoRelease() method.

Results

Standard JDBC ResultSet methods such as ResultSet.getBinaryStream(), getAsciiStream(), getString(), getBytes(), getBlob(), and getClob() can fetch BLOB or CLOB data from a table. The HCL OneDB extension classes can then access the data.