OracleThinDatabase Class

com.bea.p13n.util.jdbc
OracleThinDatabase Class

public class OracleThinDatabase

    extends OracleDatabase

Concrete implementation of OracleDatabase that provides support for reading/writing of BLOB/CLOB data. Designed to work with Oracle Thin driver when running outside an application server context.

Related Topics

OracleDatabase


Hierarchy
Object
  GenericDatabase
    OracleDatabase
      OracleThinDatabase
All Implemented Interfaces

Database

Constructor Summary

OracleThinDatabase(Connection connection)

 

Method Summary

public boolean
accept(Connection connection)
Check to see if the connection URL matches the format defined in "accept.driver.url.regex".
public byte[]
getBlob(ResultSet rs, int index)
Retrieve Blob value and write to an InputStream from a ResultSet.
public OutputStream
getBlobLocator(Connection con, String tableName, String blobColumnName, String whereClause)
Gets the BlobLocator object inside an Oracle database column.
public String
getClob(ResultSet rs, int index)
Retrieve CLOB value as a String of Unicode characters.
public String
getName()
The name of this GenericDatabase instance.
public void
writeToClob(Clob clob, String data)
Writes the data from the String into the Clob.
 
Methods from  com.bea.p13n.util.jdbc.OracleDatabase
getClobLocator, getEmptyBlobInitializer, getEmptyClobInitializer, setClob, trimClob, updateClob
 
Methods from  com.bea.p13n.util.jdbc.GenericDatabase
close, close, close, close, close, close, close, close, close, commitConnection, createPreparedStatement, endBlob, endClob, getApplicationName, getClobLocator, getClobTableName, getConnection, getEmptyBlobInitializer, getEmptyClobInitializer, getProperty, printSqlWarning, readFromClob, readFromClob, setClob, setClob, startBlob, startClob, writeToClob
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   
Methods from interface com.bea.p13n.util.jdbc.Database
accept, close, close, close, close, close, close, close, close, close, commitConnection, endBlob, endClob, getApplicationName, getBlob, getBlobLocator, getClob, getClobLocator, getConnection, getEmptyBlobInitializer, getEmptyClobInitializer, getName, readFromClob, setClob, setClob, startBlob, startClob, writeToClob
 

Constructor Detail

OracleThinDatabase

public OracleThinDatabase(Connection connection)
 

Method Detail

accept(Connection) Method

public boolean accept(Connection connection)
Description copied from GenericDatabase.accept(Connection)
Check to see if the connection URL matches the format defined in "accept.driver.url.regex".

Overrides
GenericDatabase.accept(Connection)

Parameters

connection
The Connection object that contains the URL.

Returns

true if this Database can bind to the supplied connection. Typically the Database will examine the Connection MetaData to determine suitability.

getBlob(ResultSet, int) Method

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

Overrides
GenericDatabase.getBlob(ResultSet, int)

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.

Exceptions

SQLException
on an error

getBlobLocator(Connection, String, String, String) Method

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

Overrides
GenericDatabase.getBlobLocator(Connection, String, String, String)

Returns

OutputStream An outputStream pointing to the BlobLocator.

Exceptions

SQLException
on an error.

getClob(ResultSet, int) Method

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

Overrides
GenericDatabase.getClob(ResultSet, int)

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.

Exceptions

SQLException
on an error

Related Topics

OracleThinDatabase.getClob(ResultSet, int)


getName() Method

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

Overrides
GenericDatabase.getName()

Returns

the name of the database

writeToClob(Clob, String) Method

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

Overrides
GenericDatabase.writeToClob(Clob, String)

Parameters

clob
The target Clob object.
data
The data to be converted to a Clob in the form of a String.

Exceptions

SQLException