SQL/MX Programming Manual for Java

Introduction
HP NonStop SQL/MX Programming Manual for Java523726-003
1-12
Default Processing Without Module Definition Files
Profile
The profile (for example, MyProg_SJProfile0.ser file) is a serialized Java object
that includes information about the SQL-specific parts of the translated SQLJ program.
The profile contains the SQL/MX statements from the SQLJ source file, information
about how to execute these statements, and host variable attributes. Because the
classes in the profile are defined by the SQLJ standard, the uncustomized profile is
often referred to as the default customization.
The translator generates one profile (.ser file) for each connection context class,
including an implicit connection context, in the SQLJ source file. If an SQLJ source file
contains multiple connection contexts, the translator generates multiple profiles for that
source file. For more information, see Connection Contexts on page 3-8.
You can view the contents of the profile by using the ProfilePrinter tool. For more
information, see ProfilePrinter Tool on page 5-42.
Compilation by the Java Compiler
After successful translation, the SQLJ translator program automatically invokes Java
compilation. The Java compiler (javac) compiles the .java file (Java code) into these
class files (Java bytecode):
Program class file
Any connection context and iterator class files
Keys file
This part of the preparation is considered to be portable. For more information, see
Binary Portability on page 1-2.
Program Class File
The program class file (for example, MyProg.class) contains the compiled SQLJ
program. Use the name of this file, without the .class suffix, to run an SQLJ program.
Connection Context and Iterator Class Files
The Java compiler generates class files for each connection context declaration and
iterator declaration in an SQLJ source file. The Java compiler uses the class definitions
in the Java source file to generate class files. For more information, see Connection
Contexts on page 3-8 and Iterators and Result Sets on page 3-48.
Keys File
The keys file is a class file that maps each translated SQLJ clause in the program
class file to the profile that contains the embedded SQL statement. The keys file is
named MyProg_SJProfileKeys.class, where MyProg is the name of the SQLJ
source file and the corresponding class name.
3