Class ClobImpl

  • All Implemented Interfaces:
    java.sql.Clob

    public class ClobImpl
    extends java.lang.Object
    implements java.sql.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 Summary

      Constructors 
      Constructor Description
      ClobImpl​(java.io.Reader reader, long length)
      Construct an ClobImpl instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void free()
      Not implemented.
      java.io.InputStream getAsciiStream()  
      java.io.Reader getCharacterStream()  
      java.io.Reader getCharacterStream​(long pos, long length)
      Not implemented.
      java.lang.String getSubString​(long pos, int length)  
      long length()  
      long position​(java.lang.String searchstr, long start)
      Not implemented, I guess it is not needed for writing CLOB.
      long position​(java.sql.Clob searchstr, long start)
      Not implemented, I guess it is not needed for writing CLOB.
      java.io.OutputStream setAsciiStream​(long pos)
      Not implemented.
      java.io.Writer setCharacterStream​(long pos)
      Not implemented.
      int setString​(long pos, java.lang.String str)
      Not implemented.
      int setString​(long pos, java.lang.String str, int offset, int len)
      Not implemented.
      void truncate​(long len)
      Not implemented.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClobImpl

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

      • getAsciiStream

        public java.io.InputStream getAsciiStream()
        Specified by:
        getAsciiStream in interface java.sql.Clob
      • getCharacterStream

        public java.io.Reader getCharacterStream()
        Specified by:
        getCharacterStream in interface java.sql.Clob
      • length

        public long length()
        Specified by:
        length in interface java.sql.Clob
      • 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
      • position

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

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

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

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

        public int setString​(long pos,
                             java.lang.String str)
                      throws java.sql.SQLException
        Not implemented. Added to make ClobImpl compliant with JDBC 3.0, which is a part of JDK1.4.
        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
        Not implemented. Added to make ClobImpl compliant with JDBC 3.0, which is a part of JDK1.4.
        Specified by:
        setString in interface java.sql.Clob
        Throws:
        java.sql.SQLException
      • truncate

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

        public java.io.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 java.sql.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 java.sql.Clob