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, PlatformWLOracle9iImpl

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.20.2.2 2005/03/02 16:25:28 mkalen Exp $
Author:
Thomas Mahler

Field Summary
 
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.
 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
 java.lang.String nextSequenceQuery(java.lang.String sequenceName)
          Override this method to enable database based sequence generation
 java.sql.CallableStatement prepareNextValProcedureStatement(java.sql.Connection con, java.lang.String procedureName, java.lang.String sequenceName)
          Method prepareNextValProcedureStatement implementation is simply copied over from PlatformMsSQLServerImpl class.
 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, concatenate, executeBatch, getEscapeClause, getLastInsertIdentityQuery, initializeJdbcConnection, setNullForStatement, supportsBatchOperations, supportsPaging, useCountForResultsetSize
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlatformOracleImpl

public PlatformOracleImpl()
Method Detail

prepareNextValProcedureStatement

public java.sql.CallableStatement prepareNextValProcedureStatement(java.sql.Connection con,
                                                                   java.lang.String procedureName,
                                                                   java.lang.String sequenceName)
                                                            throws PlatformException
Method prepareNextValProcedureStatement implementation is simply copied over from PlatformMsSQLServerImpl class.

Specified by:
prepareNextValProcedureStatement in interface Platform
Overrides:
prepareNextValProcedureStatement in class PlatformDefaultImpl
Throws:
PlatformException
See Also:
Platform.prepareNextValProcedureStatement(java.sql.Connection, java.lang.String, java.lang.String)

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)

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


(C) 2002 - 2004 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.3, 2005-04-2