Description
The SQLUpdateV2Receiver connects to a database and performs batched updates. This Receiver is useful for data replacement of values within a database table to guarantee data security.
NOTE: This Receiver can also create a database table for any kind of database. To see an example, click here.
In This Article
- Receiver Parameters
- JDBC Configuration File
- Example JDBC Configuration File
- Receiver Attribute Property Keys
- Defining an SQL Update statement
- Defining a Create Table Statement
Receiver Parameters
The following parameters can be defined for the SQLUpdateV2Receiver. Items with an asterisk (*) are required.
- resourcePath* - Defines the directory path where the Resource file is located.
- resourceSubDir - Defines an optional subdirectory under the resourcePath where the Resource file exists.
- resourceName* - Defines the name of the resource that contains the database connection information on a user's local machine.
JDBC Configuration File
This Receiver uses a configuration file located on the user's local computer as a resource to attain the necessary information for connecting to a user's local database via JDBC. The required properties to connect to a database via JDBC are the following:
- driver - The path and file name of the JDBC library for the database to connect to.
- user - The name used to connect as a user to the database.
- password - The password used to connect as the given user to the database.
- url - The JDBC universal resource locator is required to connect to the given database.
- batchCount - Defines the number of rows of generated data that are batched together before writing to the database.
Example JDBC Configuration File
Below is an example of a JDBC configuration file defined to connect to a MySQL database called acme:
driver=com.mysql.jdbc.Driver
user=root
password=openSaysMe
url=jdbc:mysql://localhost:3306/acme
batchCount=1000
Receiver Attribute Property Keys
The Receiver defines one property key that can be modified on any of its associated Domain Attributes:
- variable - Determines if the Attribute will be used as a variable within the update statement. Up to 20 attributes may be assigned to a variable (var1 - var20). The default is 'noVar', meaning the Attribute will not be used.
Defining an SQL Update statement
The update statement is defined on the Receiver's Data Tab. This information has been defined for the following Domain and Attributes:
Example: SQL Update Statement
Attributes whose values will be used in the update statement are assigned a variable from var1 to var20.
Defining a Create Table Statement
The create table statement is defined on the Receiver's Data Tab. This information has been defined for the following Domain and Attributes:
The example below creates a MySQL database table. To see a step-by-step example, click here.
IMPORTANT: Make sure the correct syntax is used for the database table that is being created.