There are some special considerations for running the IBM® Toolbox for Java™ classes on the IBM Developer Kit for Java (i5/OS™) Java virtual machine (JVM).
Two common ways to call a command are to use one of the following:
The CommandCall class generates a list of messages that are available to the Java program once the command completes. This list of messages is not available through java.lang.Runtime.exec().
The java.lang.Runtime.exec method is portable across many platforms, so if your program must access files on different types of servers, java.lang.Runtime.exec() is a better solution.
Common ways to access a file in the integrated file system of the iSeries™ server:
The IBM Toolbox for Java integrated file system classes have the advantage of providing more function than the java.io classes. The IBM Toolbox for Java classes also work in applets, and they do not need a method of redirection (such as iSeries Access for Windows®) to get from a workstation to the server.
The java.io classes are portable across many platforms, which is an advantage. If your program must access files on different types of servers, java.io is a better solution.
If you use java.io classes on a client, you need a method of redirection (such as the iSeries Access for Windows) to get to the server file system.
Two IBM-supplied JDBC drivers are available to programs running on the i5/OS JVM:
The IBM Toolbox for Java JDBC driver is best to use when the program is running in a client/server environment.
The IBM Developer Kit for Java JDBC driver is best to use when the program is running on an iSeries server.
If the same program runs on both the workstation and the server, you should load the correct driver through a system property instead of coding the driver name into your program.
Two common ways to call a program are as follows:
The ProgramCall class of the IBM Toolbox for Java licensed program has the advantage that it can call any iSeries server program.
You may not be able to call your iSeries server program through JNI. An advantage of JNI is that it is more portable across server platforms.