public class PlatformOracle9iImpl extends PlatformOracleImpl
Platform
. Provides
an implementation that works around some issues with Oracle in general and
Oracle 9i's Thin driver in particular.
NOTE: When using BEA WebLogic and BLOB/CLOB datatypes, the physical connection will be
used causing WebLogic to mark it as "infected" and discard it when
the logicical connection is closed. You can change this behavior by setting the
RemoveInfectedConnectionsEnabled attribute on a connection pool.
see WebLogic docs.
Optimization: Oracle Batching (not standard JDBC batching)
see http://technet.oracle.com/products/oracle9i/daily/jun07.html
Optimization: Oracle Prefetching
see http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/advanced/RowPrefetchSample/Readme.html
Optimization: Oracle Statement Caching
see http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/jdbc30/StmtCacheSample/Readme.html
TODO: Optimization: use ROWNUM to minimize the effects of not having server side cursors
see http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:127412348064Platform
,
PlatformDefaultImpl
,
PlatformOracleImpl
ORACLE_JOIN_SYNTAX, SQL92_JOIN_SYNTAX, SQL92_NOPAREN_JOIN_SYNTAX, SYBASE_JOIN_SYNTAX
Constructor and Description |
---|
PlatformOracle9iImpl()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addBatch(java.sql.PreparedStatement stmt)
Try Oracle update batching and call executeUpdate or revert to
JDBC update batching.
|
void |
afterStatementCreate(java.sql.Statement stmt)
Performs platform-specific operations on each statement.
|
void |
beforeBatch(java.sql.PreparedStatement stmt)
Try Oracle update batching and call setExecuteBatch or revert to
JDBC update batching.
|
int[] |
executeBatch(java.sql.PreparedStatement stmt)
Try Oracle update batching and call sendBatch or revert to
JDBC update batching.
|
byte |
getJoinSyntaxType()
Get join syntax type for this RDBMS.
|
void |
initializeJdbcConnection(JdbcConnectionDescriptor jcd,
java.sql.Connection conn)
Enables Oracle statement caching and row prefetching if supported by the JDBC-driver.
|
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.
|
createSequenceQuery, createSequenceQuery, dropSequenceQuery, nextSequenceQuery, prepareNextValProcedureStatement, registerOutResultSet
addPagingSql, afterStatementClose, beforeStatementClose, bindPagingParameters, bindPagingParametersFirst, changeAutoCommitState, concatenate, getEscapeClause, getLastInsertIdentityQuery, setNullForStatement, supportsBatchOperations, supportsMultiColumnCountDistinct, supportsPaging, useCountForResultsetSize
public void initializeJdbcConnection(JdbcConnectionDescriptor jcd, java.sql.Connection conn) throws PlatformException
initializeJdbcConnection
in interface Platform
initializeJdbcConnection
in class PlatformDefaultImpl
jcd
- the OJB JdbcConnectionDescriptor
(metadata) for the connection to be initializedconn
- the Connection
-object (physical) to be initializedPlatformException
PlatformDefaultImpl.initializeJdbcConnection(org.apache.ojb.broker.metadata.JdbcConnectionDescriptor, java.sql.Connection)
,
Oracle TechNet Statement Caching Sample,
Oracle TechNet Row Pre-fetch Samplepublic void afterStatementCreate(java.sql.Statement stmt)
afterStatementCreate
in interface Platform
afterStatementCreate
in class PlatformOracleImpl
stmt
- the statement just createdpublic void beforeBatch(java.sql.PreparedStatement stmt) throws PlatformException
beforeBatch
in interface Platform
beforeBatch
in class PlatformDefaultImpl
stmt
- the prepared statement to be used for batchingPlatformException
- upon JDBC failurepublic void addBatch(java.sql.PreparedStatement stmt) throws PlatformException
addBatch
in interface Platform
addBatch
in class PlatformDefaultImpl
stmt
- the statement beeing added to the batchPlatformException
- upon JDBC failurepublic int[] executeBatch(java.sql.PreparedStatement stmt) throws PlatformException
executeBatch
in interface Platform
executeBatch
in class PlatformDefaultImpl
stmt
- the batched prepared statement about to be executednull
if Oracle update batching is used,
since it is impossible to dissolve total row count into distinct
statement counts. If JDBC update batching is used, an int array is
returned containing number of updated rows for each batched statement.PlatformException
- upon JDBC failurepublic void setObjectForStatement(java.sql.PreparedStatement ps, int index, java.lang.Object value, int sqlType) throws java.sql.SQLException
PlatformOracleImpl
setObjectForStatement
in interface Platform
setObjectForStatement
in class PlatformOracleImpl
java.sql.SQLException
Platform.setObjectForStatement(java.sql.PreparedStatement, int, java.lang.Object, int)
public byte getJoinSyntaxType()
getJoinSyntaxType
in interface Platform
getJoinSyntaxType
in class PlatformOracleImpl
Platform.getJoinSyntaxType()
(C) 2002 - 2005 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30