f Specifies that the argument immediately after the options list is the name of
the JAR file to be created.
For example, to create a JAR file named acmejos.jar from Add_customer.class,
which is in package acmejos, execute this jar command:
jar -cvf acmejos.jar acmejos/Add_customer.class
To create a JAR file for an SQLJ routine, you also need to include all generated
class files, such as classes that are generated for iterators, and all serialized
profile files. For example, suppose that all classes are declared to be in package
acmejos, and all class files, including generated class files, and all serialized
profile files for SQLJ routine Add_customer.sqlj are in directory
/u/db2res3/acmejos/. To create a JAR file named acmejos.jar, change the the
/u/db2res3 directory, and then issue this jar command:
jar -cvf acmejos.jar acmejos/*.class acmejos/*.ser
Related tasks
“Preparing Java routines with no SQLJ clauses to run from a JAR file” on page
187
“Preparing Java routines with SQLJ clauses to run from a JAR file” on page 188
Running JDBC and SQLJ programs
You run a JDBC or SQLJ program using the java command. Before you run the
program, you need to ensure that the JVM can find all of the files that it needs.
To run a JDBC or SQLJ program, follow these steps:
1. Ensure that the program files can be found.
v For an SQLJ program, put the serialized profiles for the program in the same
directory as the class files for the program.
v Include directories for the class files that are used by the program in the
CLASSPATH.
2. Run the java command on the z/OS UNIX System Services command line, with
the top-level file name in the program as the argument.
To run a program that is in the EzJava class, add the directory that contains EzJava
to the CLASSPATH. Then run this command:
java EzJava
Related concepts
“Environment variables for the IBM Data Server Driver for JDBC and SQLJ” on
page 415
192 Application Programming Guide and Reference for Java
™