Oracle8i SQLJ Developer's Guide and Reference
Release 8.1.5






Prev  Chap Top Next

Creating SQLJ Code for Use in the Server

With few exceptions, writing SQLJ code for use in the Oracle8i server is identical to writing SQLJ code for client-side use. The few differences are due to Oracle JDBC characteristics or general Java characteristics in the server, rather than being specific to SQLJ.

When writing SQLJ code for use in the server, be aware of the following:

You should also be aware of class naming and class resolution considerations. These are discussed in "About Class Loading, Compiling, and Name Resolution".

Database Connections in the Server

The concept of connecting to the server is different when your SQLJ code is running in the server itself. Note the following issues and characteristics when writing code for use in the server:


In the server, setting the default connection context to null, as follows, will reinstall the default connection context (the implicit connection to the server):


Coding Issues Relating to the JDBC Server-Side Driver

Note the following characteristics of the Oracle JDBC server-side driver when writing code for use in the server:


If you are using any kind of XA transactions, such as Java Transaction Service (JTS) transactions, you cannot use SQLJ or JDBC commit/rollback statements or methods. This applies particularly to Enterprise JavaBeans or CORBA objects, which typically use such transactions. See "Additional Vehicles for SQLJ in the Server".  

For more information about server-side JDBC and the server-side driver, see the Oracle8i JDBC Developer's Guide and Reference.

Server-Side Default Output Device

The default standard output device in the Oracle8i Java VM is the current trace file.

If you want to reroute all standard output from a program executing in the server (output from any System.out.println() calls, for example) to a user screen, then you can execute the SET_OUTPUT() procedure of the DBMS_JAVA package, as follows (inputting the buffer size in bytes):

sqlplus> execute dbms_java.set_output(10000);

If you want your code executing in the server to expressly output to the user screen, you can also use the PL/SQL DBMS_OUTPUT.PUT_LINE() procedure instead of the Java System.out.println() method.

The PUT_LINE() procedure is overloaded, accepting either VARCHAR2, NUMBER, or DATE as input to specify what is printed.

For more information about the DBMS_OUTPUT package, see the Oracle8i Supplied Packages Reference.



Copyright © 1999 Oracle Corporation.

All Rights Reserved.