Wednesday, 18 September 2013

Talend - tLibraryLoad - Load multiple external jar / libraries files using tLibraryLoad component


Load multiple external jar files using tLibraryLoad component

We want to load multiple external jar files in our job as we have code which uses these jar files. We can do it using tLibraryLoad component. This component helps us in loading these external jar files.
you can put these jar files in ...talendinstall/lib/java folder or your classpath.

For mentioning multiple external jar files use advance settings option in tLibraryLoad component.






 

Thursday, 12 September 2013

Talend: Convert integer to string (primitive type and non primitive type)


Talend: Convert integer to string (primitive type and non primitive type)

One of the most common thing which you would mostly end up needing in your talend job is to convert integer to string. In java this is very simple using inbuild methods but we need to be little aware of data type of integer - whether it is int/integer. Based on datatype the method used is different. however there could be other ways possible to do same.

int i;
i=10;
String str1;
str1=Integer.toString(i);
System.out.println(str1);

Integer i1;
i1 = 20;
str1=i1.toString();
System.out.println(str1);





Talend: print current system date in tJava using system.out.println



Talend: print current system date in tJava using system.out.println

We often have a need to print date on console output using tJava in job - this can be done for logging or for debugging purpose. There are many options available, i will mention some quick ones below.

System.out.println(new Date());
System.out.println(TalendDate.getCurrentDate());