Skip Headers
Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide
10g Release 3 (10.1.3)
B14428-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

Configuring a Data Source for an Oracle Database

To create a data source for an Oracle database, you create a managed datasource. You can create a manged data source using the Application Server Control Console (see "Using Application Server Control Console") or deployment XML (see "Using Deployment XML").

For more information, see:

Using Application Server Control Console

You can use Application Server Control Console to create a managed data source dynamically without restarting OC4J.

For more information, see http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/index.html.

Using Deployment XML

You can configure a managed data source for an Oracle database by configuring a connection-pool element and managed-data-source element in the data-sources.xml file as Example 20-1 shows.

Example 20-1 data-sources.xml For an Oracle JDBC Data Source

<connection-pool name='Example Connection Pool'>
    <connection-factory
        factory-class='oracle.jdbc.pool.OracleDataSource'
        user='scott'
        password='tiger'
        url='jdbc:oracle:thin:@localhost:1521:ORCL'>
    </connection-factory>
</connection-pool>
<managed-data-source
    connection-pool-name='Example Connection Pool'
    jndi-name='jdbc/COMMONLocalDS'
    name='COMMONLocalDS'
/>

For more information, see:

If you configure a managed data source using this method, you must restart OC4J to apply your changes. Alternatively, you can use Application Server Control Console to create a data source dynamically without restarting OC4J (see Using Application Server Control Console)