|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DatabaseStoredProcedureAction
Calls a stored procedure and makes the results of the stored procedure, if any, available to the flow context.
For this purpose, the database connection available to the flow context can be used, or alternately, database connection information can be provided to connect to a data source or use a direct JDBC connection. When this action runs, there are potentially two kinds of output: OUT parameters and a JDBC result set. OUT parameters return data from the stored procedure after it is called. They must be registered before the stored procedure is called, and they are made available in the result object. If there are no OUT parameters registered, no outputs are made available. Not all stored procedures return data through OUT parameters. Additionally, the stored procedure may return a JDBC result set. If it does, it is returned as a facade over a JDBC result set. The facade exposes the first row of data returned by the SQL SELECT statement. Each time the current execution flow context reaches this action again, the next row in the JDBC result set is fetched. Finally, when the JDBC result set is exhausted, the result set is closed. The result set is also closed when the current execution flow context reaches a transaction break, since JDBC result sets must be closed before the open transaction commits. Once the JDBC result set is closed, the next time the current execution flow context executes this action, the SQL SELECT statement is issued again, and the entire process repeats. Open JDBC result sets are stored in a transient flow context variable whose name is referenced from DatabaseStoredProcedureAction.RESULT_SET_FLOW_CONTEXT_KEY. Note: this action does not provide access to any returned JDBC result sets beyond the first one. Also, stored functions are not supported. Contact support@flux.ly if you would like either of these features added to this action. The Database Stored Procedure Action returns its result in the flow context variable "RESULT". The following table contains more information on accessing and using the result.Flow Context Variable | Field | Java Type | Description |
---|---|---|---|
RESULT | result | boolean | A boolean value indicating whether there are more results available in the underlying JDBC result set. |
RESULT | outParameters | java.util.List<java.lang.Object> | A List representing the OUT parameters from the stored procedure call. |
RESULT | row | java.util.List<java.lang.Object> | A List representing the current row in the result set. |
Nested Class Summary | |
---|---|
static class |
DatabaseStoredProcedureAction.DatabaseStoredProcedureActionResult
A facade over OUT parameters and a JDBC result set, which are returned after an SqlStoredProcedureAction runs. |
Field Summary | |
---|---|
static java.lang.String |
RESULT_SET_FLOW_CONTEXT_KEY
The key to a flow context variable that may hold an open JDBC result set from a previous iteration over this action within the same transaction. |
Method Summary | |
---|---|
Flow |
addFlow(Action action)
The flow that is followed when this Database Stored Procedure Action fires. |
java.util.List<java.lang.Object> |
getParameters()
Returns the parameters that are supplied to a stored procedure call. |
java.util.Map<java.lang.Integer,java.lang.Integer> |
getRegisteredInoutParameters()
Returns positional and type information about this stored procedure's registered IN-OUT parameters. |
java.util.Map<java.lang.Integer,java.lang.Integer> |
getRegisteredOutParameters()
Returns positional and type information about this stored procedure's registered OUT parameters. |
int |
getRegisteredOutParameterSqlType()
Returns the registered OUT parameter's SQL type, taken from java.sql.Types, in the common case where there is only one registered OUT parameter and it is the last parameter in the stored procedure signature. |
int |
getStoredFunctionResultSqlType()
If this stored procedure is a stored function, returns the stored function's result SQL type, taken from java.sql.Types. |
java.lang.String |
getStoredProcedureCall()
Returns the signature of the stored procedure call that is used to invoke a stored procedure on a database. |
void |
setParameters(java.util.List<java.lang.Object> parameters)
Sets the parameters that are supplied to a stored procedure call. |
void |
setRegisteredInoutParameters(java.util.Map<java.lang.Integer,java.lang.Integer> inoutParameters)
Sets positional and type information about this stored procedure's registered IN-OUT parameters. |
void |
setRegisteredOutParameters(java.util.Map<java.lang.Integer,java.lang.Integer> outParameters)
Sets positional and type information about this stored procedure's registered OUT parameters. |
void |
setRegisteredOutParameterSqlType(int sqlType)
Sets the registered OUT parameter's SQL type, taken from java.sql.Types, in the common case where there is only one registered OUT parameter and it is the last parameter in the stored procedure signature. |
void |
setStoredFunctionResultSqlType(int sqlType)
If this stored procedure is a stored function, sets the stored function's result SQL type, taken from java.sql.Types. |
void |
setStoredProcedureCall(java.lang.String storedProcedureCall)
Sets the signature of the stored procedure call that is used to invoke a stored procedure on a database. |
Methods inherited from interface flux.runtimedatamap.RuntimeDataMap |
---|
getRuntimeDataMap, setRuntimeDataMap |
Field Detail |
---|
static final java.lang.String RESULT_SET_FLOW_CONTEXT_KEY
Method Detail |
---|
Flow addFlow(Action action)
addFlow
in interface Action
action
- The flow that is followed when this Database Stored Procedure
Action fires.
DatabaseStoredProcedureAction.DatabaseStoredProcedureActionResult
,
Action.addFlow(Action, String)
,
EngineHelper.useLastResult(String)
java.util.List<java.lang.Object> getParameters()
java.util.Map<java.lang.Integer,java.lang.Integer> getRegisteredInoutParameters()
java.util.Map<java.lang.Integer,java.lang.Integer> getRegisteredOutParameters()
int getRegisteredOutParameterSqlType()
int getStoredFunctionResultSqlType()
java.lang.String getStoredProcedureCall()
void setRegisteredInoutParameters(java.util.Map<java.lang.Integer,java.lang.Integer> inoutParameters)
inoutParameters
- Positional and type information about this stored
procedure's registered IN-OUT parameters. A null map
is treated the same as an empty map.void setRegisteredOutParameters(java.util.Map<java.lang.Integer,java.lang.Integer> outParameters)
outParameters
- Positional and type information about this stored
procedure's registered OUT parameters. A null map is
treated the same as an empty map.void setRegisteredOutParameterSqlType(int sqlType)
sqlType
- The SQL type, taken from java.sql.Types, for the registered
OUT parameter.void setParameters(java.util.List<java.lang.Object> parameters)
parameters
- The parameters that are supplied to a stored procedure
call.void setStoredFunctionResultSqlType(int sqlType)
sqlType
- The SQL type, taken from java.sql.Types, if this stored
procedure is a stored function.void setStoredProcedureCall(java.lang.String storedProcedureCall)
storedProcedureCall
- The signature of the stored procedure call that
is used to invoke a stored procedure on a
database.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |