When to Use SQLJ with Java Application Servers
Because of the issues related to multiple mappings of Java objects to tables and vice versa, it is best to use SQLJ with Java application servers when the data being mapped is quite simple. For example, SQLJ would be an excellent way to look up simple account information based on an account number. There would be little mapping of data needed in this case.
If your data mapping may be complex, however, you should look at either JDO or EJB accelerators:
There is one exception to this recommendation; if you do not have an existing database and plan on entering new data directly from an application server, see how SQLJ can be one of the options for EJB accelerators.
For more information on SQLJ issues related to data mapping, see SQLJ Data Conversion.
Also, if you are not familiar with the concept of complex data, see complex data.
More on the general topic: Using SQLJ with Application Servers