Prerequisite for calling Java to execute an AS400 stored procedure is to have the jt400.jar in your classpath.
Five steps are required to use the code to create a Java class and, with it, call an AS400 stored procedure.
First, create a file named AS400DEV.properties and enter the following with your AS400 name, user-id and password.
system= userid= password=
Next, create the class that we will use to create the Java class to call the AS400 stored procedure.
javac StoredProcWriter.java
java -classpath .;jt400.jar StoredProcWriter <library> <as400storedprocedure> <javaclass.java>
javac -classpath .;jt400.jar <javaclass.java>
java -classpath .;jt400.jar <javaclass>
javac StoredProcWriter.java java -classpath .;jt400.jar StoredProdWriter MYLIB CustomersByState CustomersByState javac -classpath .;jt400.jar CustomersByState.java java -classpath .;jt400.jar CustomersByState
Caveat: this code is really old. It wasn't state of the art when I wrote it 10 years ago but it does get the job done.