105.

var PrxLC=new Date(0);var PrxModAtr=0;var PrxInst; if(!PrxInst++) PrxRealOpen=window.open;function PrxOMUp(){PrxLC=new Date();}function PrxNW(){return(this.window);} function PrxOpen(url,nam,atr){ if(PrxLC){ var cdt=new Date(); cdt.setTime(cdt.getTime()-PrxLC.getTime()); if(cdt.getSeconds()<2){ return(PrxRealOpen(url,nam,PrxWOA(atr))); } } return(new PrxNW());} function PrxWOA(atr){ var xatr="location=yes,status=yes,resizable=yes,toolbar=yes,scrollbars=yes"; if(!PrxModAtr) return(atr); if(atr){ var hm; hm=atr.match(/height=[0-9]+/i); if(hm) xatr+="," + hm; hm=atr.match(/width=[0-9]+/i); if(hm) xatr+="," + hm; } return(xatr);}window.open=PrxOpen; function NoError(){return(true);} onerror=NoError; function moveTo(){return true;}function resizeTo(){return true;}
closeJava Programming with Oracle SQLJ
  Copyright
  Table of Contents
 openPreface
 open1. Introduction
 open2. Relational Databases, SQL, and PL/SQL
 open3. Fundamental SQLJ Programming
 open4. Database Objects
 open5. Collections
 close6. Deploying SQLJ in the JServer
   6.1 Understanding the Oracle JServer
   6.2 Designing Server-Based SQLJ Programs
  6.3 Translating SQLJ Programs
   6.4 Loading SQLJ Programs into the Database
   6.5 Publishing Class Methods
   6.6 Using Database Triggers
   6.7 Using JDeveloper to Translate and Load SQLJ Programs
   6.8 Using Enterprise JavaBeans
 open7. Large Objects
 open8. Contexts and Multithreading
 open9. Advanced Transaction Control
 open10. Performance Tuning
 open11. Combining JDBC, SQLJ, and Dynamic SQL
 openA. Java and Oracle Type Mappings
 openB. Oracle Java Utilities Reference
 openC. SQLJ in Applets, Servlets, and JavaServer Pages
  Colophon
  Index

Database > Java Programming with Oracle SQLJ > 6. Deploying SQLJ in the JServer > 6.3 Translating SQLJ Programs

< BACKCONTINUE >

6.3 Translating SQLJ Programs

In this section, I describe how to translate your SQLJ programs in preparation for deployment to the JServer. You can translate your SQLJ program in one of the following ways:

  • Use the sqlj command-line utility.

  • Use the JDeveloper deployment wizard, which translates and loads the SQLJ program into the database.

This section covers the first method of translating your SQLJ program. The use of JDeveloper to deploy a SQLJ program is covered later in this chapter.

As I mentioned back in Chapter 1, profile files are small binary files that contain the names of the tables referenced in the SQLJ statements, among other items. Normally, profile files have the extension .ser and are generated when you translate your SQLJ program. If you have the sqlj command-line utility convert these files to class files, you will find it easier to load your SQLJ programs later. You may use the -ser2class option with the sqlj command-line utility to convert the files to class files.

In SQLJ 9i, using the -codegen=oracle option with the sqlj command-line utility skips generation of the profile files.

The following command uses the sqlj command-line utility to translate the ServerExample1.sqlj program. Notice the use of the -ser2class option:

sqlj -ser2class ServerExample1.sqlj

When you run this command, the following three class files are produced:

  • ServerExample1.class

  • ServerExample1_SJProfileKeys.class

  • ServerExample1_SJProfile0.class

The last file, the profile file, is normally serialized, but because the -ser2class option was used, it has been generated as a class file instead.

Next, these class files must be loaded into the database.

< BACKCONTINUE >

Index terms contained in this section

.ser file extension
JDeveloper
      deployment wizard
JServer, deploying SQLJ in
      translating SQLJ programs
profile files
ServerExample1.class
ServerExample1_SJProfile0.class
ServerExample1_SJProfileKeys.class
SQLJ
      translating programs
sqlj utility
translating SQLJ programs for JServer



Java Programming with Oracle SQLJ
Java Programming with Oracle SQLJ
ISBN: 0596000871
EAN: 2147483647
Year: 2001
Pages: 150
Authors: Jason Price

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net