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  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 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: starstarstarstarstar / 8
    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:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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


    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
     

       

    ORACLE ARTICLES

    - Oracle's Turn to Play in the Sun
    - Implementing and Using Oracle`s Restore Poin...
    - 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...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    Stay green...Green IT