This article demonstrates how to use the Use and register a shared DB Connection feature to share DB connection between a parent Job and a child Job. With this feature, you can benefit from the following advantages:
This procedure was written with:
Talend verified this procedure to be compatible with Data Integration releases starting from v4.2.3.
In this tutorial, you create two Jobs to learn how to use the 'Use or register a shared DB connection' feature. Call them ParentJob and ChildJob. Using a Mysql database as an example, the detailed Job settings are described below.
Note: This example Job is also available in the attached zip file.
Note: You don't need to set the DB connection parameters such as Host on this component. Allow them to be empty, as the component will use a shared DB connection.
Executing the ParentJob Job inserts data into the "person" table from the parent job that are then read from the child job, and are displayed on the console.
Starting job ParentJob at 11:59 11/01/2014. [statistics] connecting to socket on port 3699 [statistics] connected .--+-------. |tLogRow_1 | |=-+------=| |id|name | |=-+------=| |1 |Shong | |2 |Elise | |3 |Pedro | |4 |Patrick| |5 |Dave | '--+-------' [statistics] disconnected Job ParentJob ended at 11:59 11/01/2014. [exit code=0]