Oracle
  Home arrow Oracle arrow Page 4 - Configuring the OC4J Server
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
Moblin 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
IBM developerWorks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ORACLE

Configuring the OC4J Server
By: McGraw-Hill/Osborne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2007-03-01

    Table of Contents:
  • Configuring the OC4J Server
  • Configuring OC4J
  • Specifying Other J2EE Applications
  • Other OC4J Server XML Files
  • The Web Site XML Files

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!

    Configuring the OC4J Server - Other OC4J Server XML Files


    (Page 4 of 5 )

    Besides the main OC4J configuration file, server.xml, several other OC4J server XML files help to configure the OC4J instance. Let’s take a quick look at these.

    jazn.xml and jazn-data.xml   The jazn-data.xml and the jazn.xml files are used for security configuration if you’re using the Java Authentication and Authorization (JAAS) Service. The file contains user and group configuration information for the default JAZNUserManager client-admin console.

    The data-sources.xml file   To make their applications portable across servers, application developers use logical representation of databases and publish these data sources in the Java Naming and Directory Interface (JNDI) tree. The applications retrieve database connections through javax.sql.dataSource objects and look up the objects through the JNDI. These objects are called data sources, and the deployer must specify the mapping between a logical dataSource object and the physical databases. The connection methods that are specified are used by the applications to connect to the specified database.

    on the job:  The properties and methods of the data source objects are specified by the javax.sql.DataSource interface.

    The data-sources.xml file lets you configure OC4J database sources used by the various applications hosted by the OC4J instance. In addition, the file contains information on retrieving JDBC connections. The data-sources.xml file contains the following types of information:

    1. JDBC driver
    2. JDBC URL
    3. Database schema
    4. Maximum number of database connections allowed
    5. Username and password for the data source
    6. JNDI name in the JNDI lookup, to retrieve the data source

    Note that the data-sources.xml file establishes the data source object definitions at the OC4J instance level. These global data sources are specified by an XML tag, and the XML attributes for each data source include the JDBC connection string and sometimes the username and password information. All applications deployed in the OC4J container can share the data sources defined at the container level. Applications can also use application-specific data sources by incorporating the <data-sources> tag in the application.xml file to refer to the data-sources.xml file and directly use the data sources defined therein.

    When the OC4J instance starts, it parses the data-sources.xml file, instantiates the DataSource objects, and binds them into the JNDI namespace. After you deploy an application, the application accesses the data sources by looking up the JNDI tree. Note that there’s a separate JNDI namespace for each application.

    The different types of data sources, such as emulated and non-emulated data sources as well as native data sources, are discussed in detail later in this chapter. Here’s a typical data-sources.xml file showing how to use the Oracle JDBC driver to create a JDBC thin connection type data source:

      <data-sources><data-source>  
      class=<<">>com.evermind.sql. DriverManagerDataSource
      name="OracleDS"
      location="jdbc/OracleCoreDS"
      xa-location="jdbc/xa/OracleXADS"
      ejb-location="jdbc/OracleDS"
      connection-driver="oracle.jdbc.driver.OracleDriver"
       username="scott" password="->pwForScott"
      url=
    "jdbc:oracle:thin:@localhost:1521:oracle"
       inactivity-timeout="30"
       connection-retry-interval="1" />
      <data-source>
      </data-sources>

    In the sample data-sources.xml file, this is what the various elements stand for:

    • Class is the type of data resources or the DataSource class.
    • Name is the name of the data source—in our case, OracleDS, which is the default data source.
    • Location, xa-location, and ejb-location are the JNDI names that the data source will bind to. You must specify all three of the location attributes for emulated data sources, but you use only the value specified for the ejb-location attribute.
       
    • Connection-driver is the type of connection to be returned. This attribute refers to the class that actually implements the data source connection.
    • Username and password are the username and password for the database users.
    • url is the JDBC connection URL for the database being mapped to this data source.
    • Inactivity-timeout and connection-retry-interval are the default timeout and connection retry intervals, in seconds.

    principals.xml   The principals.xml file contains user and group information as well as permissions and certificates.

    rmi.xml   The rmi.xml file contains Remote Method Invocation (RMI) configuration information. The RMI listener, which provides remote access for EJBs, has its settings defined in this file as well. Here are the main components of the rmi.xml file:

    • Host name or IP address
    • Port number to which the RMI server binds
    • Clustering and log settings

    jms.xml   The jms.xml file contains the OC4J Java Messaging Service (JMS) implementation configuration information. The following are the key components in this file:

    1. Host name or IP address
    2. Port number to which the JMS server binds
    3. Settings for queues bound to the JMDI tree
    4. Log settings

    on the job:  The global application for the OC4J server acts as the parent for all applications in that OC4J instance. The applications inherit the parent application’s properties, but you can override the default parent application properties with application-specific properties.

    More Oracle Articles
    More By McGraw-Hill/Osborne


       · This article is an excerpt from the book "Oracle 10g Application Server Exam Guide,"...
     

    Buy this book now. This article is excerpted from chapter eight of the book Oracle 10g Application Server Exam Guide, written by Sam Alapati (McGraw-Hill; ISBN: 0072262710). Check it out today at your favorite bookstore. Buy this book now.

       

    ORACLE ARTICLES

    - Tuning PL/SQL Code
    - Debugging PL/SQL Code
    - Testing PL/SQL Code
    - Working With PL/SQL Code
    - Conditional Compilation for Oracle Database ...
    - Compile-Time Warnings for Oracle DB 10g
    - Compiling PL/SQL Code for an Oracle Database
    - Troubleshooting PL/SQL Code
    - Managing PL/SQL Code
    - Data Manipulation and More for HTML DB Appli...
    - Oracle Database Fundamentals
    - Adding Processes to HTML DB Applications
    - Adding Computations, Processes, and Validati...
    - Sub-templates and More with Oracle HTML DB
    - Focusing on Templates in Oracle HTML DB




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway