|
Thank you all! although I got another problem now: When I execute stmt.executeUpdate("CALL MYPGM('parm1')"; where parm1="xxxxxxxxxx " it seems that the trailing spaces are left out at execution_time.... The CL/RPG program receives: "xxxxxxxxxx???????????????" where ??...?? is 'rubbish' in stead of spaces. Because the application checks if that part is blank it goes wrong. To be complete, the parameter is in fact a bit longer (first 15 chars are filled, next 350chars are a list of 10-35char fields which sometimes contain data, sometimes not! >> date: Tue, 18 Mar 2003 10:12:08 -0500 >> from: "Tim Kosacek" <tkosacek@xxxxxxxxxxxxxx> >> subject: RE: how to submit a job on iSeries from webapplication >> >> This is off the top of my head, so hopefully the syntax would be >> correct! >> >> Hopefully this formats OK, >> >> import java.sql.Connection; >> import java.sql.DriverManager; >> import java.sql.SQLException; >> import java.sql.Statement; >> >> public class TestProgramCallJDBC >> { >> >> public static void main(String[] args) >> { >> Connection con = null; >> Statement stmt = null; >> try >> { >> >> Class.forName("com.ibm.as400.access.AS400JDBCDriver"); >> con = >> DriverManager.getConnection("jdbc:as400://mysystem/mylibrary", >> "myuser", "mypassword"); >> stmt = con.createStatement(); >> stmt.executeUpdate("CALL >> MYPGM('parm1','parm2','parm3'"); >> } >> catch (Exception e) >> { >> e.printStackTrace(); >> } >> finally >> { >> if (stmt != null) >> { >> try >> { >> stmt.close(); >> } >> catch (SQLException e) >> { >> e.printStackTrace(); >> } >> } >> if (con != null) >> { >> try >> { >> con.close(); >> } >> catch (SQLException e) >> { >> e.printStackTrace(); >> } >> } >> } >> } >> } >> >> Just substitute how you get the connection, and the program you want to >> call. Hopefully this helps. >> >> Tim
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.