org.apache.ojb.broker.platforms
Class PlatformMsSQLServerImpl
java.lang.Object
org.apache.ojb.broker.platforms.PlatformDefaultImpl
org.apache.ojb.broker.platforms.PlatformMsSQLServerImpl
- All Implemented Interfaces:
- JoinSyntaxTypes, Platform
- public class PlatformMsSQLServerImpl
- extends PlatformDefaultImpl
This class extends PlatformDefaultImpl
and defines specific behavior for the
Microsoft SQL Server platform.
- Version:
- $Id: PlatformMsSQLServerImpl.java 365232 2005-12-21 22:36:07Z tomdz $
Method Summary |
byte |
getJoinSyntaxType()
Get join syntax type for this RDBMS - one on of the constants from JoinSyntaxType interface
MBAIRD: MS SQL Server 2000 actually supports both types, but due to a problem with the sql
generator, we opt to have no parens. |
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. |
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. |
Methods inherited from class org.apache.ojb.broker.platforms.PlatformDefaultImpl |
addBatch, addPagingSql, afterStatementClose, afterStatementCreate, beforeBatch, beforeStatementClose, bindPagingParameters, bindPagingParametersFirst, changeAutoCommitState, concatenate, createSequenceQuery, createSequenceQuery, dropSequenceQuery, executeBatch, getEscapeClause, initializeJdbcConnection, nextSequenceQuery, registerOutResultSet, setNullForStatement, setObjectForStatement, supportsBatchOperations, supportsMultiColumnCountDistinct, supportsPaging, useCountForResultsetSize |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PlatformMsSQLServerImpl
public PlatformMsSQLServerImpl()
getJoinSyntaxType
public byte getJoinSyntaxType()
- Get join syntax type for this RDBMS - one on of the constants from JoinSyntaxType interface
MBAIRD: MS SQL Server 2000 actually supports both types, but due to a problem with the sql
generator, we opt to have no parens.
- Specified by:
getJoinSyntaxType
in interface Platform
- Overrides:
getJoinSyntaxType
in class PlatformDefaultImpl
- See Also:
Platform.getJoinSyntaxType()
prepareNextValProcedureStatement
public java.sql.CallableStatement prepareNextValProcedureStatement(java.sql.Connection con,
java.lang.String procedureName,
java.lang.String sequenceName)
throws PlatformException
- Description copied from interface:
Platform
- Create stored procedure call for a special sequence manager implementation
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);
- Specified by:
prepareNextValProcedureStatement
in interface Platform
- Overrides:
prepareNextValProcedureStatement
in class PlatformDefaultImpl
- Throws:
PlatformException
getLastInsertIdentityQuery
public java.lang.String getLastInsertIdentityQuery(java.lang.String tableName)
- Description copied from interface:
Platform
- If database supports native key generation via identity column, this
method should return the sql-query to obtain the last generated id.
- Specified by:
getLastInsertIdentityQuery
in interface Platform
- Overrides:
getLastInsertIdentityQuery
in class PlatformDefaultImpl
(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