EasyManuals Logo

IBM DB2 User Manual

IBM DB2
585 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #208 background imageLoading...
Page #208 background image
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

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM DB2 and is the answer not in the manual?

IBM DB2 Specifications

General IconGeneral
DeveloperIBM
Initial Release1983
LicenseProprietary
Written inC, C++
CategoryDatabase Management System (RDBMS)
Operating SystemLinux, Windows
Programming LanguagesC, C++
Data ModelsRelational
EditionsCommunity, Standard, Advanced
Key Featureshigh availability, scalability