IBM Informix Embedded SQLJ User's Guide

######

IBM Informix Embedded SQLJ User's Guide Chapter 5: Processing Embedded SQLJ Source Code

Contents | Index |  |

## Translating, Compiling, and Running Embedded SQLJ Programs You use the command java ifxsqlj to create executable Java .class files from your Embedded SQLJ source code. When you run the java ifxsqlj command with an .sqlj source file, the source file is processed in two stages. In the first stage, called translation, the SQLJ translator creates a Java source file (with the extension .java); for example, when you process a file called File1.sqlj, the SQLJ translator creates a file called File1.java. The SQLJ translator also creates internal resource files with the extension .ser. In the second stage of processing, the SQLJ translator passes .java files to a Java compiler. Compilation creates files with the extension .class; in this example, your compiled Java program is called File1.class. An internal resource file named profilekeys.class is also created. If your program includes an iterator, a file called iterator_name.class is produced.
| Tip: To perform translation only, execute the java ifxsqlj command with the -compile option set to FALSE. For information about the -compile option, see "Advanced Options".
To create a complete application, you must include the directories that contain the SQLJ runtime classes in sqlj.runtime.* in your CLASSPATH environment variable definition. The SQLJ runtime files are available in ifxsqlj.jar, the file that you installed when you first installed the Embedded SQLJ product, as described in "Installing Embedded SQLJ and Informix JDBC Driver". In addition, you must include the locations of ifxtools.jar and the relevant version of the JDK in your CLASSPATH definition. At runtime, you must also include the location of ifxjdbc.jar; however, you do not need to include this file location when translating or compiling your application. You run your Embedded SQLJ program like any other Java program: by using the Java interpreter, as follows:

    java File1

IBM Informix Embedded SQLJ User's Guide, Version 1.0
Copyright © 1999, IBM Corporation. All rights reserved.