| org.apache.ojb.broker.platforms.Platform
All known Subclasses: org.apache.ojb.broker.platforms.PlatformDefaultImpl,
Platform | public interface Platform (Code) | | This interface provides callbacks that allow to perform
RDBMS Platform specific operations wherever neccessary.
The Platform implementation is selected by the platform attribute for
each jdbc-connection-descriptor entry in the repository file.
version: $Id: Platform.java,v 1.24.2.6 2005/12/18 16:43:19 tomdz Exp $ author: Thomas Mahler |
Method Summary | |
void | addBatch(PreparedStatement stmt) Called when adding statements to current batch. | void | addPagingSql(StringBuffer anSqlString) | void | afterStatementClose(Statement stmt, ResultSet rs) Called by
org.apache.ojb.broker.accesslayer.StatementManagerIF implementation
after invoking stmt.close() method. | void | afterStatementCreate(Statement stmt) Called after a statement has been created. | void | beforeBatch(PreparedStatement stmt) Called before batching operations on a statement. | void | beforeStatementClose(Statement stmt, ResultSet rs) Called by
org.apache.ojb.broker.accesslayer.StatementManagerIF implementation
before invoking stmt.close() method. | int | bindPagingParameters(PreparedStatement ps, int index, int startAt, int endAt) | boolean | bindPagingParametersFirst() | void | changeAutoCommitState(JdbcConnectionDescriptor jcd, Connection con, boolean newState) Used to do a temporary change of the m_connection autoCommit state. | String | concatenate(String[] theColumns) | String | createSequenceQuery(String sequenceName, Properties prop) Returns a query to create a sequence entry.
Parameters: sequenceName - The name of the sequence to create. Parameters: prop - The database specific sequence properties. | String | createSequenceQuery(String sequenceName) Returns a query to create a sequence entry.
Parameters: sequenceName - The name of the sequence to create. | String | dropSequenceQuery(String sequenceName) Returns a query to drop a sequence entry. | int[] | executeBatch(PreparedStatement stmt) Executes current batch. | String | getEscapeClause(LikeCriteria aCriteria) | byte | getJoinSyntaxType() Get join syntax type for this RDBMS - one of the constants from JoinSyntaxTypes interface. | String | getLastInsertIdentityQuery(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, Connection conn) Called immediately after a JDBC connection has been created by a
ConnectionFactory implementation (not used for DataSource connections). | String | nextSequenceQuery(String sequenceName) Returns a query to obtain the next sequence key. | CallableStatement | prepareNextValProcedureStatement(Connection con, String procedureName, String sequenceName) Create stored procedure call for a special sequence manager implementation
org.apache.ojb.broker.util.sequence.SequenceManagerStoredProcedureImpl ,
because it seems that jdbc-driver differ in handling of CallableStatement. | void | registerOutResultSet(CallableStatement stmt, int position) Registers call argument at position as returning
a
ResultSet value. | void | setNullForStatement(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(PreparedStatement ps, int index, 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() | boolean | useCountForResultsetSize() Override default ResultSet size determination (rs.last();rs.getRow())
with select count(*) operation. |
addPagingSql | void addPagingSql(StringBuffer anSqlString)(Code) | | Add the LIMIT or equivalent to the SQL
SQL-Paging is not yet supported
|
bindPagingParameters | int bindPagingParameters(PreparedStatement ps, int index, int startAt, int endAt) throws SQLException(Code) | | Bind the Paging Parameters
SQL-Paging is not yet supported
Parameters: ps - Parameters: index - parameter index Parameters: startAt - Parameters: endAt - |
bindPagingParametersFirst | boolean bindPagingParametersFirst()(Code) | | Answer true if the LIMIT parameters are bound before the query parameters
SQL-Paging is not yet supported
|
concatenate | String concatenate(String[] theColumns)(Code) | | Concatenate the columns
ie: col1 || col2 || col3 (ANSI)
ie: col1 + col2 + col3 (MS SQL-Server)
ie: concat(col1, col2, col3) (MySql)
Parameters: theColumns - the concatenated String |
createSequenceQuery | String createSequenceQuery(String sequenceName, Properties prop)(Code) | | Returns a query to create a sequence entry.
Parameters: sequenceName - The name of the sequence to create. Parameters: prop - The database specific sequence properties. a sql string to create a sequence |
dropSequenceQuery | String dropSequenceQuery(String sequenceName)(Code) | | Returns a query to drop a sequence entry.
a sql string to drop a sequence |
getEscapeClause | String getEscapeClause(LikeCriteria aCriteria)(Code) | | Answer the Clause used Escape wildcards in LIKE
Parameters: aCriteria - |
getLastInsertIdentityQuery | String getLastInsertIdentityQuery(String tableName)(Code) | | If database supports native key generation via identity column, this
method should return the sql-query to obtain the last generated id.
|
initializeJdbcConnection | void initializeJdbcConnection(JdbcConnectionDescriptor jcd, Connection conn) throws PlatformException(Code) | | Called immediately after a JDBC connection has been created by a
ConnectionFactory implementation (not used for DataSource connections).
Parameters: conn - the Connection to be initialized |
nextSequenceQuery | String nextSequenceQuery(String sequenceName)(Code) | | Returns a query to obtain the next sequence key.
a sql string to get next sequence value |
prepareNextValProcedureStatement | CallableStatement prepareNextValProcedureStatement(Connection con, String procedureName, String sequenceName) throws PlatformException(Code) | | Create stored procedure call for a special sequence manager implementation
org.apache.ojb.broker.util.sequence.SequenceManagerStoredProcedureImpl ,
because it seems that jdbc-driver differ in handling of CallableStatement.
Note: The out-parameter of the stored procedure must be registered at
first position, because lookup for new long id in the implementation:
Connection con = broker.serviceConnectionManager().getConnection();
cs = getPlatform().prepareNextValProcedureStatement(con, PROCEDURE_NAME, sequenceName);
cs.executeUpdate();
return cs.getLong(1);
|
registerOutResultSet | void registerOutResultSet(CallableStatement stmt, int position) throws SQLException(Code) | | Registers call argument at position as returning
a
ResultSet value.
Parameters: stmt - the statement Parameters: position - argument position |
setNullForStatement | void setNullForStatement(PreparedStatement ps, int index, int sqlType) throws SQLException(Code) | | Called to let the Platform implementation perform any JDBC type-specific operations
needed by the driver when binding null parameters for a PreparedStatement.
|
setObjectForStatement | void setObjectForStatement(PreparedStatement ps, int index, Object value, int sqlType) throws SQLException(Code) | | Called to let the Platform implementation perform any JDBC type-specific operations
needed by the driver when binding positional parameters for a PreparedStatement.
|
supportsBatchOperations | boolean supportsBatchOperations()(Code) | | If this platform supports the batch operations jdbc 2.0 feature. This is
by driver, so we check the driver's metadata once and set something in
the platform.
true if the platform supports batch, false otherwise. |
supportsMultiColumnCountDistinct | boolean supportsMultiColumnCountDistinct()(Code) | | Whether the platform supports a COUNT DISTINCT across multiple columns.
true if it is supported |
supportsPaging | boolean supportsPaging()(Code) | | Answer true if LIMIT or equivalent is supported
SQL-Paging is not yet supported
|
useCountForResultsetSize | boolean useCountForResultsetSize()(Code) | | Override default ResultSet size determination (rs.last();rs.getRow())
with select count(*) operation.
|
|
|