|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ojb.broker.accesslayer.StatementsForClassImpl
This class serves as a cache for Statements that are used for persistence operations on a given class.
Field Summary | |
protected ClassDescriptor |
classDescriptor
sets the escape processing mode |
protected java.lang.Class |
clazz
|
protected boolean |
FORCEJDBC1_0
force use of JDBC 1.0 statement creation |
protected Platform |
platform
|
protected SqlGenerator |
sqlGenerator
|
Constructor Summary | |
StatementsForClassImpl(JdbcConnectionDescriptor jcd,
ClassDescriptor classDescriptor)
|
Method Summary | |
java.sql.PreparedStatement |
getDeleteStmt(java.sql.Connection con)
returns the DELETE Statement used for clazz. |
java.sql.Statement |
getGenericStmt(java.sql.Connection con,
boolean scrollable)
returns a generic unprepared Statement used for clazz. |
java.sql.PreparedStatement |
getInsertStmt(java.sql.Connection con)
returns the INSERT Statement used for clazz. |
java.sql.PreparedStatement |
getPreparedStmt(java.sql.Connection con,
java.lang.String sql,
boolean scrollable)
returns a prepared Statement used for clazz. |
java.sql.PreparedStatement |
getSelectByPKStmt(java.sql.Connection con)
returns the SELECT Statement used for clazz. |
java.sql.PreparedStatement |
getUpdateStmt(java.sql.Connection con)
returns the UPDATE Statement used for clazz. |
boolean |
isCached(java.sql.Statement stmt)
For single VM operation to not eat up Oracle resources, we need to close the statements unless they are cached. |
protected java.sql.PreparedStatement |
prepareStatement(java.sql.Connection con,
java.lang.String sql,
boolean scrollable)
Deprecated. use prepareStatement(Connection,String,boolean,boolean) instead. |
protected java.sql.PreparedStatement |
prepareStatement(java.sql.Connection con,
java.lang.String sql,
boolean scrollable,
boolean createPreparedStatement)
prepares a statement with parameters that should work with most RDBMS |
protected boolean |
usePreparedStatement()
Answer true if a PreparedStatement has to be used false for a CallableStatement |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final ClassDescriptor classDescriptor
protected SqlGenerator sqlGenerator
protected Platform platform
protected java.lang.Class clazz
protected boolean FORCEJDBC1_0
Constructor Detail |
public StatementsForClassImpl(JdbcConnectionDescriptor jcd, ClassDescriptor classDescriptor)
Method Detail |
public boolean isCached(java.sql.Statement stmt)
StatementsForClassIF
isCached
in interface StatementsForClassIF
protected boolean usePreparedStatement()
public java.sql.PreparedStatement getDeleteStmt(java.sql.Connection con) throws java.sql.SQLException
StatementsForClassIF
getDeleteStmt
in interface StatementsForClassIF
java.sql.SQLException
public java.sql.Statement getGenericStmt(java.sql.Connection con, boolean scrollable) throws PersistenceBrokerSQLException
StatementsForClassIF
getGenericStmt
in interface StatementsForClassIF
PersistenceBrokerSQLException
public java.sql.PreparedStatement getInsertStmt(java.sql.Connection con) throws java.sql.SQLException
StatementsForClassIF
getInsertStmt
in interface StatementsForClassIF
java.sql.SQLException
public java.sql.PreparedStatement getPreparedStmt(java.sql.Connection con, java.lang.String sql, boolean scrollable) throws PersistenceBrokerSQLException
StatementsForClassIF
getPreparedStmt
in interface StatementsForClassIF
PersistenceBrokerSQLException
public java.sql.PreparedStatement getSelectByPKStmt(java.sql.Connection con) throws java.sql.SQLException
StatementsForClassIF
getSelectByPKStmt
in interface StatementsForClassIF
java.sql.SQLException
public java.sql.PreparedStatement getUpdateStmt(java.sql.Connection con) throws java.sql.SQLException
StatementsForClassIF
getUpdateStmt
in interface StatementsForClassIF
java.sql.SQLException
protected java.sql.PreparedStatement prepareStatement(java.sql.Connection con, java.lang.String sql, boolean scrollable) throws java.sql.SQLException
prepareStatement(Connection,String,boolean,boolean)
instead.
java.sql.SQLException
protected java.sql.PreparedStatement prepareStatement(java.sql.Connection con, java.lang.String sql, boolean scrollable, boolean createPreparedStatement) throws java.sql.SQLException
con
- the connection to utilizesql
- the sql syntax to use when creating the statement.scrollable
- determines if the statement will be scrollable.createPreparedStatement
- if true
, then a
PreparedStatement
will be created. if false
, then
a CallableStatement
will be created.
sql
argument.
java.sql.SQLException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |