|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.osesb.connectors.jdbc.TableSetAdapter
org.osesb.connectors.jdbc.UpdateStatementTableSetAdapter
public class UpdateStatementTableSetAdapter
This Class extends TableSetAdapter with processTableSet() method that executes the configured SQL update statement and returns the result as an Integer for the number of rows that were updated.
If autoCommit is not set on the connection, a commit() is issued after the update succeeds. By default processTableSet() looks for a SQL statement named 'updateStatement' in the SQLStatementListConfiguration portion of the TableSetConfiguration file. To specify a SQLStatement with a different name, configure an adapter property named 'updateStatementName'. If the SQL update statement is parameterized, then processTableSet() looks for the values of the sql parameters in a ProcessingContext variable named sqlStatementName.sqlParameters, where 'sqlStatementName' is the name of the configured SQLStatement. The ProcessingContext variable must be an Object[] with the values for the SQLParameters. The length of the Object[] MUST equal the number of<param>
elements configured for the SQLStatement, however, if the value of the
parameter is configured as a scripted variable or a constant and if the
corresponding entry in the Object[] is null, then the value of the
parameter is not updated, but defers to the configured value.
Note: TableSet(s) and TableSetConfiguration(s) are not generally used stand-alone,
but are included as part of another configuration that accomplishes an integration
function. For example, For example, TableSet(s) are used as operative components in the
org.osesb.scheduledjobs.databasepoller package. A database poller scans
integration tables for changes.
| Field Summary |
|---|
| Fields inherited from class org.osesb.connectors.jdbc.TableSetAdapter |
|---|
log, parentTableSet, tableSetAdapterConfiguration, thisClassName |
| Constructor Summary | |
|---|---|
UpdateStatementTableSetAdapter(TableSet parentTableSet,
TableSetAdapterConfiguration tableSetAdapterConfiguration)
Creates a new instance of UpdateStatementTableSetAdapter. |
|
| Method Summary | |
|---|---|
java.lang.Object[] |
doCustomProcessing(java.lang.Object[] parameters)
Custom processing method. |
static void |
main(java.lang.String[] args)
main() For testing and sandboxing. |
java.lang.Object[] |
processStatement(java.lang.String statementName)
Executes the named SQLStatement configured by the TableSetConfiguration. |
java.lang.Object[] |
processTableSet()
Executes the configured SQL update statement and returns the result as an Object[] where the first element of the array is as an Integer for the number of rows that were updated. |
| Methods inherited from class org.osesb.connectors.jdbc.TableSetAdapter |
|---|
getParentTableSet, logMessage |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UpdateStatementTableSetAdapter(TableSet parentTableSet,
TableSetAdapterConfiguration tableSetAdapterConfiguration)
throws java.lang.Exception
parentTableSet - The TableSet that owns this TableSetAdapter.
java.lang.Exception - if constructed with a null TableSet.| Method Detail |
|---|
public java.lang.Object[] processTableSet()
throws java.lang.Exception
<param>
elements configured for the SQLStatement, however, if the value of the
parameter is configured as a scripted variable or a constant and if the
corresponding entry in the Object[] is null, then the value of the
parameter is not updated, but defers to the configured value.
processTableSet in class TableSetAdapterjava.lang.Exception - if there is a problem with processing the
TableSet SQL.
public java.lang.Object[] processStatement(java.lang.String statementName)
throws java.lang.Exception
<param>
elements configured for the SQLStatement, however, if the value of the
parameter is configured as a scripted variable or a constant and if the
corresponding entry in the Object[] is null, then the value of the
parameter is not updated, but defers to the configured value.
processStatement in class TableSetAdapterstatementName - The name of the SQLStatement to process.
java.lang.Exception - if there is a problem with processing the
TableSet SQL.
public java.lang.Object[] doCustomProcessing(java.lang.Object[] parameters)
throws java.lang.Exception
doCustomProcessing in class TableSetAdapterparameters - Custom processing parameters.
java.lang.Exception - if an error is encountered during custom processing.public static void main(java.lang.String[] args)
args - commandline arguments
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||