SQLJ is a recent ANSI standard for embedding static SQL statements directly in Java code. the mixed code is converted to Java by the SQLJ translator, and can be executed on a database using the SQLJ runtime library and an underlying JDBC driver.
SQL statements in SQLJ are static; that is,they must be known at program time and can not change as the program executes. Data values passed to SQL operations can be deternined at runtime but the SQL operation is known a priori. in contrast, the JDBC API is fully dynamic--the SQL statement itself can be formulated on the fly.Most SQL operations in a typical database qapplication are static. SQLJ provides a simpler model for static SQL statements compared to JDBC, and provides higher-level interface by automatically managing JDBC statement handles. Additionally, the SQLJ translator can check the SQL statements against a database for syntax and semantic errors. This checking is performed ar compile-time unlike just at runtime as in JDBC, and it is independent of the actual flow of program logic.compared to JDBC, SQLJ programs are therefore more robust, much quicker to write and easier to maintain.