flux
Interface DatabaseUpdateAction

All Superinterfaces:
Action, java.lang.Cloneable, DatabaseActionInfo, RuntimeDataMap, java.io.Serializable

public interface DatabaseUpdateAction
extends DatabaseActionInfo

Executes SQL statements in a database. 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.

The Database Update 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
RESULTresultintThe number of rows that were affected by the update.

Author:
Copyright 2014 Flux Corporation. All rights reserved.

Nested Class Summary
static class DatabaseUpdateAction.DatabaseUpdateActionResult
          The result after this action runs.
 
Method Summary
 void addStatement(boolean ignoreError, java.lang.String statement, java.lang.Object... parameters)
          Adds a prepared statement, with optional parameters, to the list of SQL statements to be executed.
 void addStatement(java.lang.String statement, java.lang.Object... parameters)
          Adds a prepared statement, with optional parameters, to the list of SQL statements to be executed.
 java.util.List<java.lang.Integer> getIgnoreErrorStatements()
          Returns the 0-based index numbers of the statements where any executions errors are ignored.
 java.util.List<java.util.List<java.lang.Object>> getParameters()
          Returns parameter lists for each SQL statement to be executed.
 java.util.List<java.lang.String> getStatements()
          Returns a sequence of SQL statements that are used to update a database.
 void setIgnoreErrorStatements(java.util.List<java.lang.Integer> ignoreErrorStatements)
          Sets the 0-based index numbers of the statements where any executions errors are ignored.
 void setParameters(java.util.List<java.util.List<java.lang.Object>> parametersForStatements)
          Sets parameter lists for each SQL statement to be executed.
 void setStatements(java.util.List<java.lang.String> statements)
          Sets a sequence of SQL statements that are used to update a database.
 
Methods inherited from interface flux.DatabaseActionInfo
getDataSource, getDataSourceInitialContextFactory, getDataSourceInitialContextPassword, getDataSourceInitialContextProviderUrl, getDataSourceInitialContextUsername, getDataSourcePassword, getDataSourceUsername, getJdbcDriver, getJdbcPassword, getJdbcUrl, getJdbcUsername, isBuiltinDatabaseConnectionUsed, setBuiltinDatabaseConnectionUsed, setDataSource, setDataSourceInitialContextFactory, setDataSourceInitialContextPassword, setDataSourceInitialContextProviderUrl, setDataSourceInitialContextUsername, setDataSourcePassword, setDataSourceUsername, setJdbcDriver, setJdbcPassword, setJdbcUrl, setJdbcUsername
 
Methods inherited from interface flux.Action
addFlow, addFlow, addSignalFlow, clone, execute, getDescription, getFlows, getHiddenVariableNames, getJoinExpression, getName, getPostscript, getPostscriptLanguage, getPrescript, getPrescriptLanguage, getResultInfo, getSignalsToMonitor, getTimeoutBusinessInterval, getTimeoutBusinessIntervalNamespace, getTimeoutExpression, getVariableManager, isEndOfRun, isJoinPoint, isSkippable, isStartAction, isStartOfRun, isTransactionBreak, removeFlow, reset, setDescription, setElseFlow, setEndOfRun, setErrorFlow, setErrorFlowWithoutRollback, setErrorFlowWithRollback, setJoinExpression, setJoinPoint, setName, setPostscript, setPostscriptLanguage, setPrescript, setPrescriptLanguage, setSignalsToMonitor, setSkippable, setStartAction, setStartOfRun, setTimeoutBusinessInterval, setTimeoutBusinessIntervalNamespace, setTimeoutExpression, setTimeoutFlow, setTransactionBreak, verify, verifyOnClient
 
Methods inherited from interface flux.runtimedatamap.RuntimeDataMap
getRuntimeDataMap, setRuntimeDataMap
 

Method Detail

addStatement

void addStatement(boolean ignoreError,
                  java.lang.String statement,
                  java.lang.Object... parameters)
Adds a prepared statement, with optional parameters, to the list of SQL statements to be executed. When setting statements with parameters on this action, this method is easier to use than setParameters().

Parameters:
ignoreError - Indicates whether an error that occurs when this statement is executed should be ignored.
statement - A prepared statement to be added to the list of SQL stastements to be executed.
parameters - Optional parameters for the prepared statement.

addStatement

void addStatement(java.lang.String statement,
                  java.lang.Object... parameters)
Adds a prepared statement, with optional parameters, to the list of SQL statements to be executed. When setting statements with parameters on this action, this method is easier to use than setParameters().

Parameters:
statement - A prepared statement to be added to the list of SQL stastements to be executed.
parameters - Optional parameters for the prepared statement.

getIgnoreErrorStatements

java.util.List<java.lang.Integer> getIgnoreErrorStatements()
Returns the 0-based index numbers of the statements where any executions errors are ignored. For example, if a "DROP TABLE" statement results in an error if the table does not exist and this error can be safely ignored, the ignore-error-statements list should contain the 0-based index number of the DROP TABLE statement.

Returns:
The 0-based index numbers of the statements where any executions errors are ignored.

getParameters

java.util.List<java.util.List<java.lang.Object>> getParameters()
Returns parameter lists for each SQL statement to be executed. The first parameter list corresponds to the first SQL statement. If a statement has no parameters, an empty list is returned in the appropriate position in the encompassing (outer) list.

Returns:
Parameter lists for each SQL statement to be executed.

getStatements

java.util.List<java.lang.String> getStatements()
Returns a sequence of SQL statements that are used to update a database. The SQL statements are executed directly, without modification, using standard JDBC APIs.

Returns:
A sequence of SQL statements that are used to update a database.

setIgnoreErrorStatements

void setIgnoreErrorStatements(java.util.List<java.lang.Integer> ignoreErrorStatements)
Sets the 0-based index numbers of the statements where any executions errors are ignored. For example, if a "DROP TABLE" statement results in an error if the table does not exist and this error can be safely ignored, the ignore-error-statements list should contain the 0-based index number of the DROP TABLE statement.

Parameters:
ignoreErrorStatements - The 0-based index numbers of the statements where any executions errors are ignored.

setParameters

void setParameters(java.util.List<java.util.List<java.lang.Object>> parametersForStatements)
Sets parameter lists for each SQL statement to be executed. The first parameter list corresponds to the first SQL statement. If a statement has no parameters, a null or empty list is expected in the appropriate position in the encompassing (outer) list.

Parameters:
parametersForStatements - Parameter lists for each SQL statement to be executed.

setStatements

void setStatements(java.util.List<java.lang.String> statements)
Sets a sequence of SQL statements that are used to update a database. The SQL statements are executed directly, without modification, using standard JDBC APIs.

Parameters:
statements - A sequence of SQL statements that are used to update a database.


© 2014 Flux Corporation. All rights reserved.