org.eclipse.datatools.connectivity.oda.impl
Class Clob

java.lang.Object
  extended byorg.eclipse.datatools.connectivity.oda.impl.Clob
All Implemented Interfaces:
IClob

public class Clob
extends java.lang.Object
implements IClob

Default implementation of IClob for use by ODA runtime drivers. Clob handles common types of raw data that represent a CLOB value.


Constructor Summary
Clob(java.lang.String string)
          Create a new Clob from a String.
 
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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Clob

public Clob(java.lang.String string)
Create a new Clob from a String.

Parameters:
string - String representing the clob.
Method Detail

getCharacterStream

public java.io.Reader getCharacterStream()
                                  throws OdaException
Description copied from interface: IClob
Retrieves the CLOB value designated by this IClob instance as a java.io.Reader object for reading a stream of characters.

Specified by:
getCharacterStream in interface IClob
Returns:
a java.io.Reader object that contains the CLOB data
Throws:
OdaException - if data source error occurs

getSubString

public java.lang.String getSubString(long position,
                                     int length)
                              throws OdaException
Description copied from interface: IClob
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.

Specified by:
getSubString in interface IClob
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
Returns:
the specified substring that begins at position and has up to length consecutive characters.
Throws:
OdaException - if data source error occurs

length

public long length()
            throws OdaException
Description copied from interface: IClob
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.

Specified by:
length in interface IClob
Returns:
length of the CLOB value in characters
Throws:
OdaException - if data source error occurs


Copyright © 2005 Actuate Corp. All rights reserved.