jxDBCon 0.9z

org.sourceforge.jxdbcon
Class AbstractClob

java.lang.Object
  |
  +--org.sourceforge.jxdbcon.AbstractClob
All Implemented Interfaces:
Clob

public abstract class AbstractClob
extends Object
implements Clob

AbstractClob implements generics of the Clob interface. It defines the (get|set)(Ascii|Character)Stream accessor functions which delegate their work to the getSubString|setString functions.
When extending this class, You still have to define:

TODO:

Version:
$Revision: 1.7 $, $Date: 2002/03/16 01:26:07 $
Author:
Keve Müller

Constructor Summary
AbstractClob()
           
 
Method Summary
 InputStream getAsciiStream()
          Gets the CLOB value designated by this Clob object as a stream of Ascii bytes.
 Reader getCharacterStream()
          Gets the CLOB value designated by this Clob object as a Unicode stream.
private static void reThrow(SQLException ex)
           
 OutputStream setAsciiStream(long opos)
          Returns a stream to be used to write Ascii characters to the CLOB value that this Clob designates, starting at position pos.
 Writer setCharacterStream(long opos)
          Returns a stream to be used to write a stream of Unicode characters to the CLOB value that this Clob designates, at position pos.
abstract  int setString(long pos, String string)
          Writes len characters of str, starting at character offset, to the CLOB value that this Clob represents.
 int setString(long pos, String str, int offset, int len)
          Writes len characters of str, starting at character offset, to the CLOB value that this Clob designates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.sql.Clob
getSubString, length, position, position, truncate
 

Constructor Detail

AbstractClob

public AbstractClob()
Method Detail

getAsciiStream

public InputStream getAsciiStream()
                           throws SQLException
Gets the CLOB value designated by this Clob object as a stream of Ascii bytes.

Specified by:
getAsciiStream in interface Clob
Returns:
a java.io.InputStream object containing the CLOB data
Throws:
SQLException - if there is an error accessing the CLOB value.
See Also:
Clob.length(), Clob.getSubString(long,int)

getCharacterStream

public Reader getCharacterStream()
                          throws SQLException
Gets the CLOB value designated by this Clob object as a Unicode stream. This implementation creates an instance of BufferedReader which delegates to the corresponding functions of this class.

Specified by:
getCharacterStream in interface Clob
Returns:
a java.io.Reader object containing the CLOB data
Throws:
SQLException - if there is an error accessing the CLOB value
See Also:
Clob.length(), Clob.getSubString(long,int)

reThrow

private static final void reThrow(SQLException ex)
                           throws IOException
IOException

setAsciiStream

public OutputStream setAsciiStream(long opos)
                            throws SQLException
Returns a stream to be used to write Ascii characters to the CLOB value that this Clob designates, starting at position pos. This implementation creates an instance of BufferedOutputStream which delegates to the corresponding functions of this class.

Specified by:
setAsciiStream in interface Clob
SQLException
See Also:
setString(long,String)

setCharacterStream

public Writer setCharacterStream(long opos)
                          throws SQLException
Returns a stream to be used to write a stream of Unicode characters to the CLOB value that this Clob designates, at position pos. This implementation creates an instance of BufferedWriter which delegates to the corresponding functions of this class.

Specified by:
setCharacterStream in interface Clob
SQLException
See Also:
setString(long,String)

setString

public abstract int setString(long pos,
                              String string)
                       throws SQLException
Writes len characters of str, starting at character offset, to the CLOB value that this Clob represents.

Specified by:
setString in interface Clob
Parameters:
pos - the position at which to start writing to this CLOB object
string - the string to be written to the CLOB value that this Clob object represents
Returns:
the number of characters written
Throws:
SQLException - if there is an error accessing the CLOB value.

setString

public int setString(long pos,
                     String str,
                     int offset,
                     int len)
              throws SQLException
Writes len characters of str, starting at character offset, to the CLOB value that this Clob designates.

Specified by:
setString in interface Clob
SQLException
See Also:
setString(long,String)

jxDBCon 0.9z

Copyright © 2001,2002 Keve Müller; see LICENSE file for details.