com.northgateis.reality.realsql
Class RealSQLClob

java.lang.Object
 |
 +--com.northgateis.reality.realsql.RealSQLClob

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

Implements the JDBC 2.0 Clob interface.


Constructor Summary
RealSQLClob()
          Constructs a new Clob from the specified byte array.
 
Method Summary
 java.io.InputStreamgetAsciiStream()
           
 java.io.ReadergetCharacterStream()
           
 java.lang.StringgetSubString(long pos, int len)
          Returns a copy of the specified substring in the CLOB value designated by this Clob object.
 longlength()
           
 longposition(java.sql.Clob pattern, long start)
          Determines the character position at which the specified Clob object searchstr appears in this Clob object.
 longposition(java.lang.String pattern, long start)
          Determines the character position at which the specified substring searchstr appears in the CLOB.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RealSQLClob

public RealSQLClob()
Constructs a new Clob from the specified byte array.
Parameters:
b - the array of bytes this Clob represents
Method Detail

getAsciiStream

public java.io.InputStream getAsciiStream()
 throws java.sql.SQLException
Specified by:
getAsciiStream in interface java.sql.Clob
Returns:
the Clob as an InputStream
Throws:
java.sql.SQLException - could not construct the input stream

getCharacterStream

public java.io.Reader getCharacterStream()
 throws java.sql.SQLException
Specified by:
getCharacterStream in interface java.sql.Clob
Returns:
the Clob as an Reader
Throws:
java.sql.SQLException - could not construct the input stream

getSubString

public java.lang.String getSubString(long pos,
 int len)
 throws java.sql.SQLException
Returns a copy of the specified substring in the CLOB value designated by this Clob object. The substring begins at position pos and has up to length consecutive characters.
Specified by:
getSubString in interface java.sql.Clob
Parameters:
pos - the start position
len - the length of the desired return array
Returns:
a String that is the specified substring in the CLOB value designated by this Clob object
Throws:
java.sql.SQLException -  

length

public long length()
 throws java.sql.SQLException
Specified by:
length in interface java.sql.Clob
Returns:
the number of bytes in this Clob
Throws:
java.sql.SQLException -  

position

public long position(java.sql.Clob pattern,
 long start)
 throws java.sql.SQLException
Determines the character position at which the specified Clob object searchstr appears in this Clob object. The search begins at position start.
Specified by:
position in interface java.sql.Clob
Parameters:
pattern - a Clob representing the desired pattern
start - the index from which to start the search measured from 1
Returns:
the index of the first occurrence of the specified pattern or -1 if the pattern does not occur
Throws:
java.sql.SQLException -  

position

public long position(java.lang.String pattern,
 long start)
 throws java.sql.SQLException
Determines the character position at which the specified substring searchstr appears in the CLOB. The search begins at position start.
Specified by:
position in interface java.sql.Clob
Parameters:
pattern - a byte array representing the desired pattern
start - the index from which to start the search measured from 1
Returns:
the index of the first occurrence of the specified pattern or -1 if the pattern does not occur
Throws:
java.sql.SQLException -