Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
ngoctuan04th2
Contributor II
Contributor II

Tjava export ResultSetMetaData into excel File

Dear all,

i am using Talend 6.3. i have a Tjava component. in this i execute a command and get result data into

ResultSetMetaData :

//Executing SQL query and fetching the result

Statement st = conn.createStatement();

String sqlStr = context.v_command;

ResultSet rs = st.executeQuery(sqlStr);

ResultSetMetaData rsmd = rs.getMetaData();

And i want also export it to a 1 file excel .

Please give me advise.

Thank you very much!

Labels (4)
1 Reply
Anonymous
Not applicable

Hi

ResultSetMetaData is an object that can be used to get information about the types and properties of the columns in a ResultSet object. What data do you want to export to a file? column types or column names?

If you want to export a string data to a file, build the string on tJava, store the string to a global variable or context variable for used later. In next subjob, get the string data and output it to a file. eg:

tJava

|onsubjobok

tFixedFlowInput--main--tFileOutputExcel

 

Regards

Shong