Six Stars Moe
Six Stars

Pass parameters from tmysql to tjava

Hi,

 

I need to read set of columns from a mysql table and pass their values to a function in java written inside tjava.

 

Thank you.

2 REPLIES
Ten Stars

Re: Pass parameters from tmysql to tjava

Ok, do it!
what are your problems

Francois Denis

Don't forget to tag when it's "solved"!

Fifteen Stars

Re: Pass parameters from tmysql to tjava

Use a tMySQLInput to retrieve your data. Connect this to a tFlowToIterate component. If you have 3 columns in your select called "name", "age", and "date_of_birth", and your row coming from your DB component is called "row1", you will get the following globalMap variables created (these are the keys)....

 

"row1.name"

"row1.age"

"row1.date_of_birth"

 

Connect your tJava to the tFlowToIterate using an iterate link. Then you can access the values from the keys shown above like below (assuming that "name" is a String, "age" is an Integer and "date_of_birth" is a Date)....

 

String nameVal = ((String)globalMap.get("row1.name"));
Integer ageVal = ((Integer)globalMap.get("row1.age"));
Date dobVal = ((Date)globalMap.get("row1.date_of_birth"));

 

Rilhia Solutions