Java is an object-oriented language for creating distributed applications on the Internet or other networks. Modules of Java code known as "applets" can be downloaded from the Internet or a local network in real time and locally executed. Java applets themselves can call and execute other applets, so that a Java application as executed on the user's machine can be constructed "on the fly" from a repertoire of standard parts that reside on the net. You might call this the "building block" approach to programming. Among the important features of Java are the following:
- It is extremely portable. Java code is compiled to a form known as "bytecode". This is a sort of generalized computer code that is not executable by any particular machine, but is recognized by the "Java Virtual Machine". It is as bytecode that Java applets transverse the net. The Java Virtual Machine (VM) resides on the computer where the applet is to be executed and converts the bytecode to the native code for that machine. Currently, Java VMs exist or are planned for all current versions of Windows, Solaris, MacOS, OS/2, Linux, Amiga, and other platforms.
- It is fully object-oriented. Languages like C++ that add object-oriented features to non-object-oriented languages must make compromises. Java applets do not allow violation of object-oriented principles such as "encapsulation".
- It uses a C-like syntax. This makes the language easier for C programmers to learn.
- It is multi-threaded, in effect executing several chains of control flow concurrently. The Java language itself provides tools for managing the threads, rather than relying exclusively on the OS.
- It prohibits direct memory manipulation. In Java, there are no pointers and no direct memory allocation. This eliminates a rich source of C's functionality, and an even richer source of its bugs.
- You can embed calls to Java applets in Web pages, and the applet will be executed by the browser, provided it is Java-enabled. Most major browsers plan to support Java.
Note: Though powerful, Java is a young technology. Oracle WebServer supports it because of its rich features and wide acceptance. However, you should be aware that it may be somewhat less stable than more mature technologies.
Oracle WebServer supports the use of Java either on the client, which is to say any Java-enabled Web browser, or on the server. Code to be executed on the client is for the most part extracted and manipulated like other data. The best way to handle such code is to store it in the OS file system and extract it in real time.
You can also execute Java as a WRB cartridge on the WebServer itself. You might want to do this, for example, to perform graphical manipulation for which PL/SQL is ill-suited. For example, you can combine several graphics from the database into a single image. Each region of the image would be a separate button that the user can click, and each button clicked would produce a different effect. In HTML, this is called an "image map". Using Java on the server, you could generate such image maps dynamically, with the components of the image being based on the results of a database query.
To execute Java on the server, you use the WRB API to interface directly to the Java Interpreter residing in the WebServer. This interpreter finds and executes the Java code and returns the results, through the WRB interface, to the Web Listener.
To make it easier for you to develop Java applications, Oracle WebServer provides the Java Web Toolkit, a group of Java packages containing classes to aid in database access and dynamic HTML generation.
Since PL/SQL code is actually part of the database, you can call it from within Java, which enables you to create applications that combine the strengths of both languages. Because PL/SQL execution takes places in the database, doing this does not hinder the portability of the application. A PL/SQL application can execute without modification on any platform where the Oracle7 Server runs, just as a Java applet can execute without modification on any platform that has a Java Virtual Machine (VM).
Go to the top of the section.
Go to the previous topic.
Go to the next topic.
Go to the Table of Contents.
Go to the Index.
This document was last modified at 07:32pm PDT on April 29, 1996.
To report any problems or comments, e-mail Oracle WebServer Documentation.