× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Maybe give some more examples on how you envision using the two together
and some of us that have been through the mud of Java and legacy
integration can provide advice.

For instance, if you were going to front end RPG business logic with a
Java web service and planned on using PCML or jt400's ServiceProgramCall
object then we could tell you the limitations and things to watch out
for (i.e. you can only have 7 parms in the parameter list when calling
service programs from Java and the passback parm, if used, must be an
integer).

A feature that V5R3 brings to the table is the ability for SQL stored
procs to call RPG service program sub procedures.  So from your Java all
you need to do is call like the following:

            DriverManager.registerDriver(new
com.ibm.as400.access.AS400JDBCDriver());
            connection =
DriverManager.getConnection("jdbc:as400://99.99.99.99", "MYPROFILE",
"MYPASSWORD");
            CallableStatement cs1 =
                connection.prepareCall(
                    "CALL PRODLIB.ACT_ADD(?,?,?,?,?,?,?,?,?,?,?)");

            cs1.registerOutParameter(1, java.sql.Types.CHAR);
            cs1.registerOutParameter(2, java.sql.Types.DECIMAL);
            cs1.setBigDecimal(3, new BigDecimal(acct.getDivision()));
            cs1.setBigDecimal(4, new BigDecimal(acct.getSubDivision()));
            cs1.setString(5, acct.getAddress(0).getName());
            cs1.setString(6, acct.getAddress(0).getContact());
            cs1.setString(7, acct.getAddress(0).getAddress1());
            cs1.setString(8, acct.getAddress(0).getAddress2());
            cs1.setString(9, acct.getAddress(0).getAddress3());
            cs1.setString(10, acct.getAddress(0).getCity());
            cs1.setString(11, acct.getAddress(0).getState());

            cs1.execute();

            String errDs = cs1.getString(1);
            BigDecimal newAcctNum = cs1.getBigDecimal(2);

Here is the stored procedure:
CREATE PROCEDURE PRODLIB.ACT_ADD 
( 
        OUT RTNMSG CHARACTER(143), 
        OUT ACTNUM DECIMAL(9, 0), 
        IN DIV DECIMAL(3, 0), 
        IN SUBDIV DECIMAL(3, 0), 
        IN NAM CHARACTER(35), 
        IN CNTNAM CHARACTER(35), 
        IN ADR1 CHARACTER(35), 
        IN ADR2 CHARACTER(35), 
        IN ADR3 CHARACTER(35), 
        IN CTY CHARACTER(30), 
        IN STT CHARACTER(2), 
) 
RESULT SETS 0 
LANGUAGE RPGLE 
SPECIFIC ACT_ADD 
NOT DETERMINISTIC 
NO SQL 
EXTERNAL NAME 'PRODLIB/ACTSV(ACT_ADD)' 
PARAMETER STYLE GENERAL 


There are many more possibilities for Java to talk to RPG and vice
versa. . .

Aaron Bartell

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] 
Sent: Tuesday, December 28, 2004 4:02 PM
To: RPG programming on the AS400 / iSeries
Subject: Java learning

I have started studying Java, and I am looking for recommendations as to
reading material.  Specifically, I want to explore using Java with
RPGIV.

Initially, I thought that it might be nice to deploy java applets in
browsers as an inquiry/report delivery vehicle.  Once I started learning
it, I can see many more uses also.  It is just hard to know where to
start regarding using Java and RPGIV.

Suggestions?

--
"Enter any 11-digit prime number to continue..."
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.