|
Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide
10g Release 3 (10.1.3) B14428-01 |
|
![]() Previous |
![]() Next |
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:
"Data Sources" in the Oracle Containers for J2EE Services Guide
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.
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:
http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/index.html
http://www.oracle.com/technology/tech/java/newsletter/articles/oc4j_datasource_config.html
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)