|
Hello Pro's,
I am trying to run an iSeries command from a .jsp page and this is how I am
doing it. I was wondering if anybody could give their opinion on this
approach. I am trying to follow the example by Kevin Vandever. The example
runs just fine if I run it as a .java stand alone application. Any help
would be much appreciated.
*************************************************************************************************************************************
<%@ page import="java.io.*"%>
<%@ page import="java.util.*"%>
<%@ page import="com.ibm.as400.access.*"%>
<%
String systemString = null;
String commandString = null;
String successful = "Command Was Successfully Executed";
String failed = "Command Failed To Execute, Please Try Again";
try
{
commandString = "CALL VND999CL";
}
catch (Exception e) {};
AS400 as400 = new AS400("XXX.XXX.XXX.XXX", "XXX", "XXX");
CommandCall command = new CommandCall( as400 );
try
{
if (command.run(commandString))
out.println( "Command successful" );
else
out.println( "Command failed" );
AS400Message[] messagelist = command.getMessageList();
if (messagelist.length > 0)
{
out.println( ", messages from the command:" );
out.println( " " );
}
for (int i=0; i < messagelist.length; i++)
{
out.println( messagelist[i].getID());
out.println( ": " );
out.println( messagelist[i].getText());
}
}
catch (Exception e)
{
out.println( "Command " + command.getCommand() + " did not run"
);
}
%>
*****************************************************************************************************************************************************
Thanks,
cheers,
Jake.
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.