|
Well, initially, I want to use java applets to allow users to select reports/inquiries, and enter parameters. Using JDBC, I would dynamically use their parameters to build an SQL statement, get a result set, and let the user scroll through a page at a time, modify their parameters, etc. Once I have that down, then I would like to get into calling RPG modules from Java, to improve the reporting capabilities. You see, right now as far as reporting goes, I am limited (in my skillset mostly) to providing printed matter, screen displays, or web pages. I thought that using java applets would be a good skill to add to my 'bag of tricks" to deliver reports and interactive inquiry sessions. Now that I am seeing the real strengths of Java, I am realizing that this language can do alot more than act as delivery boy. It will really depend on my sales job to upper management ;-) On Tue, 28 Dec 2004 16:32:58 -0600, Bartell, Aaron L. <ALBartell@xxxxxxxxxxxxxx> wrote: > 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. > > -- > 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. > > -- "Enter any 11-digit prime number to continue..."
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.