Double-click the first tMysqlConnection
component to show its Basic settings view,
and set the connection details. For more information on the configuration of
tMysqlConnection, see tMysqlConnection.
Note that we use this component to open a connection to a MySQL databased named project_q1.
Configure the second tMysqlConnection
component in the same way, but fill the Database field with project_q2 because we want to use this component to open a
connection to another MySQL database, project_q2.
Double-click the tMysqlInput component to
show its Basic settings view.
- Select the Use an existing connection check box, and leave the Component List box as it is.
Click the [...] button next to Edit schema to open the [Schema] dialog box and define the data structure of the
database table to read data from.
In this example, the database table structure is made of four columns, id (type Integer, 2 characters long), firstName (type String, 15 characters long), lastName (type String, 15 characters long), and city (type String, 15 characters long). When done, click OK to close the dialog box and propagate the schema settings to the next component.
- Fill the Table field with the database table name, customers in this example, and click Guess Query to generate the query statement corresponding to your table schema in the Query field.
In the Dynamic settings view, click the
[+] button to add a row in the table,
and fill the Code field with the code
script of the context variable you just created,
" + context.myConnection + "in this example.
In the Basic settings view of the
tLogRow component, select the Table option for better display effect of the Job
- In the Dynamic settings view of the tMysqlClose component, do exactly the same as in the Dynamic settings view of the tMysqlInput component.