|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ojb.broker.platforms.PlatformDefaultImpl
This class is a concrete implementation of Platform
. Provides default implementations for all
methods declared in Platform
.
It is intended as a vanilla implementation and as baseclass for
platform specific implementations.
Field Summary | |
protected Logger |
log
|
protected boolean |
m_batchUpdatesChecked
|
protected boolean |
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 | |
PlatformDefaultImpl()
|
Method Summary | |
void |
addBatch(java.sql.PreparedStatement stmt)
|
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 StatementManager implementation
after invoke stmt.close() method. |
void |
afterStatementCreate(java.sql.Statement stmt)
Called after a jdbc-m_connection statement was created. |
void |
beforeBatch(java.sql.PreparedStatement stmt)
|
void |
beforeStatementClose(java.sql.Statement stmt,
java.sql.ResultSet rs)
Called by StatementManager implementation
before invoke 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. |
protected void |
checkForBatchSupport(java.sql.Connection conn)
Sets platform information for if the jdbc driver/db combo support batch operations. |
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 |
dropSequenceQuery(java.lang.String sequenceName)
Override this method to enable database based sequence generation |
int[] |
executeBatch(java.sql.PreparedStatement stmt)
|
protected java.lang.String |
getConcatenationCharacter()
Answer the Character for Concatenation |
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)
callback called immediately after a JDBC Connection has been obtained in ... |
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 |
setNullForStatement(java.sql.PreparedStatement ps,
int index,
int sqlType)
some JDBC-Drivers do not support all sqlTypes this callback is used set parameters to a PreparedStatement |
void |
setObjectForStatement(java.sql.PreparedStatement ps,
int index,
java.lang.Object value,
int sqlType)
some JDBC-Drivers do not support all sqlTypes this callback is used set parameters to a PreparedStatement |
boolean |
supportsBatchOperations()
if this platform supports the batch operations jdbc 2.0 feature. |
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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Logger log
protected boolean m_batchUpdatesChecked
protected boolean m_supportsBatchUpdates
Constructor Detail |
public PlatformDefaultImpl()
Method Detail |
public boolean supportsBatchOperations()
Platform
supportsBatchOperations
in interface Platform
protected void checkForBatchSupport(java.sql.Connection conn)
conn
- public void afterStatementCreate(java.sql.Statement stmt) throws PlatformException
Platform
afterStatementCreate
in interface Platform
PlatformException
public void beforeStatementClose(java.sql.Statement stmt, java.sql.ResultSet rs) throws PlatformException
Platform
StatementManager
implementation
before invoke stmt.close() method.
beforeStatementClose
in interface Platform
PlatformException
public void afterStatementClose(java.sql.Statement stmt, java.sql.ResultSet rs) throws PlatformException
Platform
StatementManager
implementation
after invoke stmt.close() method.
afterStatementClose
in interface Platform
PlatformException
public void beforeBatch(java.sql.PreparedStatement stmt) throws PlatformException
beforeBatch
in interface Platform
stmt
- the statement you want to batch on
PlatformException
public void addBatch(java.sql.PreparedStatement stmt) throws PlatformException
addBatch
in interface Platform
stmt
- the statement you are adding to the batch
PlatformException
public int[] executeBatch(java.sql.PreparedStatement stmt) throws PlatformException
executeBatch
in interface Platform
stmt
- the statement you want to execute the batch on
PlatformException
public void initializeJdbcConnection(JdbcConnectionDescriptor jcd, java.sql.Connection conn) throws PlatformException
Platform
initializeJdbcConnection
in interface Platform
conn
- the Connection to be initialized
PlatformException
Platform.initializeJdbcConnection(org.apache.ojb.broker.metadata.JdbcConnectionDescriptor, java.sql.Connection)
public void changeAutoCommitState(JdbcConnectionDescriptor jcd, java.sql.Connection con, boolean newState)
Platform
JdbcConnectionDescriptor.getUseAutoCommit()
was set to
JdbcConnectionDescriptor.AUTO_COMMIT_SET_TRUE_AND_TEMPORARY_FALSE
the change of the autoCommit state take effect.
changeAutoCommitState
in interface Platform
public void setObjectForStatement(java.sql.PreparedStatement ps, int index, java.lang.Object value, int sqlType) throws java.sql.SQLException
Platform
setObjectForStatement
in interface Platform
java.sql.SQLException
public void setNullForStatement(java.sql.PreparedStatement ps, int index, int sqlType) throws java.sql.SQLException
Platform
setNullForStatement
in interface Platform
java.sql.SQLException
public byte getJoinSyntaxType()
getJoinSyntaxType
in interface Platform
Platform.getJoinSyntaxType()
public boolean useCountForResultsetSize()
useCountForResultsetSize
in interface Platform
Platform.useCountForResultsetSize()
public java.lang.String createSequenceQuery(java.lang.String sequenceName)
createSequenceQuery
in interface Platform
public java.lang.String nextSequenceQuery(java.lang.String sequenceName)
nextSequenceQuery
in interface Platform
public java.lang.String dropSequenceQuery(java.lang.String sequenceName)
dropSequenceQuery
in interface Platform
public java.sql.CallableStatement prepareNextValProcedureStatement(java.sql.Connection con, java.lang.String procedureName, java.lang.String sequenceName) throws PlatformException
Platform
SequenceManagerStoredProcedureImpl
,
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 Platform
PlatformException
public java.lang.String getLastInsertIdentityQuery(java.lang.String tableName)
Platform
getLastInsertIdentityQuery
in interface Platform
public void addPagingSql(java.lang.StringBuffer anSqlString)
Platform
addPagingSql
in interface Platform
Platform.addPagingSql(java.lang.StringBuffer)
public boolean bindPagingParametersFirst()
Platform
bindPagingParametersFirst
in interface Platform
Platform.bindPagingParametersFirst()
public boolean supportsPaging()
Platform
supportsPaging
in interface Platform
Platform.supportsPaging()
public int bindPagingParameters(java.sql.PreparedStatement ps, int index, int startAt, int endAt) throws java.sql.SQLException
Platform
bindPagingParameters
in interface Platform
ps
- index
- parameter indexstartAt
- endAt
-
java.sql.SQLException
Platform.bindPagingParameters(java.sql.PreparedStatement, int, int, int)
protected java.lang.String getConcatenationCharacter()
public java.lang.String concatenate(java.lang.String[] theColumns)
Platform
concatenate
in interface Platform
theColumns
-
Platform.concatenate(java.lang.String[])
public java.lang.String getEscapeClause(LikeCriteria aCriteria)
Platform
getEscapeClause
in interface Platform
aCriteria
-
Platform.getEscapeClause(org.apache.ojb.broker.query.LikeCriteria)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |