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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Dobby1
Contributor III
Contributor III

Modify the JAVA Code and regenerate the .jar

Hi I need to make a few minor modifications to the JAVA code generated by Talend and then regenerate the JAR file to test a performance issue that I am experiencing. When I build the Job, I see the source JAVA file and I am able to make the modification that I need and so my question is how would I go about rebuilding the .jar file from that modified .java source code?

 

When I try to run: javac <jobname>.java I get a bunch of errors "error: package routines does not exist ...import routines.DataOperation;...."

 

The modifications I want to make are:

  1. Print the actual SQL prepared statement that is being sent to the database to do the insert
  2. Print the time it takes to create the batch of records to be inserted
  3. Print the time it takes to commit the records to the database
  4. Change pstmt_tDBOutput_1.setNull(1, java.sql.Types.DATE); to pstmt_tDBOutput_1.setNull(1, java.sql.Types.TIMESTAMP);

 

I am on Windows and using Talend Studio Version: 7.2.1.

Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi
You can not modify the generated Java code of job, the change will be not be saved.
you can modify the source files of component, the source files of official components are located in <studio installation>\plugins\org.talend.designer.components.localprovider_7.1.1.20181026_1147\components.
About component development, please refer to this documentation.
https://help.talend.com/reader/2zoPbB~8uGpH2pU_w0z6Bg/d006zJ6FDVR1cGuZlwiwHQ

Note that don't forget to backup the component folder before you modify the component.

Regards
Shong

View solution in original post

4 Replies
Anonymous
Not applicable

Hi
You can not modify the generated Java code of job, the change will be not be saved.
you can modify the source files of component, the source files of official components are located in <studio installation>\plugins\org.talend.designer.components.localprovider_7.1.1.20181026_1147\components.
About component development, please refer to this documentation.
https://help.talend.com/reader/2zoPbB~8uGpH2pU_w0z6Bg/d006zJ6FDVR1cGuZlwiwHQ

Note that don't forget to backup the component folder before you modify the component.

Regards
Shong
Dobby1
Contributor III
Contributor III
Author

Thank you. I have looked in the directory and have seen the files. I'm trying to see exactly which file I need to modify and how I need to modify it.

Dobby1
Contributor III
Contributor III
Author

Thank you very much. I was able to modify the appropriate javajet file and got the results I wanted.

Dobby1
Contributor III
Contributor III
Author

Hi,

 

After modifying the .javajet file do I need to perform any other step for Talend to pickup the change to the component? I changed the following lings in the below files but I don't think it is reflected in the generated code.

 

---------- TMSSQLOUTPUT_END.JAVAJET

[168] <%=prefix+cid%>.setNull(count<%=cid%>,java.sql.Types.DATE);

 

---------- TMSSQLOUTPUT_MAIN.JAVAJET

[170] <%=prefix+cid%>.setNull(counter<%=cid%>,java.sql.Types.DATE);

 

The java.sql.Types.DATE was changed to java.sql.Types.TIMESTAMP.