Bundling Java libraries with a DB2 Java stored procedure

db2, db2-luw, ibm-data-studio, java-stored-procedures, stored-procedures

Solution

When deploying the stored procedure to the server:

make sure you click Next instead of Finish to get to the second screen:

and there, in the Compile options: field append your dependencies using the `-classpath` command-line option.

Note: the `-cp` shorthand option will not work!

Problem

Creating a DB2 Java stored procedure using IBM Data Studio, I have some libraries that are required in the classpath. I'm running Data Studio in a VM, and deploying remotely to my DB2 server in a Cloud instance. How do I bundle up the jars with my stored procedure?

Original source