Perform operations on smart large objects

In the database server, you can store a smart large object directly in a column that has one of the following data types:
  • The CLOB data type holds text data.
  • The BLOB data type can store any kind of binary data in an undifferentiated byte stream.

The CLOB or BLOB column holds an LO handle for the smart large object. Therefore, when you select a CLOB or BLOB column, you do not obtain the actual data of the smart large object, but the LO handle that identifies this data. Columns for smart large objects have a theoretical limit of 4 terabytes and a practical limit determined by your disk capacity.

You can use either of the following ways to store a smart large object in a column:
  • For direct access to the smart large object, create a column of the CLOB or BLOB data type.
  • To hide the smart large object within an atomic data type, create an opaque type that holds a smart large object.

In a client application, the IfxBblob and IfxCblob classes are bridges between the way of handling smart large object data described in the JDBC 3.0 specification and the HCL OneDB™ extensions. The IfxBblob class implements the java.sql.Blob interface, and the IfxCblob class implements the java.sql.Clob interface. The HCL OneDB extensions require an IfxLocator object to identify the smart large object in the database server.

When you query a table containing a column of type BLOB or CLOB, an object of type Blob or Clob is returned, depending upon the column type. You can then use the JDBC 3.0 supporting methods for objects of type Blob or Clob to access the smart large object.

The constructors create an IfxBblob or IfxCblob object from the IfxLocator object loPtr:
public IfxBblob(IfxLocator loPtr)
public IfxCblob(IfxLocator loPtr)
The following locator method returns an IfxLocator object from an IfxBblob or IfxCblob object. You can then open, read, and write to the smart large object using the IfxSmartBlob.IfxLoOpen(), IfxLoRead(), and IfxLoWrite() methods:
public IfxLocator getLocator() throws SQLException