How to call a java class.method from within Talend

Four Stars

How to call a java class.method from within Talend

Hello,
I've imported into Routines, a java class that was created outside of Talend. Here's what it looks like:
~~~~~~~~~~~~~~~~~~~~~~~~~~~
package routines;
imports....;

public class PutTokenBI {

public static void main(String args[])
{
new PutTokenBI();
System.exit(0);
}
public PutTokenBI()
{
PreparedStatement insertURL = null;
Statement stmt = null;
try
{
.... code....
}
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~
I'm having trouble calling this class.method (PutTokenBI / PutTokenBI()) from within tjava. I expected that something like this would work:
PutTokenBI PutTokenBIobj = new PutTokenBI();
PutTokenBIobj.PutTokenBI();
Didn't work.
Also, should the class have the constructor (as above) or should this be commented out since it's being called from the Routines?
Thanks a lot...
One Star

Re: How to call a java class.method from within Talend

Hi
This java class should be a jar file first.
Right click on this custom routine and select "Edit routine libraries" to browser this jar file.
Then use "import ..." at the top of custom routine.
Regards,
Pedro