com.metamatrix.common.types
Class ClobType

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

public final class ClobType
extends Streamable<java.sql.Clob>
implements 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 class com.metamatrix.common.types.Streamable
FORCE_STREAMING, reference, STREAMING_BATCH_SIZE_IN_BYTES
 
Constructor Summary
ClobType(java.sql.Clob clob)
           
 
Method Summary
static javax.sql.rowset.serial.SerialClob createClob(char[] chars)
           
 void free()
           
 java.io.InputStream getAsciiStream()
           
 java.io.Reader getCharacterStream()
           
 java.io.Reader getCharacterStream(long pos, long length)
           
 java.lang.CharSequence getCharSequence()
           
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)
           
 int setString(long pos, java.lang.String str)
           
 int setString(long pos, java.lang.String str, int offset, int len)
           
 void truncate(long len)
           
 
Methods inherited from class com.metamatrix.common.types.Streamable
equals, getPersistenceStreamId, getReference, getReferenceStreamId, setPersistenceStreamId, setReference, setReferenceStreamId, toString
 
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

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)

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

createClob

public static javax.sql.rowset.serial.SerialClob createClob(char[] chars)


Copyright © 2009. All Rights Reserved.