org.brains2b.data.sql.lob
Class ClobImpl

java.lang.Object
  extended by org.brains2b.data.sql.lob.ClobImpl
All Implemented Interfaces:
java.sql.Clob

public class ClobImpl
extends java.lang.Object
implements java.sql.Clob

Implementation of Clob to access Clob's independently of the underlying database

This ColbImpl can both be used to create new Clobs and be a wrapper around a Clob provided by a database. The wrapper is needed because not all Database implementations have different ways on which one can interact with the Clob

Version:
0.90 [21-03-2008]
Author:
dennis@brains2b.nl
See Also:
LobCache

Constructor Summary
ClobImpl()
           
ClobImpl(java.sql.Clob blob)
           
 
Method Summary
 java.io.InputStream getAsciiStream()
           
 java.io.Reader getCharacterStream()
           
 java.lang.String getSubString(long pos, int length)
           
 int hashCode()
           
 long length()
           
 long position(java.sql.Clob pattern, long start)
           
 long position(java.lang.String pattern, 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 java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClobImpl

public ClobImpl()

ClobImpl

public ClobImpl(java.sql.Clob blob)
Method Detail

getAsciiStream

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

getCharacterStream

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

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

length

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

position

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

position

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

setCharacterStream

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

setAsciiStream

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

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

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

truncate

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

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object