Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calling java codes in Qlikview directly

Hi,

I am new to Qlikview. I have a set of java codes which generate a report by extracting data from a sql database. I need to re generate the same report in Qlikview.

So i just want to know if there is a way to call (compile and execute) these java codes directly in qlikview instead of re writing the whole code in sql. If anyone is aware of any documentation or links which explain this, then could you please share them with me.

Regards,

Shanthi 

7 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

One approach would be to wrap the java code as a web service and call the web service from the QV load.

-Rob

rbecher
MVP
MVP

Btw. you can start an external program in the load script:

execute cmd.exe /C "java -jar myclass.jar";

- Ralf

Astrato.io Head of R&D
Not applicable
Author

Thank you Rob and Ralf for your quick replies. I will try both methods and will post my doubts/results here.

Regards,

Shanthi

Not applicable
Author

Hello Ralf,

can we run a jar file from qv load script and consume the output in qlikview ?

For example:

If my jar is encrypting the data, I would like to consume the encrypted data and display in my dashboard.

and in my second jar i have the decryption code, which when called need to display decrypted data.

Let me know if there is an alternate way to do this. The restriction is I can only use java .

Appreciate all your help.

Thanks

Piyush

rbecher
MVP
MVP

Hi Piyush,

I think you could write a Java program which either de- or encrypts the data with your lib and stores it as CSV which you call in load script:

execute cmd.exe /C "java -jar myprogram.jar";

Or, you write a JDBC wrapper driver (or we can do this) which does the job (de- or encryption) on the resultset and then use our JDBC connector to stream the data directly into QlikView. In this case there will no data written persisent to disk outside of QlikView like in the first case.

- Ralf

Astrato.io Head of R&D
Not applicable
Author

Thanks Ralf,

But we don't want the decrypted csv sitting on any server.

Can you pls share an example of the JDBC wrapper?

rbecher
MVP
MVP

Just google it. It's basically a JDBC driver implementation which wrappes another JDBC driver (that one you would use to access the database or files) where you overwrite/extend some methods for a special purpose like the de- or encryption in your case..

Astrato.io Head of R&D