com.metamatrix.common.types
Class ClobType

java.lang.Object
  extended by com.metamatrix.common.types.ClobType
All Implemented Interfaces:
Sequencable, Streamable, java.io.Serializable, java.sql.Clob

public final class ClobType
extends java.lang.Object
implements Streamable, java.sql.Clob, Sequencable

This is wrapper on top of a "clob" object, which implements the "java.sql.Clob" interface. This class also implements the Streamable interface

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.metamatrix.common.types.Streamable
FORCE_STREAMING, STREAMING_BATCH_SIZE_IN_BYTES
 
Constructor Summary
ClobType(java.sql.Clob clob)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 void free()
           
 java.io.InputStream getAsciiStream()
           
 java.io.Reader getCharacterStream()
           
 java.io.Reader getCharacterStream(long pos, long length)
           
 java.lang.CharSequence getCharSequence()
           
 java.lang.String getPersistenceStreamId()
          Persitence Stream ID in the server
 java.lang.String getReferenceStreamId()
          Reference Stream ID in the server
 java.sql.Clob getSourceClob()
           
static java.lang.String getString(java.sql.Clob clob)
          Utility method to convert to String
 java.lang.String getSubString(long pos, int length)
           
 long length()
           
 long position(java.sql.Clob searchstr, long start)
           
 long position(java.lang.String searchstr, long start)
           
 java.io.OutputStream setAsciiStream(long pos)
           
 java.io.Writer setCharacterStream(long pos)
           
 void setPersistenceStreamId(java.lang.String id)
          Persitence Stream ID in the server
 void setReferenceStreamId(java.lang.String id)
          Reference Stream ID in the server
 int setString(long pos, java.lang.String str)
           
 int setString(long pos, java.lang.String str, int offset, int len)
           
 java.lang.String toString()
           
 void truncate(long len)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClobType

public ClobType(java.sql.Clob clob)
Method Detail

getSourceClob

public java.sql.Clob getSourceClob()

getReferenceStreamId

public java.lang.String getReferenceStreamId()
Description copied from interface: Streamable
Reference Stream ID in the server

Specified by:
getReferenceStreamId in interface Streamable
Returns:
string - this is buffer managers tuple source id.
See Also:
Streamable.getReferenceStreamId()

setReferenceStreamId

public void setReferenceStreamId(java.lang.String id)
Description copied from interface: Streamable
Reference Stream ID in the server

Specified by:
setReferenceStreamId in interface Streamable
Parameters:
id - this is buffer managers tuple source id.
See Also:
Streamable.setReferenceStreamId(java.lang.String)

getPersistenceStreamId

public java.lang.String getPersistenceStreamId()
Description copied from interface: Streamable
Persitence Stream ID in the server

Specified by:
getPersistenceStreamId in interface Streamable
Returns:
string - this is buffer managers tuple source id.
See Also:
Streamable.getPersistenceStreamId()

setPersistenceStreamId

public void setPersistenceStreamId(java.lang.String id)
Description copied from interface: Streamable
Persitence Stream ID in the server

Specified by:
setPersistenceStreamId in interface Streamable
Parameters:
id - this is buffer managers tuple source id.
See Also:
Streamable.setPersistenceStreamId(java.lang.String)

getAsciiStream

public java.io.InputStream getAsciiStream()
                                   throws java.sql.SQLException
Specified by:
getAsciiStream in interface java.sql.Clob
Throws:
java.sql.SQLException
See Also:
Clob.getAsciiStream()

getCharacterStream

public java.io.Reader getCharacterStream()
                                  throws java.sql.SQLException
Specified by:
getCharacterStream in interface java.sql.Clob
Throws:
java.sql.SQLException
See Also:
Clob.getCharacterStream()

getSubString

public java.lang.String getSubString(long pos,
                                     int length)
                              throws java.sql.SQLException
Specified by:
getSubString in interface java.sql.Clob
Throws:
java.sql.SQLException
See Also:
Clob.getSubString(long, int)

length

public long length()
            throws java.sql.SQLException
Specified by:
length in interface java.sql.Clob
Throws:
java.sql.SQLException
See Also:
Clob.length()

position

public long position(java.sql.Clob searchstr,
                     long start)
              throws java.sql.SQLException
Specified by:
position in interface java.sql.Clob
Throws:
java.sql.SQLException
See Also:
Clob.position(java.sql.Clob, long)

position

public long position(java.lang.String searchstr,
                     long start)
              throws java.sql.SQLException
Specified by:
position in interface java.sql.Clob
Throws:
java.sql.SQLException
See Also:
Clob.position(java.lang.String, long)

setAsciiStream

public java.io.OutputStream setAsciiStream(long pos)
                                    throws java.sql.SQLException
Specified by:
setAsciiStream in interface java.sql.Clob
Throws:
java.sql.SQLException
See Also:
Clob.setAsciiStream(long)

setCharacterStream

public java.io.Writer setCharacterStream(long pos)
                                  throws java.sql.SQLException
Specified by:
setCharacterStream in interface java.sql.Clob
Throws:
java.sql.SQLException
See Also:
Clob.setCharacterStream(long)

setString

public int setString(long pos,
                     java.lang.String str,
                     int offset,
                     int len)
              throws java.sql.SQLException
Specified by:
setString in interface java.sql.Clob
Throws:
java.sql.SQLException
See Also:
Clob.setString(long, java.lang.String, int, int)

setString

public int setString(long pos,
                     java.lang.String str)
              throws java.sql.SQLException
Specified by:
setString in interface java.sql.Clob
Throws:
java.sql.SQLException
See Also:
Clob.setString(long, java.lang.String)

truncate

public void truncate(long len)
              throws java.sql.SQLException
Specified by:
truncate in interface java.sql.Clob
Throws:
java.sql.SQLException
See Also:
Clob.truncate(long)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getString

public static java.lang.String getString(java.sql.Clob clob)
                                  throws java.sql.SQLException,
                                         java.io.IOException
Utility method to convert to String

Parameters:
clob -
Returns:
string form of the clob passed.
Throws:
java.sql.SQLException
java.io.IOException

getCharSequence

public java.lang.CharSequence getCharSequence()
Specified by:
getCharSequence in interface Sequencable

free

public void free()
          throws java.sql.SQLException
Specified by:
free in interface java.sql.Clob
Throws:
java.sql.SQLException

getCharacterStream

public java.io.Reader getCharacterStream(long pos,
                                         long length)
                                  throws java.sql.SQLException
Specified by:
getCharacterStream in interface java.sql.Clob
Throws:
java.sql.SQLException


Copyright © 2009. All Rights Reserved.