Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide 10g (10.1.3.1.0) Part Number B28221-02 |
|
|
View PDF |
To create a data source for a third-party (non-Oracle) database, you create a native datasource. You can create a native 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 the following:
"Data Sources" in the Oracle Containers for J2EE Services Guide
You can use Application Server Control Console to create a native data source dynamically without restarting OC4J.
For more information, see http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/index.html
.
Example 20-2 shows how to define a native data source element for a third-party database (in this example, SQLServer).
Example 20-2 data-sources.xml for a Third-Party Database
<native-data-source name="nativeDataSource" jndi-name="jdbc/nativeDS" description="Native DataSource" data-source-class="com.ddtek.jdbcx.sqlserver.SQLServerDataSource" user="frank" password="frankpw" url="jdbc:datadirect:sqlserver://server_name:1433;User=usr;Password=pwd"> </native-data-source>
By default, a native data source supports only local transactions. For global (two-phase commit) transactions, configure a managed data source. For more information, see "What Transaction Types do Data Sources Support?").
For more information, see the following:
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 native data source using this method, you must restart OC4J to apply your changes. Alternatively, you can use Application Server Control Console to create a native data source dynamically without restarting OC4J (see "Using Application Server Control Console")