public class PlatformDefaultImpl extends java.lang.Object implements Platform, JoinSyntaxTypes
Platform. Provides default implementations for all
methods declared in Platform.
It is intended as a vanilla implementation and as baseclass for
platform specific implementations.ORACLE_JOIN_SYNTAX, SQL92_JOIN_SYNTAX, SQL92_NOPAREN_JOIN_SYNTAX, SYBASE_JOIN_SYNTAX| Constructor and Description |
|---|
PlatformDefaultImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
addBatch(java.sql.PreparedStatement stmt)
Called when adding statements to current batch.
|
void |
addPagingSql(java.lang.StringBuffer anSqlString)
Add the LIMIT or equivalent to the SQL
SQL-Paging is not yet supported
|
void |
afterStatementClose(java.sql.Statement stmt,
java.sql.ResultSet rs)
Called by
StatementManagerIF implementation
after invoking stmt.close() method. |
void |
afterStatementCreate(java.sql.Statement stmt)
Called after a statement has been created.
|
void |
beforeBatch(java.sql.PreparedStatement stmt)
Called before batching operations on a statement.
|
void |
beforeStatementClose(java.sql.Statement stmt,
java.sql.ResultSet rs)
Called by
StatementManagerIF implementation
before invoking stmt.close() method. |
int |
bindPagingParameters(java.sql.PreparedStatement ps,
int index,
int startAt,
int endAt)
Bind the Paging Parameters
SQL-Paging is not yet supported
|
boolean |
bindPagingParametersFirst()
Answer true if the LIMIT parameters are bound before the query parameters
SQL-Paging is not yet supported
|
void |
changeAutoCommitState(JdbcConnectionDescriptor jcd,
java.sql.Connection con,
boolean newState)
Used to do a temporary change of the m_connection autoCommit state.
|
java.lang.String |
concatenate(java.lang.String[] theColumns)
Concatenate the columns
ie: col1 || col2 || col3 (ANSI)
ie: col1 + col2 + col3 (MS SQL-Server)
ie: concat(col1, col2, col3) (MySql)
|
java.lang.String |
createSequenceQuery(java.lang.String sequenceName)
Override this method to enable database based sequence generation
|
java.lang.String |
createSequenceQuery(java.lang.String sequenceName,
java.util.Properties prop)
Returns a query to create a sequence entry.
|
java.lang.String |
dropSequenceQuery(java.lang.String sequenceName)
Override this method to enable database based sequence generation
|
int[] |
executeBatch(java.sql.PreparedStatement stmt)
Executes current batch.
|
java.lang.String |
getEscapeClause(LikeCriteria aCriteria)
Answer the Clause used Escape wildcards in LIKE
|
byte |
getJoinSyntaxType()
Get join syntax type for this RDBMS - one on of the constants from JoinSyntaxType interface
|
java.lang.String |
getLastInsertIdentityQuery(java.lang.String tableName)
If database supports native key generation via identity column, this
method should return the sql-query to obtain the last generated id.
|
void |
initializeJdbcConnection(JdbcConnectionDescriptor jcd,
java.sql.Connection conn)
Called immediately after a JDBC connection has been created by a
ConnectionFactory implementation (not used for DataSource connections).
|
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)
Create stored procedure call for a special sequence manager implementation
SequenceManagerStoredProcedureImpl,
because it seems that jdbc-driver differ in handling of CallableStatement. |
void |
registerOutResultSet(java.sql.CallableStatement stmt,
int position)
Registers call argument at
position as returning
a ResultSet value. |
void |
setNullForStatement(java.sql.PreparedStatement ps,
int index,
int sqlType)
Called to let the Platform implementation perform any JDBC type-specific operations
needed by the driver when binding null parameters for a PreparedStatement.
|
void |
setObjectForStatement(java.sql.PreparedStatement ps,
int index,
java.lang.Object value,
int sqlType)
Called to let the Platform implementation perform any JDBC type-specific operations
needed by the driver when binding positional parameters for a PreparedStatement.
|
boolean |
supportsBatchOperations()
If this platform supports the batch operations jdbc 2.0 feature.
|
boolean |
supportsMultiColumnCountDistinct()
Whether the platform supports a COUNT DISTINCT across multiple columns.
|
boolean |
supportsPaging()
Answer true if LIMIT or equivalent is supported
SQL-Paging is not yet supported
|
boolean |
useCountForResultsetSize()
Override default ResultSet size determination (rs.last();rs.getRow())
with select count(*) operation
|
public boolean supportsBatchOperations()
PlatformsupportsBatchOperations in interface Platformpublic void afterStatementCreate(java.sql.Statement stmt)
throws PlatformException
PlatformafterStatementCreate in interface PlatformPlatformExceptionpublic void beforeStatementClose(java.sql.Statement stmt,
java.sql.ResultSet rs)
throws PlatformException
PlatformStatementManagerIF implementation
before invoking stmt.close() method.beforeStatementClose in interface PlatformPlatformExceptionpublic void afterStatementClose(java.sql.Statement stmt,
java.sql.ResultSet rs)
throws PlatformException
PlatformStatementManagerIF implementation
after invoking stmt.close() method.afterStatementClose in interface PlatformPlatformExceptionpublic void beforeBatch(java.sql.PreparedStatement stmt)
throws PlatformException
PlatformbeforeBatch in interface Platformstmt - the statement you want to batch onPlatformExceptionpublic void addBatch(java.sql.PreparedStatement stmt)
throws PlatformException
PlatformaddBatch in interface Platformstmt - the statement you are adding to the batchPlatformExceptionpublic int[] executeBatch(java.sql.PreparedStatement stmt)
throws PlatformException
PlatformexecuteBatch in interface Platformstmt - the statement you want to execute the batch onPlatformExceptionpublic void initializeJdbcConnection(JdbcConnectionDescriptor jcd, java.sql.Connection conn) throws PlatformException
PlatforminitializeJdbcConnection in interface Platformconn - the Connection to be initializedPlatformExceptionPlatform.initializeJdbcConnection(org.apache.ojb.broker.metadata.JdbcConnectionDescriptor, java.sql.Connection)public void changeAutoCommitState(JdbcConnectionDescriptor jcd, java.sql.Connection con, boolean newState)
PlatformJdbcConnectionDescriptor.getUseAutoCommit() was set to
JdbcConnectionDescriptor.AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE
the change of the autoCommit state take effect.changeAutoCommitState in interface Platformpublic void setObjectForStatement(java.sql.PreparedStatement ps,
int index,
java.lang.Object value,
int sqlType)
throws java.sql.SQLException
PlatformsetObjectForStatement in interface Platformjava.sql.SQLExceptionpublic void setNullForStatement(java.sql.PreparedStatement ps,
int index,
int sqlType)
throws java.sql.SQLException
PlatformsetNullForStatement in interface Platformjava.sql.SQLExceptionpublic byte getJoinSyntaxType()
getJoinSyntaxType in interface PlatformPlatform.getJoinSyntaxType()public boolean useCountForResultsetSize()
useCountForResultsetSize in interface PlatformPlatform.useCountForResultsetSize()public java.lang.String createSequenceQuery(java.lang.String sequenceName,
java.util.Properties prop)
PlatformcreateSequenceQuery in interface PlatformsequenceName - The name of the sequence to create.prop - The database specific sequence properties.public java.lang.String createSequenceQuery(java.lang.String sequenceName)
createSequenceQuery in interface PlatformsequenceName - The name of the sequence to create.public java.lang.String nextSequenceQuery(java.lang.String sequenceName)
nextSequenceQuery in interface Platformpublic java.lang.String dropSequenceQuery(java.lang.String sequenceName)
dropSequenceQuery in interface Platformpublic java.sql.CallableStatement prepareNextValProcedureStatement(java.sql.Connection con,
java.lang.String procedureName,
java.lang.String sequenceName)
throws PlatformException
PlatformSequenceManagerStoredProcedureImpl,
because it seems that jdbc-driver differ in handling of CallableStatement.
Connection con = broker.serviceConnectionManager().getConnection(); cs = getPlatform().prepareNextValProcedureStatement(con, PROCEDURE_NAME, sequenceName); cs.executeUpdate(); return cs.getLong(1);
prepareNextValProcedureStatement in interface PlatformPlatformExceptionpublic java.lang.String getLastInsertIdentityQuery(java.lang.String tableName)
PlatformgetLastInsertIdentityQuery in interface Platformpublic void addPagingSql(java.lang.StringBuffer anSqlString)
PlatformaddPagingSql in interface PlatformPlatform.addPagingSql(java.lang.StringBuffer)public boolean bindPagingParametersFirst()
PlatformbindPagingParametersFirst in interface PlatformPlatform.bindPagingParametersFirst()public boolean supportsPaging()
PlatformsupportsPaging in interface PlatformPlatform.supportsPaging()public int bindPagingParameters(java.sql.PreparedStatement ps,
int index,
int startAt,
int endAt)
throws java.sql.SQLException
PlatformbindPagingParameters in interface Platformindex - parameter indexjava.sql.SQLExceptionPlatform.bindPagingParameters(java.sql.PreparedStatement, int, int, int)public boolean supportsMultiColumnCountDistinct()
supportsMultiColumnCountDistinct in interface Platformtrue if it is supportedpublic java.lang.String concatenate(java.lang.String[] theColumns)
Platformconcatenate in interface PlatformPlatform.concatenate(java.lang.String[])public java.lang.String getEscapeClause(LikeCriteria aCriteria)
PlatformgetEscapeClause in interface PlatformPlatform.getEscapeClause(org.apache.ojb.broker.query.LikeCriteria)public void registerOutResultSet(java.sql.CallableStatement stmt,
int position)
throws java.sql.SQLException
Platformposition as returning
a ResultSet value.registerOutResultSet in interface Platformstmt - the statementposition - argument positionjava.sql.SQLExceptionPlatform.registerOutResultSet(java.sql.CallableStatement, int)(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