cancel
Showing results for 
Search instead for 
Did you mean: 

Using standard jar files in CPI IFlow - Groovy script

madhusudana_reddy2
Contributor
0 Kudos

Hi All,

We tried to use JDBC adapter to connect with IBM AS400 DB2 server(known as iServer), but SAP confirmed that JDBC adapter can not connect to IBM AS400 DB2 database server(iServer) which uses the driver jt400.jar for connectivity. Now, we are planning to write Groovy script to directly connect with DB2 server and read/write the data. From my local machine eclipse tool,we are able to use JT400.jar driver file and connect with DB2 server successfully.
Next step is to make this groovy work directly in CPI IFlow. Hence, I created IFlow and using groovy script for DB2 connectivity from IFlow and uploaded JT400.jar in the RESOURCES tab. But, groovy is throwing the error: SQLException: No suitable driver found.


We can see some blogs(given below) related to using custom java jars in groovy script, but no information related to using standard jar files in groovy. Please let us know, how to use standard jar files in groovy scripts.

https://blogs.sap.com/2022/04/06/how-to-use-external-jar-files-in-cpi/

Regards,

Madhusudana R

philippeaddor
Active Participant
0 Kudos

I'm using a Java library to create CSV files (openCSV) and uploaded it as jar to the IFlow resources, same as you did. I can use it with the Import statement in the Groovy script and it works fine. So I'm not sure why you get that error. But as Daniel points out, the connection via CC might be tricky (in worst case you would need to open the database (port) to the Internet).

Accepted Solutions (0)

Answers (1)

Answers (1)

DG
Active Contributor

One other challenge you may face is the connection via cloud connector to your on-prem SQL database. I think the standard is SOCK5 which is used. Does the IBM database support that setup.

madhusudana_reddy2
Contributor
0 Kudos

Thank you for your reply Daniel.

Connection to the Onpremise IBM DB2 over SOCK5 is going to be another challenge and need to verify further.