Oracle8i SQLJ Developer's Guide and Reference
Release 8.1.5






Prev  Chap Top Next

Additional Vehicles for SQLJ in the Server

Most of the discussion throughout this chapter has presumed that SQLJ is being used for stored procedures or stored functions; there has been no special consideration of any other possibilities. Be aware, though, that you can also use SQLJ in the server in the following ways:

This section introduces the use of Enterprise JavaBeans and CORBA objects. For more information see the Oracle8i Enterprise JavaBeans and CORBA Developer's Guide. The lookup and sqljimpl examples in that manual use interface implementations that were developed with SQLJ.


If your EJB or CORBA object uses any sort of XA transactions (UserTransaction in an EJB or JTS in a CORBA object, for example), you cannot use explicit SQLJ commit/rollback statements or JDBC commit/rollback methods. Any attempt to do so will result in an exception. You must instead execute your commits and rollbacks through the particular XA interface that you are using.  

Enterprise JavaBeans

To use SQLJ in Enterprise JavaBeans (EJBs), develop and translate the SQLJ EJBs on a client and then load all resulting classes and resources into the server. To load and publish EJBs, however, you must use a utility called deployejb (loadjava is not used).

When you run the SQLJ translator for your EJB program, consider the following:

Once you have translated your SQLJ EJB, gather everything into a .jar file. This includes:

After creating the .jar file, use the deployejb utility to load everything into the server, specifying the .jar file as input.

CORBA Server Objects

You can also use SQLJ for developing CORBA objects that have database DML statements. As with EJBs, you must be careful to include all classes and resource files that the SQLJ translator generates when you load files into the server. For CORBA objects, load and publish as you would for stored procedures.

Create a .jar file to hold all the SQLJ-generated files, as discussed in "Enterprise JavaBeans", and use this file on the command line when you run loadjava.



Copyright © 1999 Oracle Corporation.

All Rights Reserved.