I want to use Java for an SQL stored procedure. That is, I want the stored
procedure to be written in Java. I'm getting errors when I call it.
The basic steps I took to fix the stored procedure were (these are
specifically for V5R2):
ADDLNK OBJ('/qibm/ProdData/OS400/Java400/ext/runtime.zip')
NEWLNK('/qibm/userdata/Java400/ext/runtime.zip')
Install PTFs
SI10765
SI10767
This is my procedure (compiled into /QIBM/UserData/OS400/SQLLIB/Function):
CREATE PROCEDURE lbucmusr.test1 (IN systemid varchar(4) ccsid 37,
out site varchar(50) ccsid 37 )
LANGUAGE JAVA PARAMETER STYLE JAVA NOT FENCED
specific lbucmusr.test1
EXTERNAL NAME 'storedprocs.test';
public class storedprocs { //open class
public static void test(String ina, String[] b) throws Exception
{
b[0] = "Hi " + ina;
}
}
Answer courtesy Jay Himes via MIDRANGE-L, 7 Apr 2004 |