Oracle8i Java Developer's Guide Release 3 (8.1.7) Part Number A83728-01 |
Library | Service | Contents | Index

## Overview

In Oracle8i, you utilize Java in one of the following ways:

- Invoking Java Methods--Invoke Java methods in classes loaded within the database. This includes Java stored procedures, Servlets, JavaServer Pages, CORBA, and EJB.

  Note: For more information on JavaServer Pages and Servlets, see the Oracle JavaServer Pages Developer's Guide and Oracle8i Oracle Servlet Engine User's Guide.

- Utilizing SQLJ and JDBC for Querying Database--You can query the database from a Java client through utilizing JDBC or SQLJ.

We recommend that you approach Java development in Oracle8i incrementally, building on what you learn at each step. The easiest way to invoke Java within the database is through Java stored procedures. Once you have mastered that, you should move on to CORBA and EJB applications.

1. You should master the process of writing simple Java stored procedures as listed in "Preparing Java Class Methods for Execution" and the Oracle8i Java Stored Procedures Developer's Guide. This includes writing the Java class, deciding on a resolver, loading the class into the database, and publishing the class.

2. You should understand how to access and manipulate SQL data from Java. Most Java server programs, and certainly Java programs executing on Oracle8i, interact with database-resident data. The two standard APIs for accomplishing this are JDBC and SQLJ. Because JDBC forms the foundation for SQLJ, you should understand how the two work together, even though you might be using only SQLJ in your code.

3. If you intend to distribute Java logic between client and server or in an N-tier architecture, you should understand how CORBA and EJB work in Oracle8i. CORBA and EJB provide the simplest solution to this difficult problem, in an Internet-standard manner, enabling you to leverage component-based development for transactional applications. Furthermore, EJB and CORBA utilize Oracle8i's facilities for Java stored procedures and JDBC.

Java is a simple, general purpose language for writing stored procedures. JDBC and SQLJ allow Java to access SQL data. They support SQL operations and concepts, variable bindings between Java and SQL types, and classes that map Java classes to SQL types. You can write portable Java code that can execute on a client or a server without change. With JDBC and SQLJ, the dividing line between client and server is usually obvious--SQL operations happen in the server, and application program logic resides in the client.

As you write more complex Java programs, you can gain performance and scalability by controlling the location where the program logic executes. You can minimize network traffic and maximize locality of reference to SQL data. JDBC and SQLJ furnish ways to accomplish these goals. However, as you tend to leverage the object model in your Java application, a more significant portion of time is spent in Java execution, as opposed to SQL data access and manipulation. It becomes more important to understand and specify where Java objects reside and execute in an Internet application. Now you have become a candidate for moving into the world of CORBA and Enterprise JavaBeans.

| Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
Library | Service | Contents | Index