SQL/MX Programming Manual for Java
SQL/MX Programming Considerations
HP NonStop SQL/MX Programming Manual for Java—523726-003
4-12
MODULE Directive
MODULE Directive
The MODULE directive specifies a name to be used for a module, which contains the
compiled SQL plans of the application. Naming each module enables you to manage
modules on a system more efficiently. For information about managing modules, see
the SQL/MX Installation and Management Guide. If you do not specify the MODULE
directive, the system determines a module name for you. See System-Defined Module
Name on page 4-15.
This subsection explains how to embed a MODULE directive in an SQLJ program. For
the syntax of the MODULE directive, see the SQL/MX Reference Manual.
ANSI Compliance and Portability
If program portability is important, note that the MODULE directive is an SQL/MX
extension to the ANSI standard.
Placement of the MODULE Directive
Place the MODULE directive anywhere an executable statement is allowed in an SQLJ
program. You cannot place this directive at the top-level scope of a program where you
code class declarations. If you associate a connection context with the MODULE
directive, place the MODULE directive after the instantiation of the connection context
object.
Example
Place the MODULE directive after the instantiation of the ctx1 connection context:
public class MyProg
{
//Declaration of the connection context
private SQLMXCtx ctx1 = null;
public MyProg()
{
try
{
//Instance of a connection context object
ctx1 = SQLMXCtx.getDefaultContext();
//MODULE directive for connection context ctx1
#sql [ctx1] {MODULE cat.sch.mod NAMES ARE ISO88591};
...