org.j2ee.dao
Interface JdbcDAOAction

All Superinterfaces:
DAOAction
All Known Implementing Classes:
AbstractJdbcDAOAction

public interface JdbcDAOAction
extends DAOAction

Base interface of real actions.
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:13 $

Version:
$Revision: 1.1.1.1 $
Author:
jvlio (jvlio@users.sourceforge.net)

Field Summary
static int CALL_FUNCTION
           
static int CALL_PROCEDURE
           
static int DDL
           
static int NO_OUT_PARAM
           
static int QUERY
           
static int UPDATE
           
 
Method Summary
 void cachPreparedStatement(java.sql.PreparedStatement pstmt)
           
 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()
           
 java.lang.String getSQL()
          This method define the sql statement to be executed.
 int getStmtType()
          Return of statemnt's type.
 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 setStmtType(int stmtType)
          Set of statemnt's type.
 
Methods inherited from interface org.j2ee.dao.DAOAction
execute, getTO, setErrorHandler, setTO
 

Field Detail

QUERY

public static final int QUERY
See Also:
Constant Field Values

UPDATE

public static final int UPDATE
See Also:
Constant Field Values

CALL_PROCEDURE

public static final int CALL_PROCEDURE
See Also:
Constant Field Values

CALL_FUNCTION

public static final int CALL_FUNCTION
See Also:
Constant Field Values

DDL

public static final int DDL
See Also:
Constant Field Values

NO_OUT_PARAM

public static final int NO_OUT_PARAM
See Also:
Constant Field Values
Method Detail

getSQL

public java.lang.String getSQL()
This method define the sql statement to be executed.

Returns:
SQL Statement

getParameters

public java.lang.Object[] getParameters()
This method retuns the parameters to be setted to sql statement.

Returns:
sql statement parameters values.

getDataTypesForParams

public int[] getDataTypesForParams()
This method retuns the SQL Type for parameters to be setted to sql statement. If this statement has not parameters, null can be returned.

Returns:
sql statement parameters types.
See Also:
Types

getDataTypesForOutParams

public int[] getDataTypesForOutParams()
This method is called when this action is of type CALL_PROCEDURE or CALL_FUNCTION. Retuns the SQL Type for out parameters.
The setings of out parametes begin with the first '?' mark and continue. If the only second '?' is an out parameter, then you can return an array like this:
return new int[] = {NO_OUT_PARAM, Types.VARCHAR};
If this statement has not out parameters, null can be returned.

Returns:
sql statement out parameters types.
See Also:
Types

handleResults

public void handleResults(java.sql.ResultSet rs)
                   throws java.sql.SQLException
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.

Parameters:
rs - ResultSet returned by query.
java.sql.SQLException

handleResults

public void handleResults(int rowsAffected)
                   throws java.sql.SQLException
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.

Parameters:
rowsAffected - Rows affecteds by execution of this action.
java.sql.SQLException

handleResults

public void handleResults(java.sql.CallableStatement cstmt)
                   throws java.sql.SQLException
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.

Parameters:
cstmt - CallableStatement used for execute this call.
java.sql.SQLException

getStmtType

public int getStmtType()
Return of statemnt's type.

Returns:
one of this (QUERY,UPDATE,CALL_PROCEDURE,CALL_FUNCTION).

setStmtType

public void setStmtType(int stmtType)
Set of statemnt's type.

Parameters:
stmtType - one of this (QUERY,UPDATE,CALL_PROCEDURE,CALL_FUNCTION).

isQuery

public boolean isQuery()
Returs true if this action is a QUERY statement


isUpdate

public boolean isUpdate()
Returs true if this action is an UPDATE statement


isCall

public boolean isCall()
Returs true if this action is a CALL statement


isCaching

public boolean isCaching()

setCaching

public void setCaching(boolean caching)

cachPreparedStatement

public void cachPreparedStatement(java.sql.PreparedStatement pstmt)

getPreparedStatement

public java.sql.PreparedStatement getPreparedStatement()


Copyright © 2004 DAO Action Patterm. All Rights Reserved.