flux
Interface OracleLargeObjectAdapter

All Known Implementing Classes:
ApacheDbcpOracleAdapter, JBossOracleAdapter, OracleAdapter, TomcatOracleAdapter, WebLogicOracleAdapter, WebSphereOracleAdapter

public interface OracleLargeObjectAdapter

By default, standard JDBC APIs are used to persist large binary and character data to Oracle databases. Due to an Oracle limitation, standard JDBC cannot persist more than 4k bytes of data when communicating with an Oracle database. However, using an Oracle-specific API, it is possible to workaround this Oracle limitation.

The ORACLE_LARGE_OBJECT_ADAPTER configuration setting accepts the name of an adapter class that uses database-specific and driver-specific APIs to overcome this Oracle limitation. This adapter class must implement the flux.OracleLargeObjectAdapter interface.

Several adapter classes are provided by default. They can be used when the Oracle JDBC driver is used directly, when an application server driver wraps an Oracle driver, and when a database connection pool driver wraps an Oracle driver.

These default adapters work only when an Oracle driver, supplied by Oracle Corporation, is used directly or indirectly. The class names for these drivers can be found as constants in this interface.

You can also provide your own adapter. It must implement this interface. Your custom adapter can be used to support non-Oracle-Corporation drivers or other application servers that provide JDBC drivers that wrap Oracle JDBC drivers.

If you need to overcome this Oracle limitation in a situation where a built-in adapter is not available or you cannot create one, the workaround is to create a second data source in your application server that directly uses an Oracle JDBC driver supplied by Oracle Corporation. In this case, you can use the built-in adapter flux.OracleLargeObjectAdapter.ORACLE.

Author:
Copyright 2014 Flux Corporation. All rights reserved.

Field Summary
static java.lang.String APACHE_DBCP
          Built-in adapter that supports the Oracle 8, 9, and 10 JDBC drivers, supplied by Oracle Corporation, when wrapped by an Apache DBCP driver.
static java.lang.String JBOSS
          Built-in adapter that supports the Oracle 8, 9, and 10 JDBC drivers supplied by Oracle Corporation, when wrapped by a JBoss driver.
static java.lang.String ORACLE
          Built-in adapter that supports the Oracle 8, 9, and 10 JDBC drivers supplied by Oracle Corporation.
static java.lang.String TOMCAT
          Built-in adapter that supports the Oracle 8, 9, and 10 JDBC drivers, supplied by Oracle Corporation, when wrapped by a Tomcat driver.
static java.lang.String WEBLOGIC
          Built-in adapter that supports the Oracle 8, 9, and 10 JDBC drivers, supplied by Oracle Corporation, when wrapped by a WebLogic driver.
static java.lang.String WEBSPHERE
          Built-in adapter that supports the Oracle 8, 9, and 10 JDBC drivers, supplied by Oracle Corporation, when wrapped by a WebSphere driver.
 
Method Summary
 java.io.InputStream getBlobReader(java.sql.ResultSet resultSet, java.lang.String columnName)
          Returns a binary stream that can read large binary data from an Oracle BLOB database column.
 java.io.OutputStream getBlobWriter(java.sql.ResultSet resultSet, java.lang.String columnName)
          Returns a binary stream that can write large binary data from an Oracle BLOB database column.
 java.io.Reader getClobReader(java.sql.ResultSet resultSet, java.lang.String columnName)
          Returns a character stream that can read large binary data from an Oracle CLOB database column.
 java.io.Writer getClobWriter(java.sql.ResultSet resultSet, java.lang.String columnName)
          Returns a character stream that can write large binary data to an Oracle CLOB database column.
 

Field Detail

APACHE_DBCP

static final java.lang.String APACHE_DBCP
Built-in adapter that supports the Oracle 8, 9, and 10 JDBC drivers, supplied by Oracle Corporation, when wrapped by an Apache DBCP driver.

See Also:
Constant Field Values

JBOSS

static final java.lang.String JBOSS
Built-in adapter that supports the Oracle 8, 9, and 10 JDBC drivers supplied by Oracle Corporation, when wrapped by a JBoss driver.

See Also:
Constant Field Values

ORACLE

static final java.lang.String ORACLE
Built-in adapter that supports the Oracle 8, 9, and 10 JDBC drivers supplied by Oracle Corporation.

See Also:
Constant Field Values

TOMCAT

static final java.lang.String TOMCAT
Built-in adapter that supports the Oracle 8, 9, and 10 JDBC drivers, supplied by Oracle Corporation, when wrapped by a Tomcat driver.

See Also:
Constant Field Values

WEBLOGIC

static final java.lang.String WEBLOGIC
Built-in adapter that supports the Oracle 8, 9, and 10 JDBC drivers, supplied by Oracle Corporation, when wrapped by a WebLogic driver.

See Also:
Constant Field Values

WEBSPHERE

static final java.lang.String WEBSPHERE
Built-in adapter that supports the Oracle 8, 9, and 10 JDBC drivers, supplied by Oracle Corporation, when wrapped by a WebSphere driver.

See Also:
Constant Field Values
Method Detail

getBlobReader

java.io.InputStream getBlobReader(java.sql.ResultSet resultSet,
                                  java.lang.String columnName)
                                  throws java.lang.Exception
Returns a binary stream that can read large binary data from an Oracle BLOB database column.

Parameters:
resultSet - The result set retrieved by running a "SELECT" query against a BLOB column.
columnName - The name of the BLOB column in the result set. The returned binary stream represents this BLOB column.
Returns:
A binary stream for reading the Oracle BLOB database column.
Throws:
java.lang.Exception - If a system error occurs.

getBlobWriter

java.io.OutputStream getBlobWriter(java.sql.ResultSet resultSet,
                                   java.lang.String columnName)
                                   throws java.lang.Exception
Returns a binary stream that can write large binary data from an Oracle BLOB database column.

Parameters:
resultSet - The result set retrieved by running a "SELECT FOR UPDATE" query against a BLOB column.
columnName - The name of the BLOB column in the result set. The returned binary stream represents this BLOB column.
Returns:
A binary stream for writing the Oracle BLOB database column.
Throws:
java.lang.Exception - If a system error occurs.

getClobReader

java.io.Reader getClobReader(java.sql.ResultSet resultSet,
                             java.lang.String columnName)
                             throws java.lang.Exception
Returns a character stream that can read large binary data from an Oracle CLOB database column.

Parameters:
resultSet - The result set retrieved by running a "SELECT" query against a CLOB column.
columnName - The name of the CLOB column in the result set. The returned character stream represents this CLOB column.
Returns:
A character stream for reading the Oracle CLOB database column.
Throws:
java.lang.Exception - If a system error occurs.

getClobWriter

java.io.Writer getClobWriter(java.sql.ResultSet resultSet,
                             java.lang.String columnName)
                             throws java.lang.Exception
Returns a character stream that can write large binary data to an Oracle CLOB database column.

Parameters:
resultSet - The result set retrieved by running a "SELECT FOR UPDATE" query against a CLOB column.
columnName - The name of the CLOB column in the result set. The returned character stream represents this CLOB column.
Returns:
A character stream for writing the Oracle CLOB database column.
Throws:
java.lang.Exception - If a system error occurs.


© 2014 Flux Corporation. All rights reserved.