Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Talend as part of another application

Hey I have been using talend a little and I want to use it as part of another Eclipse application. Pretty much I want to take a job and call it from another java program. I could use system to do this but, that is not very portable and I need my application to be portable. Is there any good way to use a talend job inside another java program?

Labels (1)
33 Replies
Anonymous
Not applicable
Author

I published a first version of the code at sourceforge http://sourceforge.net/projects/talendjobschedu/.
If you have any question please contact me (until I wrote a documentation).

hi Volker,
i had a look on sf.net and i can not find any file related to this project. could you please post a link to the location of these files?
many thanks,
Nicolas
Anonymous
Not applicable
Author

Hi
I nedd call Talend inside an java program, but couldn't use.
Can give me more explanation.
I followed all the steps on slides but I can't running after the slides 8 and 9. What
can I be doing wrong?
My java programming don't call the talend.
Thanks!
_AnonymousUser
Specialist III
Specialist III

I wrote this article on my blog : http://www.tchogy.fr/2011/03/talend-integration-dans-une-application-j2ee/
It explains how to launch dynamically a job from a J2EE application.
Anonymous
Not applicable
Author

Nice article!
Thinking of an enhancement for a future version of TOS related to the generated java code of the job... It would be nice to be able to provide hooks to the job (regular property with getter/setter) in order to use dependency injection (and be able to load a Talend job from an application context provided by the Spring Framework). -- More on this in the comment I left on your article.
I like the direction where this is going...
Regards,
Daniel
janhess
Creator II
Creator II

I wrote this article on my blog : http://www.tchogy.fr/2011/03/talend-integration-dans-une-application-j2ee/
It explains how to launch dynamically a job from a J2EE application.

Shame it's not in English.
Anonymous
Not applicable
Author

Hi thank you for your topic
i have a problem doing a task with java
indeed i expotred the job in java and when i execute it it gives me the following error
Exception in component tMysqlOutput_1
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "null"'.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
at com.mysql.jdbc.Util.getInstance(Util.java:384)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:929)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:298)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at importationsql.job1_0_1.job1.tFileInputDelimited_1Process(job1.java:712)
at importationsql.job1_0_1.job1.runJobInTOS(job1.java:1212)
at importationsql.job1_0_1.job1.main(job1.java:1066)
at Talend.main(Talend.java:9)
Caused by: java.lang.NumberFormatException: For input string: "null"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at com.mysql.jdbc.NonRegisteringDriver.port(NonRegisteringDriver.java:814)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:289)
... 6 more

Help me please
Anonymous
Not applicable
Author

HI,
I tried this solution and it works but not with Jobs that use contexts.
I want to develop an interface in java with eclipse where it will be easier to call jobs with defaults contexts (context can be alterable).
I use contexts for the connection to the data base, to define a paths....
So i would know if someone find how to call jobs with contexts with this code?
(I already know how to execute then in command line in windows terminal)
Thanks
Hello lotu
Thanks for your interesting in Talend.
You can not only call a Java program in a Talend job, but also call a Talend job in a Java program. You can simply follow the steps below:
1) Create a simple job in TOS.(see screenshot1)
2) Export the job Java script.(see screenshot 2 and 3)
3) Unzip the Java script file on current folder.
4) Launch Eclipse and create a new Java project, then create a class 'Talend.java'.(see screenshot4)
5) Right click on test and select 'Build Path'-->'Configure Build Path'. (see screenshot 5)
6) Click on 'Add External Jars' button to import the jar file 'myjob_0_1.jar' (under myJob_0.1\myJob_0.1\myJob) and all the jar files (under myJob_0.1\myJob_0.1\lib) (see screenshot 6 and 7)
7) Type in the Java code in class 'Talend.java' (see screenshot 😎
public class Talend
{
public static void main(String[] args)
{
shong.myjob_0_1.myJob.main(new String[]{});
}
}

Here you will notice that:
shong: Talend project name
myjob_0_1: jar file name
myJob: Talend job name
😎 Finally, run the Java program.(see the screenshot 9)
Best regards
shong
Anonymous
Not applicable
Author

hi zanka131
Take a look at this topic to know how to pass value to context variable when calling Talend job in Eclipse.
https://community.talend.com/t5/Design-and-Development/Reading-java-or-protobuf-object/td-p/63511
Shong
Anonymous
Not applicable
Author

Thanks, 0683p000009MACJ.png
Until now, I was able to load file.properties of the Job with the java.util.properties but after that I didn't know how to use it in the main which launch the Job.
Thanks again, it works very well and with less encoding line. 0683p000009MA9p.png
_AnonymousUser
Specialist III
Specialist III

Thanks for the nice post! I actually was able to run a talend job from within Java application.
However, I have a question. When we pass context variables to a job which is run from withing
another java app, can we pass variables other than String? For example Java objects.. like File, or List?