|
No one else responded so I will throw in my two-cents worth. One approach would be to route standard out/error to a place accessible by the caller. The AS/400 JVM has properties that tell it to reroute standard in/out/error. You could reroute standard out to a port that the caller is listening to, or reroute it to a file that is read by the caller. Another approach is to use one of the AS/400's IPC mechanisms (Data Queues, User Spaces, Data Areas, ...) to pass information from the Java program to the caller. A third approach would be to write data to a temporary database file then signal the caller to read the data. I realize the first two can be messy. They assume a program between the Java program and the ODBC program that would help get data back to the ODBC program (probably the "C" stored procedure you talked about in your note). David Wall AS/400 Toolbox for Java Please respond to JAVA400-L@midrange.com To: "L-JAVA400@midrange.com" <JAVA400-L@midrange.com> cc: Subject: Tricks to get output from Java to ODBC caller? We have put a call to a Java program into a CL program in order to call it from ODBC (actually, we may have been able to bypass the CL program altogether, but that is not important) using CALL QSYS.QCMDEXC. Does anyone know a way to get output from a Java program? We would like to run the java program and get some output from it to return to the calling application. The caller would use ODBC or JDBC (solution must support both in this case, not just JDBC) and stored procedures with input/ouput params. I would be able to write a C stored procedure which in turn could call the java program, but I also do not know how to get java output to a C program. Any ideas? luther.miller @ hypere.com +--- | This is the JAVA/400 Mailing List! | To submit a new message, send your mail to JAVA400-L@midrange.com. | To subscribe to this list send email to JAVA400-L-SUB@midrange.com. | To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com. | Questions should be directed to the list owner: joe@zappie.net +--- +--- | This is the JAVA/400 Mailing List! | To submit a new message, send your mail to JAVA400-L@midrange.com. | To subscribe to this list send email to JAVA400-L-SUB@midrange.com. | To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com. | Questions should be directed to the list owner: joe@zappie.net +---
As an Amazon Associate we earn from qualifying purchases.
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.