cleancut-fluent

(Answer) (Category) iSeries / AS400 FAQ : (Category) Programming : (Category) Java :
Java and SQL stored procedure
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
ans-ins-part
Append to This Answer
buck.calabro, schino_k
Previous: (Answer) Debugging Java programs running on the iSeries
Next: (Answer) Where/what is a good reference to learn how to access JDBC from RPGLE?
This document is: http://faq.midrange.com/index.pl?file=411
[Search] [Appearance]
This is a Faq-O-Matic 2.721.