B.1. Oracle SQLJ Translator

The Oracle SQLJ translator, sqlj, translates a SQLJ file to a Java source file (with an extension of .java) and then compiles that Java source file into a Java class file (with an extension of .class). You invoke sqlj from the command line using the following syntax:

sqlj [option_list] file_list

The syntax elements are as follows:

option_list

A list of options separated by space characters. See Table B-1 for a list of valid options.

file_list

The list of files that you wish to translate and compile. You must separate the filenames in the list using spaces.

Table B-1 lists the sqlj command-line options, along with their descriptions and default values. The flags are case-insensitive; for example, to use the -cache flag you can specify the following: -cache=false. After the table, I show some examples of sqlj invocations.

Table B-1. sqlj options
Option Description Default value
-cache Enables caching of the results of online semantics checking. This is a TRUE/FALSE flag. False
-checkfilename Indicates whether a warning is to be displayed when a source file name does not correspond to the name of the public class defined within that source file. This is a TRUE/FALSE flag. True
-checksource Enables SQLJ type resolution, which causes SQLJ to examine source files in addition to class files. This is a TRUE/FALSE flag. True
-classpath Specifies the Java CLASSPATH that is to be passed to the JVM and Java compiler. None
-compile Indicates ...

Get Java Programming with Oracle SQLJ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.