I have used the RPGLE Class example. I instead tend to use a technique
where:
1) create RPGLE program with *ENTRY
2) create CLPLE with the same signature, that calls the RPG
3) create a sql procedure to call the CLPLE with the same signature
4) in the Java class I use sql to call it, and it returns the values
connection =
getAS400JDBCConnection(accinfo.getSystem(), accinfo.getLibraryList());
stmt = connection.prepareCall("Call
LIBRARY/ACCINFO(?,?,?,?,?,?,?,?,?,?,?)");
stmt.setString(1, accinfo.getSystem().trim());
stmt.setString(2,
accinfo.getUser().toUpperCase().trim());
stmt.setString(3,
accinfo.getCompanyId().toUpperCase().trim());
stmt.setString(4,
accinfo.getEmployeeNbr().toUpperCase().trim());
stmt.registerOutParameter(5, Types.CHAR); //
realName
stmt.registerOutParameter(6, Types.CHAR); //
expDate
stmt.registerOutParameter(7, Types.CHAR); //
accDisable
stmt.registerOutParameter(8, Types.CHAR); //
accLocked
stmt.registerOutParameter(9, Types.CHAR); //
passExp
stmt.registerOutParameter(10, Types.CHAR); //
passChg
stmt.registerOutParameter(11, Types.CHAR); //
passAlow
stmt.execute();
For me, it feels simpler and more readable than the RPGLE pieces.
Kristen
-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Joe Pluta
Sent: Wednesday, July 27, 2011 1:53 PM
To: Java Programming on and around the IBM i
Subject: Re: JTOpen problem from JNI
I'd suggest starting here:
http://publib.boulder.ibm.com/infocenter/iadthelp/v7r0/index.jsp?topic=/com.
ibm.etools.iseries.pgmgd.doc/c0925076171.htm
Joe
Den 27/07/11 19.27, Joe Pluta skrev:
Also, why are you using JNI instead of the RPG *JAVA support? It seems
like an awful lot of work.
Is there a good introductory text to this facility? I am primarily
interested in being able to run a program and retrieve values from it.
Thanks,
As an Amazon Associate we earn from qualifying purchases.