SQLJ is more concise and thus easier to write than JDBC, and provides compile-time schema validation and syntax checking for easier debugging. SQLJ reads input either from a *.SQLJ file, or a Java source file in which SQLJ statements are embedded. The SQLJ precompiler translates the SQLJ statements into their equivalent JDBC calls. SQLJ only supports static SQL.
Writing SQLJ programs
See the Scripts#SQLJ_Programs section for some SQLJ example programs.
Use the sqlj compiler to compile your *.sqlj files to *.java and *.ser files. The *.ser files contain vendor specific database code.
After that, invoke the javac compiler to compile the .java files to *.class files.
The *.class and *.ser files can then be deployed to the runtime environment.