© 2005 BEA Systems, Inc.

com.bea.p13n.util.jdbc
Class WlsOracleJDriverDatabase

java.lang.Object
  extended bycom.bea.p13n.util.jdbc.GenericDatabase
      extended bycom.bea.p13n.util.jdbc.OracleDatabase
          extended bycom.bea.p13n.util.jdbc.WlsOracleJDriverDatabase
All Implemented Interfaces:
Database

public class WlsOracleJDriverDatabase
extends OracleDatabase

Concrete implementation of OracleDatabase that provides support for reading/writing of BLOB/CLOB data. Designed to work with Weblogic JDriver for Oracle JDBC driver.

See Also:
OracleDatabase

Constructor Summary
WlsOracleJDriverDatabase(Connection connection)
           
 
Method Summary
 boolean commitConnection(Connection connection)
           
 byte[] getBlob(ResultSet rs, int index)
          Retrieve Blob value and write to an InputStream from a ResultSet.
 OutputStream getBlobLocator(Connection con, String tableName, String blobColumnName, String whereClause)
          Gets the BlobLocator object inside an Oracle database column.
 String getClob(ResultSet rs, int index)
          Retrieve CLOB value as a String of Unicode characters.
 String getName()
          The name of this GenericDatabase instance.
 void insertClob(ClobKey key, String data)
          Inserts a CLOB into the database managed tables for CLOB persistence
 String readClob(ClobKey key)
          Reads a CLOB into the database managed tables for CLOB persistence
 void removeClob(ClobKey key)
          Removes a CLOB from the database managed tables for CLOB persistence
 void updateClob(ClobKey key, String data)
          Updates a CLOB in the database managed tables for CLOB persistence
 void writeToClob(Clob clob, String data)
          Writes the data from the String into the Clob.
 
Methods inherited from class com.bea.p13n.util.jdbc.OracleDatabase
getClobLocator, getClobLocatorForAdBucket, getEmptyBlobInitializer, getEmptyClobInitializer, setClob, trimClob
 
Methods inherited from class com.bea.p13n.util.jdbc.GenericDatabase
accept, close, close, close, close, close, close, close, close, close, createPreparedStatement, endBlob, endClob, getApplicationName, getClobTableName, getConnection, getProperty, printSqlWarning, readFromClob, readFromClob, setClob, startBlob, startClob, writeToClob
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WlsOracleJDriverDatabase

public WlsOracleJDriverDatabase(Connection connection)
Method Detail

commitConnection

public boolean commitConnection(Connection connection)
                         throws SQLException
Specified by:
commitConnection in interface Database
Overrides:
commitConnection in class GenericDatabase
Throws:
SQLException

getBlob

public byte[] getBlob(ResultSet rs,
                      int index)
               throws SQLException
Retrieve Blob value and write to an InputStream from a ResultSet.

Specified by:
getBlob in interface Database
Overrides:
getBlob in class GenericDatabase
Parameters:
rs - The ResultSet containing the Blob.
index - The position of the Blob in the ResultSet.
Returns:
An InputStream containing the binary value of the Blob.
Throws:
SQLException - on an error

getBlobLocator

public OutputStream getBlobLocator(Connection con,
                                   String tableName,
                                   String blobColumnName,
                                   String whereClause)
                            throws SQLException
Gets the BlobLocator object inside an Oracle database column.

Specified by:
getBlobLocator in interface Database
Overrides:
getBlobLocator in class GenericDatabase
Returns:
OutputStream An OutputStream pointing to the BlobLocator.
Throws:
SQLException - on an error.

getClob

public String getClob(ResultSet rs,
                      int index)
               throws SQLException
Retrieve CLOB value as a String of Unicode characters.

Specified by:
getClob in interface Database
Overrides:
getClob in class GenericDatabase
Parameters:
rs - the resultset containing the clob
index - the position of the clob in the resultset
Returns:
the value of the CLOB as a String.
Throws:
SQLException - on an error
See Also:
getClob(ResultSet rs, int index)

getName

public String getName()
Description copied from class: GenericDatabase
The name of this GenericDatabase instance.

Specified by:
getName in interface Database
Overrides:
getName in class GenericDatabase
Returns:
the name of the database

insertClob

public void insertClob(ClobKey key,
                       String data)
                throws SQLException
Inserts a CLOB into the database managed tables for CLOB persistence

Throws:
SQLException

readClob

public String readClob(ClobKey key)
                throws SQLException
Reads a CLOB into the database managed tables for CLOB persistence

Throws:
SQLException

removeClob

public void removeClob(ClobKey key)
                throws SQLException
Removes a CLOB from the database managed tables for CLOB persistence

Throws:
SQLException

updateClob

public void updateClob(ClobKey key,
                       String data)
                throws SQLException
Updates a CLOB in the database managed tables for CLOB persistence

Overrides:
updateClob in class OracleDatabase
Throws:
SQLException

writeToClob

public void writeToClob(Clob clob,
                        String data)
                 throws SQLException
Writes the data from the String into the Clob.

Specified by:
writeToClob in interface Database
Overrides:
writeToClob in class GenericDatabase
Parameters:
clob - The target Clob object.
data - The data to be converted to a Clob in the form of a String.
Throws:
SQLException - Thrown because this is an unsupported operation.

© 2005 BEA Systems, Inc.

Copyright © 2005 BEA Systems, Inc. All Rights Reserved