org.exolab.castor.jdo.engine
Class ClobImpl

java.lang.Object
  extended by org.exolab.castor.jdo.engine.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.

Version:
$Revision: 1.3 $
Author:
Oleg Nitz

Constructor Summary
ClobImpl(java.io.Reader reader, long length)
          Examples:
new ClobImpl(new StringReader(str), str.length())
new ClobImpl(new FileReader(file), file.length())
 
Method Summary
 java.io.InputStream getAsciiStream()
           
 java.io.Reader getCharacterStream()
           
 java.lang.String getSubString(long pos, int length)
           
 long length()
           
 long position(java.sql.Clob searchstr, long start)
          Not implemented, I guess it is not needed for writing CLOB
 long position(java.lang.String 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)
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 complient with JDBC 3.0, which is apart 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 complient with JDBC 3.0, which is apart 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 complient with JDBC 3.0, which is apart 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 complient with JDBC 3.0, which is apart 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 complient with JDBC 3.0, which is apart of JDK1.4

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


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com