|
||||||||||||
| 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 DAOActionto - (The Transfer Object used by the action)public java.lang.Object getTO()
getTO in interface DAOActionpublic void setErrorHandler(org.j2ee.dao.DAOErrorHandler handler)
setErrorHandler in interface DAOActionhandler - a instance with the application code to manage the exceptioninterface for a list of the code passed to methodpublic abstract java.lang.String getSQL()
JdbcDAOAction
getSQL in interface JdbcDAOActionpublic java.lang.Object[] getParameters()
JdbcDAOAction
getParameters in interface JdbcDAOActionpublic int[] getDataTypesForParams()
JdbcDAOAction
getDataTypesForParams in interface JdbcDAOActionTypespublic int[] getDataTypesForOutParams()
JdbcDAOActionreturn new int[] = {NO_OUT_PARAM, Types.VARCHAR};
getDataTypesForOutParams in interface JdbcDAOActionTypespublic void cachPreparedStatement(java.sql.PreparedStatement pstmt)
cachPreparedStatement in interface JdbcDAOActionpublic java.sql.PreparedStatement getPreparedStatement()
getPreparedStatement in interface JdbcDAOActionpublic int getStmtType()
JdbcDAOAction
getStmtType in interface JdbcDAOActionpublic void setStmtType(int stmtType)
JdbcDAOAction
setStmtType in interface JdbcDAOActionstmtType - one of this (QUERY,UPDATE,CALL_PROCEDURE,CALL_FUNCTION).public boolean isQuery()
JdbcDAOAction
isQuery in interface JdbcDAOActionpublic boolean isUpdate()
JdbcDAOAction
isUpdate in interface JdbcDAOActionpublic boolean isCall()
JdbcDAOAction
isCall in interface JdbcDAOAction
public void handleResults(java.sql.ResultSet rs)
throws java.sql.SQLException
JdbcDAOAction
handleResults in interface JdbcDAOActionrs - ResultSet returned by query.
java.sql.SQLException
public void handleResults(int rowsAffected)
throws java.sql.SQLException
JdbcDAOAction
handleResults in interface JdbcDAOActionrowsAffected - 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 JdbcDAOActioncstmt - CallableStatement used for execute this call.
java.sql.SQLException
public void execute(org.j2ee.dao.DAOActionProcessor processor)
throws DAOException
DAOAction
execute in interface DAOActionprocessor - (The procesor wich carry out with the action
DAOException - If there where errorspublic boolean isCaching()
isCaching in interface JdbcDAOActionpublic void setCaching(boolean caching)
setCaching in interface JdbcDAOAction
|
||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||