## org.eclipse.datatools.connectivity.oda
Interface IClob

    public interface IClob

An optional interface that represents a Character Large Object (CLOB) value.
The interface must be implemented only if the ODA driver supports the CLOB data type.

The IClob interface provides methods for retrieving a CLOB value as a Java stream that can be read in smaller chunks, and for optionally getting the length of a CLOB value.
The interface method `IResultSet.getClob` returns an IClob instance.

Since:
  3.0

Method Summary
`java.io.Reader` `getCharacterStream()` Retrieves the CLOB value designated by this IClob instance as a java.io.Reader object for reading a stream of characters.
`java.lang.String` `getSubString(long position, int length)` Retrieves a copy of the specified substring in the CLOB value designated by this IClob instance.
`long` `length()` Returns the number of characters in the CLOB value designated by this IClob object.

Method Detail

### getCharacterStream

    java.io.Reader getCharacterStream()
                                      throws OdaException

  Retrieves the CLOB value designated by this IClob instance as a java.io.Reader object for reading a stream of characters.

  Returns:
    a java.io.Reader object that contains the CLOB data
  Throws:
    `OdaException` - if data source error occurs

### getSubString

    java.lang.String getSubString(long position,
                                  int length)
                                  throws OdaException

  Retrieves a copy of the specified substring in the CLOB value designated by this IClob instance.
  An optional short-cut method to retrieve from the instance's character stream. The ODA consumer helper framework provides default implementation, which is used when an ODA driver throws an UnsupportedOperationException. An ODA driver is however encouraged to provide a more efficient implementation of this method.

  Parameters:
    `position` - the first character of the substring to be extracted. The first character is at position 1.
    `length` - the number of consecutive characters to be copied; a negative value means to copy all remaining characters available in the stream.
  Returns:
    the specified substring that begins at `position` and has up to `length` consecutive characters.
  Throws:
    `OdaException` - if data source error occurs

### length

    long length()
                throws OdaException

  Returns the number of characters in the CLOB value designated by this IClob object. An optional method; throws UnsupportedOperationException if a driver does not support retrieving the length.

  Returns:
    length of the CLOB value in characters
  Throws:
    `OdaException` - if data source error occurs

Copyright © 2006 -- 2008 Actuate, IBM Corporation, Sybase, Inc. and others. All rights reserved.