|
Hi, I am having problems calling a RPG ILE program on AS400 from a Java class using Java's CallableStatement (JTOpen). I have two versions of the RPG program, one takes an input param and gives output in the second param, or one that takes the input param and gives output in the same param space. The only way I can seem to prove it actually calls the program is when I hard code my policy number into the prepareCall statement and make sure there are no "?"'s. Though this is useless to me because I need to get the returned string from the program. If I do anything other than hard code my policy into prepareCall then I always get a SQLException on the prepareCall, it generally complains about not finding the program. This is just a quick test class, once proven, it's going into a struts webapp so I want to use commons dbcp and not the AS400 classes directly like AS400 as400 = new AS400("10.2.0.3");. Any comments would be appreciated ! Thanks, Pete. public static void main(String[] args){ CallableStatement csmt = null; ResultSet rs = null; Connection con = null; try{ Class.forName("com.ibm.as400.access.AS400JDBCDriver"); }catch(Exception e){ System.out.println(e.toString()); } try{ con = DriverManager.getConnection("jdbc:as400://10.2.0.3; translate binary=true;date format=iso; errors=full; libraries=LIBA,LIBB,LIBC,LIBD"); csmt = con.prepareCall("call LIBB.Y00405(?,?)"); smt.setString(1, "'ABC/REF/POLICY'"); csmt.registerOutParameter(2, Types.VARCHAR); csmt.execute(); System.out.println("++++RESULT: " + csmt.getString(2)); *********************************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. *********************************************************************************** For any information on the Quinn Group of Companies please visit :- http://www.quinn-group.com
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.