Skip to main content Skip to complementary content
  • New archived content: Talend MDM, Talend Data Catalog 8.0, and Talend 7.3 products reached their end of life in 2024. Their documentation was moved to the Talend Archive page and will no longer receive content updates.
Close announcements banner

Creating a data integration Job

In this section, a data integration Job is created to insert data into a MySQL database.

Adding and linking components

Procedure

  1. From the palette, place the following components onto the design workspace:
    • a tPrejob,
    • a tMysqlConnection,
    • a tRouteInput,
    • a tMap,
    • a tLogRow,
    • a tMysqlOuput,
    • a tPostjob,
    • a tMysqlClose.
    Link them together with the Row > Main connection.
    Screenshot of the Job in the design workspace.
  2. Link the tPrejob component to the tMysqlConnection component using a Trigger > On Component Ok connection to build the pre-job.
  3. Link the tRouteInput component to the tMap component using a Row > Main connection.
  4. Connect the tMap component to the tLogRow component using the Row > New Output (Main) connection and name the output connection as row2.
  5. Link the tLogRow component to the tMysqlOuput component using a Row > Main connection.
  6. Link the tPostjob component to the tMysqlClose component using a Trigger > On Component Ok connection to build the post-job.
    Information noteWarning:

    The use of tMysqlClose in the post-job as shown above in the Route-Job example is not valid for Data Service operation Jobs containing tESBProviderRequest, tESBProviderResponse, tESBProviderFault, or tRestRequest components. In these kind of Jobs it is not recommended to use close connection components like tMySQLClose. Because closing datasource connection is implemented directly in the tESBProvider* and tRestRequest components.

Configuring the pre-job

In the pre-job, the component does not have any parameter or property to configure. It just initialize the connection to the MySQL database before the execution of the main Job. As a result, all the required configurations are made in the tMysqlConnection component.

Procedure

  1. Double-click tMysqlConnection to open its Basic settings view in the Component tab.
    Basic settings view.
  2. Set the database connection details in the relevant fields, including the host name or IP address of your database server, the listening port number, the database name, the username and password for your database authentication.
    These connection parameters are used when you run the Route to call this Job in Talend Studio. If you want to deploy the Route and the Job in Talend Runtime, you can leave these parameters empty and go to the next step directly.
  3. Select the Specify a data source alias check box and enter the data source alias, which is set in the datasource configuration file in Talend Runtime.
  4. In the Advanced Settings tab, select the Auto Commit check box to commit any changes to the database automatically upon the transaction.
    Advanced settings view.

Configuring the main Job

Procedure

  1. Double-click tRouteInput to open its Basic settings view in the Component tab.
    Basic settings view.
  2. Click [...] next to Edit Schema. In the schema dialog box, click the plus button to add a new line of String type and name it body. Set the length of this column to 50. Click OK to close the dialog box.
    Schema dialog box.
  3. In the Simple Expression column for the body element, enter "${in.body}" to get the body of the input message from the Route.
  4. Double-click tMap to open the tMap editor.
    tMap editor.
  5. In the lower right corner of the tMap editor, click [+] to add a column of String type in the output table and name it welcomeText. Set the length of this column to 50.
  6. In the upper left corner of the editor, select the body column and place it to the output table. In the Expression field of the output table, add + " Talend!" as the welcome text. When done, click OK to validate your changes, close the editor and propagate the changes to the next component.
    The tLogRow component is used to monitor data processed and does not need any configuration.
  7. Double-click tMysqlOuput to open its Basic settings view in the Component tab.
    Basic settings view.
  8. Select the Use an existing connection check box and select the tMysqlConnection_1 in the Component List to reuse the connection details that you have already set. In the Table name field, enter Hello as the name of the table to be created. Select Drop table if exists and create in the Action on table list, and select Insert in the Action on data list. Click Sync columns to retrieve the schema set in the tMap.

Configuring the post-job

In the post-job, the tPostjob component does not have any parameter or property to configure. It just closes the database connection.

Procedure

  1. Double-click tMysqlClose to open its Basic settings view in the Component tab.
    Basic settings view.
  2. The Component List is already filled in with tMysqlConnection_1. Keep this setting and press Ctrl+S to save your Job.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!