org.apache.ojb.broker.platforms
Class PlatformOracleImpl

java.lang.Object
  extended byorg.apache.ojb.broker.platforms.PlatformDefaultImpl
      extended byorg.apache.ojb.broker.platforms.PlatformOracleImpl
All Implemented Interfaces:
JoinSyntaxTypes, Platform
Direct Known Subclasses:
PlatformOracle9iImpl

public class PlatformOracleImpl
extends PlatformDefaultImpl

This class is a concrete implementation of Platform. Provides an implementation that works around some issues with Oracle in general and Oracle's Thin driver in particular..

Version:
$Id: PlatformOracleImpl.java,v 1.17 2004/02/15 14:08:33 brj Exp $
Author:
Thomas Mahler

Field Summary
protected static int THIN_BLOB_MAX_SIZE
           
protected static int THIN_CLOB_MAX_SIZE
           
protected static java.lang.String THIN_URL_PREFIX
           
 
Fields inherited from class org.apache.ojb.broker.platforms.PlatformDefaultImpl
log, m_batchUpdatesChecked, m_supportsBatchUpdates
 
Fields inherited from interface org.apache.ojb.broker.accesslayer.JoinSyntaxTypes
ORACLE_JOIN_SYNTAX, SQL92_JOIN_SYNTAX, SQL92_NOPAREN_JOIN_SYNTAX, SYBASE_JOIN_SYNTAX
 
Constructor Summary
PlatformOracleImpl()
           
 
Method Summary
 void afterStatementCreate(java.sql.Statement stmt)
          In Oracle we set escape processing explizit 'true' after a statement was created.
protected  void changePreparedStatementResultSetType(java.sql.PreparedStatement ps)
          Attempts to modify a private member in the Oracle thin driver's resultset to allow proper setting of large binary streams.
 java.lang.String createSequenceQuery(java.lang.String sequenceName)
          Override this method to enable database based sequence generation
 java.lang.String dropSequenceQuery(java.lang.String sequenceName)
          Override this method to enable database based sequence generation
 byte getJoinSyntaxType()
          Get join syntax type for this RDBMS - one on of the constants from JoinSyntaxType interface
protected static boolean isUsingOracleThinDriver(java.sql.Connection conn)
          Checks if the supplied connection is using the Oracle thin driver.
 java.lang.String nextSequenceQuery(java.lang.String sequenceName)
          Override this method to enable database based sequence generation
 void setObjectForStatement(java.sql.PreparedStatement ps, int index, java.lang.Object value, int sqlType)
          For objects beyond 4k, weird things happen in Oracle if you try to use "setBytes", so for all cases it's better to use setBinaryStream.
 
Methods inherited from class org.apache.ojb.broker.platforms.PlatformDefaultImpl
addBatch, addPagingSql, afterStatementClose, beforeBatch, beforeStatementClose, bindPagingParameters, bindPagingParametersFirst, changeAutoCommitState, checkForBatchSupport, concatenate, executeBatch, getConcatenationCharacter, getEscapeClause, getLastInsertIdentityQuery, initializeJdbcConnection, prepareNextValProcedureStatement, setNullForStatement, supportsBatchOperations, supportsPaging, useCountForResultsetSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THIN_URL_PREFIX

protected static final java.lang.String THIN_URL_PREFIX
See Also:
Constant Field Values

THIN_BLOB_MAX_SIZE

protected static final int THIN_BLOB_MAX_SIZE
See Also:
Constant Field Values

THIN_CLOB_MAX_SIZE

protected static final int THIN_CLOB_MAX_SIZE
See Also:
Constant Field Values
Constructor Detail

PlatformOracleImpl

public PlatformOracleImpl()
Method Detail

afterStatementCreate

public void afterStatementCreate(java.sql.Statement stmt)
                          throws PlatformException
In Oracle we set escape processing explizit 'true' after a statement was created.

Specified by:
afterStatementCreate in interface Platform
Overrides:
afterStatementCreate in class PlatformDefaultImpl
Throws:
PlatformException

setObjectForStatement

public void setObjectForStatement(java.sql.PreparedStatement ps,
                                  int index,
                                  java.lang.Object value,
                                  int sqlType)
                           throws java.sql.SQLException
For objects beyond 4k, weird things happen in Oracle if you try to use "setBytes", so for all cases it's better to use setBinaryStream. Oracle also requires a change in the resultset type of the prepared statement. MBAIRD NOTE: BLOBS may not work with Oracle database/thin driver versions prior to 8.1.6.

Specified by:
setObjectForStatement in interface Platform
Overrides:
setObjectForStatement in class PlatformDefaultImpl
Throws:
java.sql.SQLException
See Also:
Platform.setObjectForStatement(java.sql.PreparedStatement, int, java.lang.Object, int)

changePreparedStatementResultSetType

protected void changePreparedStatementResultSetType(java.sql.PreparedStatement ps)
Attempts to modify a private member in the Oracle thin driver's resultset to allow proper setting of large binary streams.


getJoinSyntaxType

public byte getJoinSyntaxType()
Get join syntax type for this RDBMS - one on of the constants from JoinSyntaxType interface

Specified by:
getJoinSyntaxType in interface Platform
Overrides:
getJoinSyntaxType in class PlatformDefaultImpl
See Also:
Platform.getJoinSyntaxType()

createSequenceQuery

public java.lang.String createSequenceQuery(java.lang.String sequenceName)
Description copied from class: PlatformDefaultImpl
Override this method to enable database based sequence generation

Specified by:
createSequenceQuery in interface Platform
Overrides:
createSequenceQuery in class PlatformDefaultImpl

nextSequenceQuery

public java.lang.String nextSequenceQuery(java.lang.String sequenceName)
Description copied from class: PlatformDefaultImpl
Override this method to enable database based sequence generation

Specified by:
nextSequenceQuery in interface Platform
Overrides:
nextSequenceQuery in class PlatformDefaultImpl

dropSequenceQuery

public java.lang.String dropSequenceQuery(java.lang.String sequenceName)
Description copied from class: PlatformDefaultImpl
Override this method to enable database based sequence generation

Specified by:
dropSequenceQuery in interface Platform
Overrides:
dropSequenceQuery in class PlatformDefaultImpl

isUsingOracleThinDriver

protected static boolean isUsingOracleThinDriver(java.sql.Connection conn)
Checks if the supplied connection is using the Oracle thin driver.

Parameters:
conn - database connection for which to check JDBC-driver
Returns:
true if the connection is using Oracle thin driver, false otherwise.


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14