The Java Virtual Machine (JVM) runs Java applications. If you create a Java application on your desktop, it will run without any modification on your mainframe because both your desktop and your mainframe have JVM. That's the advantage of using Java for your application programming. And Java is quickly becoming one of the most popular programming platforms around. Oracle has JVM built into the database server itself. This means that you can run Java applications inside your database. You can also deliver an applet to a Web page using the built-in features of your Oracle database and no Web server is needed. Look at the following series of images below to see more advantages of using the Oracle JVM.
With the ubiquity of Java on the Web, you may be tempted to create a fully Java-based database application. In that architecture, the client communicates with the application server via either HTTP or the Internet Inter-ORB Protocol (IIOP)
. Within the database, you can create Java classes, and the application server would interact with those Java classes via IIOP. Thus, you can create a Web-enabled database that does not rely on Oracle Network Services for any of its connectivity. Within the database, you can write your stored procedures in either PL/SQL. In general, you should use these languages for the functions they perform best:
- PL/SQL for database interaction and
- Java for non-database-related functions.
If you use Java exclusively throughout your application, you should expect to encounter performance or functionality limitations during its production usage. Java is well suited for use on the client and application server. In your application development process, you should test the implications of using Java in place of PL/SQL or SQL for your database access. PL/SQL has been part of the Oracle kernel for over a decade and is well suited for quick data retrieval and manipulation.
You will find a good tutorial on creating Web applets that query database tables in the Oracle demo directory under the SQL Developer installation.
Java Applets are primarily used as client software components that are installed remotely in order to produce trouble shooting.
The next lesson describes interMedia, an Oracle add-on tool.