Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Call external Java method in routine, keep db connection

Hi !!

I have a subjob in Talend, which connect to MySQL get some records to iterate with a name I use to generate PDFs files. We have a external JAR we develope in Java that generate the PDF file. This PDF design can change, so we load the jar in external folder, so Talend load from there the JAR, and generate the PDF, with the last modifications in design.

The problem is that I can load the external JAR, and call the method inside the class that generate the PDF file, but I trying to connect to database inside JAR, and I got error when trying to use the Talend side connection inside external jar.

I have also tried to connect-disconnect to database inside the JAR and I got error when trying to open connection.

 

How can I call external JAR that connect to same database without database connection error?

 

 

0683p000009Ma0j.png

 

I am loading JAR in z_rutina_pdfHorario, which contains a tJava calling a routine:

 

0683p000009Ma17.png

 

I am trying to execute the method generaPDF, from file InformeSIF.jar which always have generaPDF method, but this implementation change. So the file can change. I need Talend load this .jar and call method keeping database connection.

 

One curious thing I have notice, if I put a breakpoint in z_rutina_pdfHorario, and go step by step, until the first iterate finish, I got PDF files generate correctly, and if I continue with execution, all PDFs are generated correctly. But if I run the job directly, it give me error and generate empty PDFs.

 

Any ideas? Sorry about my english.

Thanks in advance.

Labels (6)
0 Replies