YOU ARE HERE: Home > Tech > J2EE > Article

Java Capabilities of Oracle 9i
By SAMS This article was not rated yet.
 
Printer Version Printer Friendly | Add As Favorite | Link to Article

Introduction

Several important features have made Java a very powerful language, and it has quickly become a key component of developing and deploying e-business applications. These are some of the Java features that are useful in implementing e-business systems:


  • Object-oriented language

  • Allows applications to be developed using an open standard

  • Makes it possible to develop portable applications

  • Code reuse is possible with the help of Java Beans and Enterprise Java Beans (EJB)

  • Applications can be deployed in a variety of configurations, such as n-tier

  • Developed code can be executed in browsers as well as application servers and databases

    Oracle has recognized the importance of supporting Java capabilities. This article discusses some of the key features provided.


    Java Support in Oracle9i

    Oracle provides extensive support for Java in all tiers of deployment.

    The enterprise-class Java server platform has an integrated Java Virtual Machine. Features of the Java Virtual Machine include the following:

  • Support for Java 2 EE.

  • Support for shared Java bytecode as well as lightweight Java threads.

  • Memory manager and garbage collector that optimizes the use of the System Global Area (SGA) and the operating system's virtual memory manager.

  • Java classes can be stored in the database as library units and managed just like other database objects.

  • Support for JDBC drivers.

  • SQLJ translator is provided, enabling SQL code to be embedded in Java.

  • NCOMP Java compiler is provided to aid the translation of Java bytecode into more efficient C executables.

  • Support for standard Java libraries such as Java.lang, Java.io, and Java.util.

  • Support for Java stored procedures.

  • LoadJava and DropJava utilities allow Java programs to be loaded into and unloaded from the database, respectively.

  • CORBA-compliant ORB (Object Request Broker) is provided.

  • Support for Enterprise Java Beans is provided at the database as well as application server level.

  • Integrated with Oracle Enterprise Manager.

  • Traditional security mechanisms such as roles, grants, and invoker rights that are generally used with PL/SQL can be used with Java stored procedures.

  • Access from virtually any client is possible with the support of a variety of standard Internet protocols such as IIOP, HTTP, Internet mail (IMAP4, SMTP, and POP3) and Net8.

  • Java stored procedures, CORBA servers, and EJBs can be accessed using Secure Sockets Layer (SSL) over Net8 and IIOP.

  • Multiple application servers and databases can be accessed with a single intranet or Internet sign-on.

  • Support for Business Components for Java (BC4J).



  • In addition to the Java Virtual Machine (JVM) that allows data-intensive Java stored programs to run in the database server, the JVM is also integrated with the Oracle iAS as a Java cartridge. Two types of programming models are supported by the Java cartridge:

  • Development of CORBA servers with the help of JCORBA

  • Generation of static and dynamic web pages with the help of JWEB


    Java applications can be quickly developed and deployed using a variety of tools provided:

  • JDBC drivers allow database connectivity from Java.

  • An integrated development environment (IDE) allows the development of Java programs. JDeveloper is also integrated with JDBC and the SQLJ translator.

  • CORBA connectivity.

  • SQLJ translator.

  • JavaBeans and EJB development.

    Client-Side Programmatic Interfaces

    Oracle9i provides two different client-side programmatic interfaces: JDBC and SQLJ.

    JDBC is a standard set of classes that allow application developers to access and manipulate relational databases such as Oracle from within Java programs. Three types of JDBC drivers are available from Oracle:

  • Ultra-thin JDBC driver. Useful for developing Java applets.

  • Thin JDBC driver. Useful for developing Java applets. Scalability can be achieved by using Oracle Net connection manager.

  • JDBC/OCI driver. This driver uses client libraries such as OCILIB, CORE, and Net8. Database access is provided by means of OCI calls. This driver is not suitable for Java applets because it can't be downloaded and requires client installation of the driver.
  • The type of driver used only affects the connect string; therefore, regardless of the type of driver used, the program essentially remains the same and provides several features:

  • Manipulation of LOB data

  • Support for all Oracle7, Oracle8/8i, and Oracle9i datatypes

  • Access to PL/SQL and Java stored procedures

  • Support for all Oracle character sets

  • Performance enhancement features such as arrays, prefetching, and batching of SQL statements

  • SQLJ is built on top of JDBC and allows developers to embed SQL statements within Java programs. A SQLJ translator converts the SQLJ statements into equivalent JDBC calls before execution. Use of SQLJ results in compact code that's easy to debug because it allows for early compile-time detection of errors in SQL statements.

    Application Development

    The Oracle Java Server platform allows a lot of flexibility in terms of application development. Four different types of application developers are supported:

  • Database programmers. Traditional stored procedures, triggers, and object-relational methods that are generally written with the help of PL/SQL can be written using Java. Any standard development environment such as Visual Caf?, Oracle JDeveloper, Inprise JBuilder, and so on can be used to develop the Java application. The Java application can be loaded into the database server as a source file or packaged into a Java archive (JAR) file. The loaded file remains in the database as a persistent store in the form of a library unit and can be managed (for security-related matters) just like other database objects. The execution of these loaded Java objects can be supported by the JVM.

  • Component developers. Reusable server code can be written in the form of Enterprise Java Beans (EJBs), which can be supported by the JVM in the database or by the Java cartridge in the Oracle iAS. The EJBs can be deployed in a two-tier or a multi-tier configuration and support various types of clients, such as the following:

    1.Pure Java clients communicating with the database using RMI (Remote Method Invocation) tunneled over IIOP (Internet Inter-ORB Protocol).

    2.CORBA clients using CORBA IIOP.

    3.ActiveX/COM clients communicating via DCOM/CORBA half bridge.

    EJB clients and servers communicate using the RMI (Remote Method Invocation) type system, which is more flexible than the SQL type system.

  • Distributed application developers. CORBA servers can be written in Java. Oracle9i provides a CORBA-compliant Object Request Broker (ORB) that allows applications to access Java stored procedures and EJBs through the IIOP protocol. Java applications can also be written to call out of the database and communicate with other ORBs through IIOP. Use of CORBA servers allows the integration of applications in many different languages and distribution of these applications on different servers. CORBA clients and servers communicate using the IDL (Interface Development Language) type system which is more flexible than the SQL type system.

  • Web developers. Java server pages can be used to embed Java tags in HTML pages. These Java tags allow the generation of dynamic HTML pages using data that's queried from the database.

    Oracle Facilities Common to PL/SQL and Java

    In Oracle8i and above, PL/SQL and Java share a number of common facilities:

  • Library management. The basic storage unit for packages, procedures, tables, and so on in Oracle databases is a library unit. PL/SQL and Java objects can be stored and retrieved as library units. Both languages provide library unit management facilities so that the appropriate procedures and classes can be loaded at runtime. In addition, the library unit management facilities manage information related to inter-unit dependency and automatically recompile dependent binaries when the source is modified. When Java files are loaded into the Oracle database as schema objects using the LoadJava utility, the object name is derived from the fully qualified name of the class, including the package name. The following types of Java files can be loaded as library units:

    1. Java source files

    2. Java class files

    3. Java resource files

    4. SQLJ input files

    5. Uncompressed Java archives (JAR) or ZIP files


  • Security model. A common security model is used by PL/SQL and Java. Both privilege modes, namely definer and invoker rights, are supported. User authentication can be performed using either the standard database username/password mechanism or SSL certificate. When communicating with either PL/SQL or Java programs, the communication between client and server can be encrypted using SSL x.509v3 certificates.

  • SQL access. Both PL/SQL and SQLJ provide compile-time checking of SQL statements. The following items are checked:

    1. SQL syntax

    2. Type compatibility of host variables

    3. Correctness of the query in reference to the definition of Oracle objects

    Dynamic SQL statements supported by PL/SQL and JDBC include the following:

    1. SQL statements

    2. Anonymous PL/SQL blocks

    3. Data Definition Language statements

    4. Transaction Control statements


  • SQLJ doesn't support dynamic SQL directly, but it can be used to make JDBC calls for dynamic SQL.

    A number of PL/SQL packages?such as DBMS_DDL, DBMS_MAIL, DBMS_OUTPUT, and UTL_FILE?have equivalent Java implementations, but not all packages have this equivalency. It should be noted that when an equivalent Java implementation doesn't exist for a PL/SQL package, you can generally call the PL/SQL package using JDBC or SQLJ.


    Conclusion

    The integration of Oracle JServer platform with Oracle9i allows new Java applications to be written against existing schemas. Server-side Java logic can also be added to extend existing schemas (by means of object methods) and applications. Developers can therefore develop business logic using the language of their choice. In addition, the IDL type system used by CORBA objects and RMI type system used by EJB objects can be used to overcome some of the limitations of the SQL type system; for example, allowing complex and multi-valued attributes such as multidimensional arrays to be passed efficiently between clients and servers.

    More and more web-based applications are being written using Java to access an Oracle database because Oracle provides a secure and scalable Java engine. Further, Java support in the server allows you to extend the kind of services and programs that run in the server.


    Was this article helpful to you?yesno

    Related Publications
     
    Using iBATIS and struts
    Using iBATIS in web applications
    Using Struts and Hibernate (Part III)
    Using Struts and Hibernate (Part II)
    Using Struts and Hibernate (Part I)
    Using Hibernate In J2EE Applications (Part I)
    Effective Ant Build For Developers
    Introduction To Struts By Example
    How To Build Custom JSP Tags (Part II)
    How To Build Custom JSP Tags (Part I)
    Configuring SSL on BEA WebLogic Server 8.1

    (Registered users can post questions/comments)

     
     TLINKS SEARCH
    Advanced Search
    Help
     Recommended Links
    Red Cross
    Responding to hurricane katrina relieve. Donate today. It's a Great Feeling to Help.
    http://www.redcross.org
    Getusjobs.com
    Getusjobs.com is the job site focused on American jobs. See the results that put us on top.
    http://www.getusjobs.com
    Database Tool
    TLinkSoft® tools empowers developers, integrators and DBAs to be more productive.
    http://www.cppunit.org/download.jsp
    USAnalyst.com
    USAnalyst.com provide a community for database analysts, business analysts, developer analysts and managers.
    http://www.cppunit.org/article

    Powered by Tlinks Systems