• The automatic validation of SQL code. With JDBC, SQL and DML statements
are only validated at runtime and not compile time, since the SQL is only
known as a String object to JDBC. SQLJ will not allow invalid SQL to
compile and will inform the developer at development time instead of
runtime.

• The readability of the Java code. SQLJ can accomplish the same tasks as
JDBC with much fewer lines. In addition, it is much easier to read SQL and
DML statements inline in Java.

The disadvantages to SQLJ include:

• The extra step needed to create compiled code to access the database. An
extra step is one more opportunity for problems to occur.

• The readability of the generated Java code.

Whether the developer chooses to use JDBC or SQLJ when writing server-side
code, the code still needs to be loaded into the database. The loadjava
utility is important because it provides this capability directly from the
operating system command line.