Oracle9i Business Components for Java Oracle Domains API Reference
Oracle9i Jdeveloper (9.0.4)
B10392-01


oracle.jbo.domain
Class ClobDomain

java.lang.Object
  |
  +--oracle.jbo.domain.BaseLobDomain
        |
        +--oracle.jbo.domain.ClobDomain
All Implemented Interfaces:
java.io.Serializable

public class ClobDomain
extends BaseLobDomain
implements java.io.Serializable

This class provides a lightweight wrapper for oracle.sql.Clob, the Java representation of the CLOB database type. This wrapper allows an instance of the oracle.sql.Clob to be used as a domain object.

Since:
JDeveloper 3.0
See Also:
Serialized Form

Constructor Summary
ClobDomain()
          Constructor for this class.
ClobDomain(byte[] data)
          Constructs an instance of this class, given a byte array.
ClobDomain(CLOB clob, byte[] clobData)
          Internal: Applications should not use this constructor.
ClobDomain(java.lang.String str)
          Constructs an instance of this class, given a string.

 

Method Summary
static CLOB createEmptyCLOB(java.lang.Object context)
          Creates an empty CLOB object.
 boolean equals(java.lang.Object obj)
          Converts all the data into a String and compares the two strings.
 java.io.OutputStream getAsciiOutputStream()
          Write ascii stream to the CLOB.
 java.io.InputStream getAsciiStream()
          Gets the CLOB value designated by this Clob object as a stream of Ascii bytes.
 int getBufferSize()
          Get ideal LOB db access buffer size.
 java.io.Writer getCharacterOutputStream()
          Returns a Writer for Unicode stream to the CLOB that uses the default character encoding.
 java.io.Writer getCharacterOutputStream(java.lang.String enc)
          Returns a Writer for Unicode stream to the CLOB that uses the named character encoding
 java.io.Reader getCharacterStream()
          Gets the Clob contents as a Unicode stream that uses the default character encoding.
 java.io.Reader getCharacterStream(java.lang.String enc)
          Gets the Clob contents as a Unicode stream that uses the named character encoding.
 long getLength()
          Returns the number of characters in the CLOB value designated by this Clob object.
 java.lang.String getSubString(long offset, int length)
          Returns a copy of the specified substring in the CLOB value designated by this Clob object.
static XMLDomainFactory getXMLDomainFactory(java.lang.Class attrClass)
          Internal: Applications should not use this method.
 void prepareForDML(java.lang.Object context)
          Internal: Applications should not use this method.
 void useCLOB(CLOB newClob)
          Internal: Applications should not use this method.

 

Methods inherited from class oracle.jbo.domain.BaseLobDomain
closeOutputStream, getData, getInputStream, getInvokeDomainMethod, getOutputStream, getOwner, getOwnerAttributeIndex, getOwnerRow, getRemoteBufferSize, getRemoteIdString, getRemoteLength, getSize, getStorageByteArray, isCacheDataModified, loadFromDatabase, marshal, resetCachedData, saveToDatabase, saveToDatabase, setBytes, setContext, syncClientLob, syncServerLob, toByteArray, toDatum, toString

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Constructor Detail

ClobDomain

public ClobDomain()
Constructor for this class.

ClobDomain

public ClobDomain(java.lang.String str)
Constructs an instance of this class, given a string.

ClobDomain

public ClobDomain(byte[] data)
Constructs an instance of this class, given a byte array.

ClobDomain

public ClobDomain(CLOB clob,
                  byte[] clobData)
Internal: Applications should not use this constructor.

Creates an instance of this class with data as described in clobData and using the transaction context from clob to use the CLOB locator in the database.

Parameters:
clob - name of the CLOB to use as a ClobDomain.
clobData - data to fill the CLOB.
Method Detail

useCLOB

public void useCLOB(CLOB newClob)
Internal: Applications should not use this method.

If this object does not have a transaction context, shares the transaction and CLOB locator from newClob.

Parameters:
newClob - name of the CLOB with which this CLOB will share its transaction and CLOB locator information.

prepareForDML

public void prepareForDML(java.lang.Object context)
Internal: Applications should not use this method.
Overrides:
prepareForDML in class BaseLobDomain

equals

public boolean equals(java.lang.Object obj)
Converts all the data into a String and compares the two strings. This is a default implementation of equals which could be overridden to perform more scalable application-specific comparision.
Overrides:
equals in class BaseLobDomain
Parameters:
obj - the object to compare to this ClobDomain.

getXMLDomainFactory

public static XMLDomainFactory getXMLDomainFactory(java.lang.Class attrClass)
Internal: Applications should not use this method.

createEmptyCLOB

public static CLOB createEmptyCLOB(java.lang.Object context)
Creates an empty CLOB object.
Parameters:
context - an internal framework context.

getSubString

public java.lang.String getSubString(long offset,
                                     int length)
Returns a copy of the specified substring in the CLOB value designated by this Clob object. The substring begins at position offset and has up to length consecutive characters.

For new ClobDomain instances, this method returns the byte-length of the buffer storing the ClobDomain data. to get substring applications may call toString() on the clob domain and use String apis to manage substrings.

Parameters:
offset - 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

getAsciiOutputStream

public java.io.OutputStream getAsciiOutputStream()
Write ascii stream to the CLOB.
Returns:
a ascii output stream.

getAsciiStream

public java.io.InputStream getAsciiStream()
Gets the CLOB value designated by this Clob object as a stream of Ascii bytes.
Returns:
an ascii stream containing the CLOB data CLOB value

getCharacterOutputStream

public java.io.Writer getCharacterOutputStream()
Returns a Writer for Unicode stream to the CLOB that uses the default character encoding.
Returns:
a Unicode character output stream.

getCharacterOutputStream

public java.io.Writer getCharacterOutputStream(java.lang.String enc)
Returns a Writer for Unicode stream to the CLOB that uses the named character encoding
Returns:
a Unicode character output stream.

getCharacterStream

public java.io.Reader getCharacterStream()
Gets the Clob contents as a Unicode stream that uses the default character encoding.
Returns:
a Unicode stream containing the CLOB data
Throws:
java.sql.SQLException - if there is an error accessing the CLOB

getCharacterStream

public java.io.Reader getCharacterStream(java.lang.String enc)
Gets the Clob contents as a Unicode stream that uses the named character encoding.
Returns:
a Unicode stream containing the CLOB data
Throws:
java.sql.SQLException - if there is an error accessing the CLOB

getLength

public long getLength()
Returns the number of characters in the CLOB value designated by this Clob object.

For new ClobDomain instances (which is not posted yet), this method returns the byte-length of the buffer in which clob data is stored. To get the character size in these cases, applications may convert the data to String (call ClobDomain.toString()) and get its length.

Overrides:
getLength in class BaseLobDomain
Returns:
length of the CLOB in characters

getBufferSize

public int getBufferSize()
Get ideal LOB db access buffer size.
Returns:
the size in terms of characters.

Oracle9i Business Components for Java Oracle Domains API Reference
Oracle9i Jdeveloper (9.0.4)
B10392-01


 

Copyright © 1997, 2003, Oracle. All rights reserved.