oracle.sql
Class CLOB

java.lang.Object
  |
  +--oracle.sql.Datum
        |
        +--oracle.sql.CLOB

public class CLOB
extends Datum
implements oracle.jdbc2.Clob


Field Summary
static int MAX_CHUNK_SIZE
           
 
Method Summary
static CLOB empty_lob()
          Return a empty lob.
 java.io.OutputStream getAsciiOutputStream()
          Oracle extension.
 java.io.InputStream getAsciiStream()
          Implements the Clob interface method.
 int getBufferSize()
          Oracle extension.
 java.io.Writer getCharacterOutputStream()
          Oracle extension.
 java.io.Reader getCharacterStream()
          Implements the Clob interface method.
 int getChars(long pos, int length, char[] buffer)
          Oracle extension.
 int getChunkSize()
          Oracle extension.
 OracleConnection getConnection()
          Oracle extension.
 java.lang.String getSubString(long pos, int length)
          Implements the Clob interface method.
 boolean isConvertibleTo(java.lang.Class jClass)
          Test whether this data object can be converted to the specified Java data type.
 boolean isEmptyLob()
           
 long length()
          Implements the Clob interface method.
 long position(oracle.jdbc2.Clob searchstr, long start)
          Implements the Clob interface method.
 long position(java.lang.String searchstr, long start)
          Implements the Clob interface method.
 int putChars(long pos, char[] chars)
          Oracle extension.
 int putString(long pos, java.lang.String str)
          Oracle extension.
 java.lang.Object toJdbc()
          Convert this data object into its default Java object type.
 
Methods inherited from class oracle.sql.Datum
asciiStreamValue, bigDecimalValue, binaryStreamValue, booleanValue, byteValue, characterStreamValue, dateValue, doubleValue, equals, floatValue, getBytes, getLength, getStream, intValue, longValue, makeJdbcArray, setBytes, setShareBytes, shareBytes, stringValue, timestampValue, timeValue
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_CHUNK_SIZE

public static final int MAX_CHUNK_SIZE
Method Detail

length

public long length()
            throws java.sql.SQLException
Implements the Clob interface method. Returns the number of characters in the CLOB value designated by this Clob object.
Specified by:
length in interface oracle.jdbc2.Clob
Returns:
length of the CLOB in characters
Throws:
java.sql.SQLException - if there is an error accessing the length of the CLOB

getSubString

public java.lang.String getSubString(long pos,
                                     int length)
                              throws java.sql.SQLException
Implements the Clob interface method. 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 oracle.jdbc2.Clob
Parameters:
pos - the first character of the substring to be extracted. The first character is at position 1.
length - the number of consecutive characters to be copied
Returns:
a String that is the specified substring in the CLOB value designated by this Clob ob ject
Throws:
java.sql.SQLException - if there is an error accessing the CLOB

getCharacterStream

public java.io.Reader getCharacterStream()
                                  throws java.sql.SQLException
Implements the Clob interface method. Gets the Clob contents as a Unicode stream.
Specified by:
getCharacterStream in interface oracle.jdbc2.Clob
Returns:
a Unicode stream containing the CLOB data
Throws:
java.sql.SQLException - if there is an error accessing the CLOB

getAsciiStream

public java.io.InputStream getAsciiStream()
                                   throws java.sql.SQLException
Implements the Clob interface method. Gets the CLOB value designated by this Clob object as a stream of Ascii bytes.
Specified by:
getAsciiStream in interface oracle.jdbc2.Clob
Returns:
an ascii stream containing the CLOB data
Throws:
java.sql.SQLException - if there is an error accessing the CLOB value

position

public long position(java.lang.String searchstr,
                     long start)
              throws java.sql.SQLException
Implements the Clob interface method. Determine the character position at which the given substring
Specified by:
position in interface oracle.jdbc2.Clob
Parameters:
searchstr - is the substring to search for.
start - is the position at which to begin searching.
Returns:
the position at which the substring appears, else -1.

position

public long position(oracle.jdbc2.Clob searchstr,
                     long start)
              throws java.sql.SQLException
Implements the Clob interface method. Determine the character position at which the given substring
Specified by:
position in interface oracle.jdbc2.Clob
Parameters:
searchstr - is the substring to search for.
start - is the position at which to begin searching.
Returns:
the position at which the substring appears, else -1.

getChars

public int getChars(long pos,
                    int length,
                    char[] buffer)
             throws java.sql.SQLException
Oracle extension. Return copy of the substring of the CLOB at the requested position.
Parameters:
buffer - is the buffer into whcih the characters are read.
pos - is the first character of the substring to be extracted.
length - is the number of consecutive character to be copied.
Returns:
the actual number of characters read.

getCharacterOutputStream

public java.io.Writer getCharacterOutputStream()
                                        throws java.sql.SQLException
Oracle extension. Write Unicode stream to the CLOB.
Returns:
a Unicode character output stream.

getAsciiOutputStream

public java.io.OutputStream getAsciiOutputStream()
                                          throws java.sql.SQLException
Oracle extension. Write ascii stream to the CLOB.
Returns:
a ascii output stream.

getConnection

public OracleConnection getConnection()
                               throws java.sql.SQLException
Oracle extension. Get connection object.

putChars

public int putChars(long pos,
                    char[] chars)
             throws java.sql.SQLException
Oracle extension. Write characters at the requested position.
Parameters:
pos - is the position to write characters.
chars - is the buffer of characters to be written.
Returns:
the actual number of characters written.

putString

public int putString(long pos,
                     java.lang.String str)
              throws java.sql.SQLException
Oracle extension. Write Java string at the requested position.
Parameters:
pos - is the position to write characters.
str - is the Java string to be written.
Returns:
the actual number of characters written.

getChunkSize

public int getChunkSize()
                 throws java.sql.SQLException
Oracle extension. Get database LOB storage chunk size.
Returns:
the size in terms of characters.

getBufferSize

public int getBufferSize()
                  throws java.sql.SQLException
Oracle extension. Get ideal LOB db access buffer size.
Returns:
the size in terms of characters.

empty_lob

public static CLOB empty_lob()
                      throws java.sql.SQLException
Return a empty lob. An empty lob is used initialize a LOB column/attribute. Note: an empty lob can not be read or written
Returns:
a empty lob
Since:
8.1.7

isEmptyLob

public boolean isEmptyLob()
                   throws java.sql.SQLException

toJdbc

public java.lang.Object toJdbc()
                        throws java.sql.SQLException
Convert this data object into its default Java object type.
Returns:
this object.
Throws:
java.sql.SQLException - if any of the lower layer code throws an exception.
Overrides:
toJdbc in class Datum

isConvertibleTo

public boolean isConvertibleTo(java.lang.Class jClass)
Test whether this data object can be converted to the specified Java data type.
Parameters:
jClass - specifies the Java data type to test against.
Returns:
true if this data object is convertible to the specified Java class, and a corresponding xxxValue() method is available; otherwise, a false is returned.
Overrides:
isConvertibleTo in class Datum