Preparing Programs for Static Execution

  Step 1 – Using the Jopaz SQLJ Generator JVMCOMP
  Step 2 – Using the IBM SQLJ Translator GENPROF
  Step 3 – Running the Jopaz SQLJ Customizer CUSTOM
  Step 4 – Transfering DBRM from USS to a PDS/PDSE Member
  Step 5 – DBRM Binding of SQLJ Serialized Profile with BIND

In order to execute COBOL programs that contain Db2 statements statically with Jopaz, you must perform the static generation steps in the following sections for each program you want to execute. This section provides an overview of the preparation process for static exectuion.
Jopaz uses Java to connect to Db2 and execute SQL statements. The standard for embedding SQL statements in Java programs is called SQLJ and the Java programs containing embedded SQL are called SQLJ programs. Jopaz provides the SQLJ generator JVMCOMP that translates temporary Java programs generated by the Jopaz compiler into SQLJ. To do that, you use the compiler option -sqlj.
You must then use an SQLJ translator provided by IBM. The translator receives your SQLJ program as input and produces several files including SQLJ serialized profiles. These profiles are files containing the description of the SQL statements and cursors from a particular program. Jopaz uses such profiles at runtime.
These SQLJ serialized profiles must be then customized and bound to Db2. Jopaz provides its own customizer program, which calls the IBM SQLJ customizer. The Jopaz customizer uses the connection parameters specified in the Jopaz configuration file db2.properties to execute the customization process in Db2. The recommended standard procedure provided in the job example JPZCOMPS is set to skip the binding process and instead create a DBRM file that is bound to Db2.
The DBRM file adapted from the serialised SQLJ profile and customized by the Jopaz SQLJ customizer must be bound to the Db2 database using the Db2 command BIND PACKAGE. This is particularly useful if you do not have the required permissions to execute the bind process in Db2. In this case, the bind can be performed with the permissions of the executor of the BIND PACKAGE command, or the user who submits the batch job containing the command. To execute the BIND PACKAGE step, the corresponding DBRM module generated in the Unix SystemService (USS) environment must first be copied into a PDS/PDSE member.