| Java Programming with Oracle SQLJ | | | Copyright | | | Table of Contents | | | Preface | | | 1. Introduction | | | 2. Relational Databases, SQL, and PL/SQL | | | 3. Fundamental SQLJ Programming | | | 4. Database Objects | | | 5. Collections | | | 6. 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 | | | 7. Large Objects | | | 8. Contexts and Multithreading | | | 9. Advanced Transaction Control | | | 10. Performance Tuning | | | 11. Combining JDBC, SQLJ, and Dynamic SQL | | | A. Java and Oracle Type Mappings | | | B. Oracle Java Utilities Reference | | | C. SQLJ in Applets, Servlets, and JavaServer Pages | | | Colophon | | | Index | | | Database > Java Programming with Oracle SQLJ > 6. Deploying SQLJ in the JServer > 6.1 Understanding the Oracle JServer | 6.1 Understanding the Oracle JServer The Oracle JServer consists of both a Java Virtual Machine (JVM) and a Java execution environment. The JServer JVM is compatible with the standard Java language specification and Java Virtual Machine specification. The JServer contains a CORBA 2.0-compliant Object Request Broker (ORB), and JServer supports the Enterprise JavaBeans standard. Traditional Java Development Kit (JDK) programs are run using the java command-line utility, which creates an operating system process for each Java program that you run. Before you can run your Java programs using the JServer JVM, you must perform the following steps: -
Load your Java classes into the database. -
Create wrappers, which you must write in PL/SQL, around your Java methods. Once you have performed these tasks, you may invoke the PL/SQL wrappers, which then run your Java programs' methods within a session in the JServer JVM. Each JServer session is conceptually similar to a database session, with each session logically separated from the others. The JServer JVM manages each session to increase scalability and reduce memory requirements by sharing as much information as possible. Bear in mind that the JServer JVM does not contain GUI components, so the JServer JVM cannot be used to run GUI programs on the server. The JServer JVM runs in the same process and memory space as the Oracle8i database kernel. This results in a significant increase in the scalability and performance of your Java stored programs because the memory heaps and data structures of the RDBMS are available directly to those Java programs. In addition, Oracle provides the standard Java class libraries such as java.lang, java.util, and java.math precompiled for the native platform on which the JServer runs, resulting in an additional boost in performance. Just as a background to your understanding of the JServer JVM, here is a list of the subsystems of the JServer JVM: - Class loader
-
The class loader locates, loads, and initializes the Java classes from the database into the JServer JVM. - Compiler
-
The compiler translates the Java and SQLJ source files into Java class files, which consist of bytecodes. These bytecodes are then submitted to the interpreter when you invoke methods in the respective classes. - Bytecode interpreter and runtime system
-
The Java bytecode interpreter and runtime system executes the Java classes; this subsystem also contains the native precompiled Java class libraries. - Garbage collector
-
The garbage collector frees system resources when objects are no longer required. - RDBMS library manager
-
Loads your Java source, class, and resource files into the database. - RDBMS memory manager
-
Handles the allocation of memory when a Java program is run. |
Index terms contained in this section bytecode interpreter, JServer JVM class loader, JServer JVM compiler, JServer JVM CORBA 2.0 EJB (Enterprise JavaBeans) JServer, support for garbage collector, JServer JVM Java class libraries java command Java Development Kit (JDK) java.lang package java.math package java.util package JDK (Java Development Kit) JServer, deploying SQLJ in sessions understanding JServer JVM (Java Virtual Machine) Object Request Broker (ORB) ORB (Object Request Broker) RDBMS (Relational Database Management System) library manager, JServer JVM memory manager, JServer JVM runtime system, JServer JVM | |