Running AS/400 Toolbox for Java classes on the Java virtual machine for AS/400

Below are special considerations for running the AS/400 Toolbox for Java classes on the Java virtual machine for AS/400:

JDBC

Two IBM-supplied JDBC drivers are available to programs running on the Java virtual machine for AS/400:

The AS/400 Toolbox for Java JDBC driver is best to use when the program is running in a client/server environment.

The AS/400 Developer Kit for Java JDBC driver is best to use when the program is running on AS/400.

If the same program runs on both the workstation and the AS/400, you should load the correct driver through a system property instead of coding the driver name into your program.

Program call

Two common ways to call a program are as follows:

The ProgramCall class of the AS/400 Toolbox for Java licensed program has the advantage that it can call any AS/400 program.

You may not be able to call your AS/400 program through JNI. An advantage of JNI is that it is more portable across server platforms.

Command call

Two common ways to call a command are as follows:

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().

java.lang.runtime.exec() 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.

Integrated file system

The two common ways to access a file in the integrated file system of the AS/400 are as follows:

The AS/400 Toolbox for Java integrated file system classes have the advantage of providing more function than the java.io classes. The AS/400 Toolbox for Java classes also work in applets, and they do not need a method of redirection (such as Client Access for AS/400) 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 Client Access/400) to get to the AS/400 file system.