|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.j2ee.dao.AbstractJdbcDAOAction
Based on an example of book Code Notes for J2EE, Edited by GREGORY BRILL,
e-ISBN 0-679-64727-9
Last modified $Date: 2004/05/18 10:50:12 $
Field Summary |
---|
Fields inherited from interface org.j2ee.dao.JdbcDAOAction |
---|
CALL_FUNCTION, CALL_PROCEDURE, DDL, NO_OUT_PARAM, QUERY, UPDATE |
Constructor Summary | |
---|---|
AbstractJdbcDAOAction()
|
|
AbstractJdbcDAOAction(int stmtType)
|
Method Summary | |
---|---|
void |
cachPreparedStatement(java.sql.PreparedStatement pstmt)
|
void |
execute(org.j2ee.dao.DAOActionProcessor processor)
This is the mainly method of an action. |
int[] |
getDataTypesForOutParams()
This method is called when this action is of type CALL_PROCEDURE or CALL_FUNCTION. |
int[] |
getDataTypesForParams()
This method retuns the SQL Type for parameters to be setted to sql statement. |
java.lang.Object[] |
getParameters()
This method retuns the parameters to be setted to sql statement. |
java.sql.PreparedStatement |
getPreparedStatement()
|
abstract java.lang.String |
getSQL()
This method define the sql statement to be executed. |
int |
getStmtType()
Return of statemnt's type. |
java.lang.Object |
getTO()
REDEFINE THIS METHOD ON EVERY SUBCLASS The transfer object used or setted by the action. |
void |
handleResults(java.sql.CallableStatement cstmt)
Handle the results of call statements. If the statement is of type CALL_PROCEDURE or CALL_FUNCTION, then when the execution of the statement finalize and no exception occurs, this method is call for handle the results. |
void |
handleResults(int rowsAffected)
Handle the results of update statements. If the statement is of type UPDATE (insert, update or delete), then when the execution of the statement finalize and no exception occurs, this method is call for handle the results. |
void |
handleResults(java.sql.ResultSet rs)
Handle the results of query statements. If the statement is of type QUERY (select), then when the execution of the statement finalize and no exception occurs, this method is call for handle the results. |
boolean |
isCaching()
|
boolean |
isCall()
Returs true if this action is a CALL statement |
boolean |
isQuery()
Returs true if this action is a QUERY statement |
boolean |
isUpdate()
Returs true if this action is an UPDATE statement |
void |
setCaching(boolean caching)
|
void |
setErrorHandler(org.j2ee.dao.DAOErrorHandler handler)
This method allows to the action to set a class which manage application errors such as integrity constraint violated. |
void |
setStmtType(int stmtType)
Set of statemnt's type. |
void |
setTO(java.lang.Object to)
REDEFINE THIS METHOD ON EVERY SUBCLASS Set the private attribute, the transfer object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractJdbcDAOAction()
public AbstractJdbcDAOAction(int stmtType)
Method Detail |
public void setTO(java.lang.Object to)
setTO
in interface DAOAction
to
- (The Transfer Object used by the action)public java.lang.Object getTO()
getTO
in interface DAOAction
public void setErrorHandler(org.j2ee.dao.DAOErrorHandler handler)
setErrorHandler
in interface DAOAction
handler
- a instance with the application code to manage the exceptioninterface for a list of the code passed to method
public abstract java.lang.String getSQL()
JdbcDAOAction
getSQL
in interface JdbcDAOAction
public java.lang.Object[] getParameters()
JdbcDAOAction
getParameters
in interface JdbcDAOAction
public int[] getDataTypesForParams()
JdbcDAOAction
getDataTypesForParams
in interface JdbcDAOAction
Types
public int[] getDataTypesForOutParams()
JdbcDAOAction
return new int[] = {NO_OUT_PARAM, Types.VARCHAR};
getDataTypesForOutParams
in interface JdbcDAOAction
Types
public void cachPreparedStatement(java.sql.PreparedStatement pstmt)
cachPreparedStatement
in interface JdbcDAOAction
public java.sql.PreparedStatement getPreparedStatement()
getPreparedStatement
in interface JdbcDAOAction
public int getStmtType()
JdbcDAOAction
getStmtType
in interface JdbcDAOAction
public void setStmtType(int stmtType)
JdbcDAOAction
setStmtType
in interface JdbcDAOAction
stmtType
- one of this (QUERY,UPDATE,CALL_PROCEDURE,CALL_FUNCTION).public boolean isQuery()
JdbcDAOAction
isQuery
in interface JdbcDAOAction
public boolean isUpdate()
JdbcDAOAction
isUpdate
in interface JdbcDAOAction
public boolean isCall()
JdbcDAOAction
isCall
in interface JdbcDAOAction
public void handleResults(java.sql.ResultSet rs) throws java.sql.SQLException
JdbcDAOAction
handleResults
in interface JdbcDAOAction
rs
- ResultSet returned by query.
java.sql.SQLException
public void handleResults(int rowsAffected) throws java.sql.SQLException
JdbcDAOAction
handleResults
in interface JdbcDAOAction
rowsAffected
- Rows affecteds by execution of this action.
java.sql.SQLException
public void handleResults(java.sql.CallableStatement cstmt) throws java.sql.SQLException
JdbcDAOAction
handleResults
in interface JdbcDAOAction
cstmt
- CallableStatement used for execute this call.
java.sql.SQLException
public void execute(org.j2ee.dao.DAOActionProcessor processor) throws DAOException
DAOAction
execute
in interface DAOAction
processor
- (The procesor wich carry out with the action
DAOException
- If there where errorspublic boolean isCaching()
isCaching
in interface JdbcDAOAction
public void setCaching(boolean caching)
setCaching
in interface JdbcDAOAction
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |