Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 8 JDBC Palette : JDBC Update

JDBC Update
Activity
The JDBC Update activity performs the specified SQL INSERT, UPDATE, or DELETE statement.
If this activity is not part of a transaction group, the SQL statement is committed after the activity completes. If this activity is part of a transaction group, the SQL statement is committed or rolled back with the other JDBC activities in the group at the end of the transaction. See TIBCO ActiveMatrix BusinessWorks Process Design for more information about creating groups for transactions.
If you want to override the default behavior of transaction groups for certain JDBC activities in a transaction group, you can check the Override Transaction Behavior field on the Advanced tab. This specifies that the activity is outside of the transaction and the SQL statement is committed when the activity completes, even if the activity is in a transaction group.
Configuration
The Configuration tab has the following fields:
See Prepared Parameters for a description of this field.
Prepared Parameters
If you want to replace static names in the SQL statement with process variables, you must edit the SQL statement field and replace the variable items with a question mark (?). For example, you might specify the following statement:
 
UPDATE emp SET ename = ?, phone = ?
   WHERE id = ?
The ? replaces the value, and you can then provide input to the SQL statement from process data on the input tab.
When you add or remove question marks in SQL statements, a warning appears to the right of the Prepared Parameters field ("SQL/ Prepared Parameter Count Mismatch") to alert you to add or remove corresponding prepared parameters. Each prepared parameter corresponds to the question mark in the same position in the SQL statement. That is, the first prepared parameter in the list corresponds to the first question mark, the second prepared parameter in the list corresponds to the second question mark, and so on. The warning is for informational purposes only, you must make sure the parameters in this field correctly correspond to the SQL statement.
You can optionally specify names for each prepared parameter. By default, the prepared parameters are named Prepared_Param_1, Prepared_Param_2, and so on.
You must supply the datatype of each parameter to the SQL statement, and this datatype is used in the input schema for the statement. You can use the up or down arrow keys to move a specified datatype to the previous or next parameter. You can also select a contiguous set of parameters to move them up or down, or delete them with the delete button.
At run time, any parameters you place in the SQL statement are replaced with the mapped values for those parameters.
For INSERT and DELETE statements, all prepared parameters appear as required items in the Input tab. For UPDATE statements, all prepared parameters appear as optional in the Input tab, but you must supply a value for at least one column in the statement or a runtime error occurs.
Advanced
The Advanced tab has the following fields:
Note: Many databases treat empty strings and nulls as the same, so this field will not affect how the database interprets empty strings.
Input
The input for the activity is the following:
Specifies the time zone for the database server. See Time Zone Construction for more information about how time zones are constructed using this field.
Output
The output for the activity is the following:
This is an optional element that appears only when the property java.property.bw.activity.output.stats.elapsedTime.JDBCUpdateActivity is set to true in designer.tra. For run-time, set the property to true in the bwengine.tra file. By default, the property is set to false.
You can turn off the property and not calculate the elapsed time at run-time by setting the property java.property.bw.activity.output.stats.elapsedTime.turnoff in the bwengine.tra file. However, note that setting this property will turn off the calculation of elapsed time at run-time for all the JDBC activities.
Error Output
The Error Output tab lists the possible exceptions that can be thrown by this activity. See TIBCO ActiveMatrix BusinessWorks Error Codes for more information about error codes and corrective action to take.

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved