What I have done for cases like this is to create a java program which
runs in a separate job. I write the SQL statement to be run to a data
que from the program that needs the information; the java program runs
the sql statement and writes the row (or rows) to a keyed data que the
original program is reading from (the key is the original program's job
indicator so that multiple jobs can use the same que).

You can avoid the overhead of invoking the program an making a
connection for every row you whish to retrieve; which can be

If you are interested I can dig up an example.


-----Original Message-----
From: java400-l-bounces+jehimes=liberty.edu@xxxxxxxxxxxx
[mailto:java400-l-bounces+jehimes=liberty.edu@xxxxxxxxxxxx] On Behalf Of
Kelly Cookson
Sent: Wednesday, October 26, 2005 11:48 AM
To: Java Programming on and around the iSeries / AS400
Subject: Passing parameters between Java and CL/COBOL/RPG programs

I have developed a Java program that runs on the iSeries and uses a JDBC
driver to establish a connection to an SQL Server database on a windows

Here's what I'd like to happen: 
(1) A CL (or COBOL or RPG) program calls a Java program on the iSeries.
(2) The Java program uses JDBC to retrieve a single row from a table in
the SQL Server database.
(3) The Java program passes the value of one field from the row back to
the CL (or COBOL or RPG) program that called it.

Has anyone done something similar? Would you be willing to share an


This is the Java Programming on and around the iSeries / AS400
(JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/java400-l.

This thread ...

Return to Archive home page | Return to MIDRANGE.COM home page