DB2 Connector Setup
DB2 Connector Setup
The DB2 connector allows you to integrate DB2 into your data flow by pushing or pulling data from DB2. Follow the steps below to connect CData Arc to DB2.
Establish a Connection
To allow Arc to use data from DB2, you must first establish a connection to DB2. There are two ways to establish this connection:
- Add a DB2 connector to your flow. Then, in the settings pane, click Create next to the Connection drop-down list.
- Open the Arc Settings page, then open the Connections tab. Click Add, select DB2, and click Next.
- The login process is only required the first time the connection is created.
- Connections to DB2 can be re-used across multiple DB2 connectors.
Enter Connection Settings
After opening a new connection dialogue, follow these steps:
Provide the requested information:
- Name — The static name of the connection. Set this as desired.
- Type — This is always set to DB2.
- Server — The address of the DB2 server you want to connect to.
- Port — The port to use when connecting to the server.
- Database — The name of the database you want to target.
- User — The username to use for logging in.
- Password — The password for the user entered above.
- Other — Other authentication information if needed.
If needed, click Advanced to open the drop-down menu of advanced connection settings. These should not be needed in most cases.
Click Test Connection to ensure that Arc can connect to DB2 with the provided information. If an error occurs, check all fields and try again.
Click Add Connection to finalize the connection.
In the Connection drop-down list of the connector configuration pane, select the newly-created connection.
Click Save Changes.
Select an Action
After establishing a connection to DB2, you must choose the action that the DB2 connector will perform. The table below outlines each action and where it belongs in an Arc flow.
|Action||Description||Position in Flow|
|Upsert||Inserts or updates DB2 data. By default, if a record already exists in DB2, an update is performed on the existing data in DB2 using the values provided from the input.||End|
|Lookup||Retrieves a value from DB2 and inserts that value into an already-existing Arc message in the flow.
The Lookup Query determines what value the connector will retrieve from DB2. It should be formatted as a SQL query against the DB2 tables.
|Select||Retrieves data from DB2 and brings it into Arc.
You can use the Filter panel to add filters to the Select. These filters function similarly to WHERE clauses in SQL.
|Execute Stored Procedures||Treats data coming into the connector as input for a stored procedure, and then passes the result down the flow.
You can click the Show Sample Data button to provide sample inputs to the selected Stored Procedure and preview the results.