com.caucho.db.sql
Class ClobImpl

java.lang.Object
  extended by com.caucho.db.sql.ClobImpl
All Implemented Interfaces:
java.sql.Clob

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

The JDBC clob implementation.


Method Summary
 void free()
           
 java.io.InputStream getAsciiStream()
          Returns the clob as a stream.
 java.io.Reader getCharacterStream()
          Returns a subset of the bytes.
 java.io.Reader getCharacterStream(long pos, long length)
           
 java.lang.String getSubString(long pos, int length)
          Returns a copy of the specified substring.
 long length()
          Returns the length of the clob
 long position(java.sql.Clob pattern, long start)
          Returns the position in the clob where the pattern starts.
 long position(java.lang.String pattern, long start)
          Returns the position in the clob where the pattern starts.
 java.io.OutputStream setAsciiStream(long pos)
          Returns a stream to write to the clob.
 java.io.Writer setCharacterStream(long pos)
          Returns a stream to write to the clob.
 int setString(long pos, java.lang.String string)
          Sets a subset of bytes.
 int setString(long pos, java.lang.String string, int offset, int len)
          Sets a subset of bytes.
 java.lang.String toString()
           
 void truncate(long length)
          Truncates the clob
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getAsciiStream

public java.io.InputStream getAsciiStream()
                                   throws java.sql.SQLException
Returns the clob as a stream.

Specified by:
getAsciiStream in interface java.sql.Clob
Throws:
java.sql.SQLException

getCharacterStream

public java.io.Reader getCharacterStream()
                                  throws java.sql.SQLException
Returns a subset of the bytes.

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
Returns a copy of the specified substring.

Specified by:
getSubString in interface java.sql.Clob
Throws:
java.sql.SQLException

length

public long length()
            throws java.sql.SQLException
Returns the length of the clob

Specified by:
length in interface java.sql.Clob
Throws:
java.sql.SQLException

position

public long position(java.sql.Clob pattern,
                     long start)
              throws java.sql.SQLException
Returns the position in the clob where the pattern starts.

Specified by:
position in interface java.sql.Clob
Throws:
java.sql.SQLException

position

public long position(java.lang.String pattern,
                     long start)
              throws java.sql.SQLException
Returns the position in the clob where the pattern starts.

Specified by:
position in interface java.sql.Clob
Throws:
java.sql.SQLException

setAsciiStream

public java.io.OutputStream setAsciiStream(long pos)
                                    throws java.sql.SQLException
Returns a stream to write to the clob.

Specified by:
setAsciiStream in interface java.sql.Clob
Throws:
java.sql.SQLException

setCharacterStream

public java.io.Writer setCharacterStream(long pos)
                                  throws java.sql.SQLException
Returns a stream to write to the clob.

Specified by:
setCharacterStream in interface java.sql.Clob
Throws:
java.sql.SQLException

setString

public int setString(long pos,
                     java.lang.String string)
              throws java.sql.SQLException
Sets a subset of bytes.

Specified by:
setString in interface java.sql.Clob
Throws:
java.sql.SQLException

setString

public int setString(long pos,
                     java.lang.String string,
                     int offset,
                     int len)
              throws java.sql.SQLException
Sets a subset of bytes.

Specified by:
setString in interface java.sql.Clob
Throws:
java.sql.SQLException

truncate

public void truncate(long length)
              throws java.sql.SQLException
Truncates the clob

Specified by:
truncate in interface java.sql.Clob
Throws:
java.sql.SQLException

toString

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

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