SQL/MX Programming Manual for Java
Program and Module Management
HP NonStop SQL/MX Programming Manual for Java—523726-003
6-16
Ta rg e ti ng
If you specify an MTSS on the SQLJ command line, the customizer appends a leading
circumflex (^) character and the MTSS to the processed, three-part module name. For
example:
CAT.SCH.GRP^MOD^TABLESET^VER
If you do not specify an MTSS on the command line but do specify either a Module
Version Specification String (MVSS) or a Module Group Specification String (MGSS),
the customizer appends a trailing ^ to the module name to represent the unspecified
MTSS. For example:
CAT.SCH.GRP^MOD^^VER
For other combinations of group, table set, and version attributes in module names,
see Table 6-1 on page 6-15.
How to Apply Targeting
These instructions explain how to build applications that target different sets of
database objects by using the same SQLJ source file.
Assumptions
For the purpose of the examples, suppose that:
•
The SQLJ source file is named MyProg.sqlj.
•
The MODULE directives for each connection context in the SQLJ source file are:
#sql [ctx1] {MODULE cat.sch.MyProgCtx1 NAMES ARE ISO88591};
#sql [ctx2] {MODULE cat.sch.MyProgCtx2 NAMES ARE ISO88591};
•
The database objects are coded as class MAP DEFINEs. For example:
#sql [ctx1] {DELETE FROM =employee};
Instructions
To build an application that targets a specific set of database objects:
1. Use the OSS add_define command to set up the class MAP DEFINEs. For
example:
add_define =employee class=MAP file=\$SAMDB.PERSNL.EMPLOYEE
2. Run the SQLJ translator program and specify the -moduleTableSet option on
the command line:
java sqlj.tools.Sqlj -d=mybin1 -dir=myjava1
-moduleTableSet=TS1 MyProg.sqlj
Note. During translation, specify unique directories for each targeted application by using
the -d and -dir options. These options ensure that the program files for each table set
are not overwritten by program files for the next targeted application. For more information
about these options, see Options for Output Files and Directories
on page 5-18.