A site about Talend
This MySQL Job template is the first building block in the Talend Cookbook, for database support. Other templates will build on this MySQL Job, with each one introducing new techniques. The methods shown in this Job can be used for other database vendors. Although I'll add support for different vendors at a later data, feel free to use this template to roll your own.
When using this template, I would suggest that you read the documentation for Basic Job Template as this is the basis for all of the Job templates that are described on TalendByExample.
You may download the MySQLJobTemplate and import (Job Designs->Import items) in to a Talend Project of your choice. This download is supported by Talend 5.2.0 and above.
The General Context Group is described in the documentation for Basic Job Template.
To use this template, select this Job in Repository->Job Designs->Palette and right-click to access the Job pop-up menu. Select Duplicate, and choose a new name of your choice. Place your new Job at the main Job Designs level.
To add your own task specific components, you will usually disconnect LibMySQLSharedConnection from DeInitJob (OnSubJobOk) and insert your own components.
InitJob is a place holder tJava component, for placing any initialisation code that your Job may require.
The General Context Group is described in the documentation for Basic Job Template.
To get started with this, create the file$HOME/talend/context/Default.General.cfg
(where $HOME represents the home directory of the user that will execute the Job) and add the following content. You should modify this content, as appropriate.
# www.TalendByExample.com # # This is a sample Talend Context File, for reading by LibContextReader inputDir=/tmp outputDir=/tmp tmpDir=/tmp
This SubJob establishes a shared connection to a MySQL database, as described in the the LibMySQLSharedConnection reference.
To get started with this, create the file $HOME/talend/context/Default.MySQL.cfg
(where $HOME represents the home directory of the user that will execute the Job) and add the following content. You should modify this content, as appropriate.
# www.TalendByExample.com # # This is a sample Talend Context File, for connecting to a MySQL Database mYSQLHost=localhost mYSQLPort=3306 mYSQLDatabase=TalendByExample mYSQLAdditionalJDBCParameters="noDatetimeStringSync=true" mYSQLUsername=root mYSQLPassword=root
DeInitJob is a place holder tJava component, for placing any de-initialisation code that your Job may require.