DB2 Version 10.1 for Linux, UNIX, and Windows

DB2GENERAL Java class: COM.ibm.db2.app.Clob

An instance of this class is passed by the database to represent a CLOB or DBCLOB as routine input, and can be passed back as output.

The application might create instances, but only in the context of an executing routine. Uses of these objects outside such a context will throw an exception.

Clob instances store characters in the database code page. Some Unicode characters cannot not be represented in this code page, and can cause an exception to be thrown during conversion. This can happen during an append operation, or during a UDF or StoredProc set() call. This is necessary to hide the distinction between a CLOB and a DBCLOB from the Java™ programmer.

The following methods are associated with the COM.ibm.db2.app.Clob class:

public long size() throws Exception

This function returns the length (in characters) of the CLOB.

public java.io.Reader getReader() throws Exception

This function returns a new Reader to read the contents of the CLOB or DBCLOB. Efficient seek/mark operations are available on that object.

public java.io.Writer getWriter() throws Exception

This function returns a new Writer to append characters to this CLOB or DBCLOB. Appended characters become immediately visible on all existing Reader instances produced by this object's GetReader() call.