Class ClobImpl

java.lang.Object
org.exolab.castor.jdo.engine.ClobImpl
All Implemented Interfaces:
Clob

public class ClobImpl extends Object implements Clob
This is an implementation of java.sql.Clob interface that is constructed from java.io.Reader, in needs information about the length of the stream (which is not provided by java.io.Reader interface).

It is useful for setting CLOB values in the database.

Note: This implementation does not attempt to implement features of JDBC3 or JDBC4.

Version:
$Revision: 7121 $
Author:
Oleg Nitz, Adam Esterline
  • Constructor Details

    • ClobImpl

      public ClobImpl(Reader reader, long length)
      Construct an ClobImpl instance.
      Examples:
      new ClobImpl(new StringReader(str), str.length())
      new ClobImpl(new FileReader(file), file.length())
  • Method Details

    • getAsciiStream

      public InputStream getAsciiStream()
      Specified by:
      getAsciiStream in interface Clob
    • getCharacterStream

      public Reader getCharacterStream()
      Specified by:
      getCharacterStream in interface Clob
    • length

      public long length()
      Specified by:
      length in interface Clob
    • getSubString

      public String getSubString(long pos, int length) throws SQLException
      Specified by:
      getSubString in interface Clob
      Throws:
      SQLException
    • position

      public long position(Clob searchstr, long start)
      Not implemented, I guess it is not needed for writing CLOB.
      Specified by:
      position in interface Clob
    • position

      public long position(String searchstr, long start)
      Not implemented, I guess it is not needed for writing CLOB.
      Specified by:
      position in interface Clob
    • setAsciiStream

      public OutputStream setAsciiStream(long pos) throws SQLException
      Not implemented. Added to make ClobImpl compliant with JDBC 3.0, which is a part of JDK1.4.
      Specified by:
      setAsciiStream in interface Clob
      Throws:
      SQLException
    • setCharacterStream

      public Writer setCharacterStream(long pos) throws SQLException
      Not implemented. Added to make ClobImpl compliant with JDBC 3.0, which is a part of JDK1.4.
      Specified by:
      setCharacterStream in interface Clob
      Throws:
      SQLException
    • setString

      public int setString(long pos, String str) throws SQLException
      Not implemented. Added to make ClobImpl compliant with JDBC 3.0, which is a part of JDK1.4.
      Specified by:
      setString in interface Clob
      Throws:
      SQLException
    • setString

      public int setString(long pos, String str, int offset, int len) throws SQLException
      Not implemented. Added to make ClobImpl compliant with JDBC 3.0, which is a part of JDK1.4.
      Specified by:
      setString in interface Clob
      Throws:
      SQLException
    • truncate

      public void truncate(long len) throws SQLException
      Not implemented. Added to make ClobImpl compliant with JDBC 3.0, which is a part of JDK1.4.
      Specified by:
      truncate in interface Clob
      Throws:
      SQLException
    • getCharacterStream

      public Reader getCharacterStream(long pos, long length)
      Not implemented. Added to make ClobImpl compliant with JDBC 4.0, which is a part of JDK6.
      Specified by:
      getCharacterStream in interface Clob
    • free

      public void free()
      Not implemented. Added to make ClobImpl compliant with JDBC 4.0, which is a part of JDK6.
      Specified by:
      free in interface Clob