|
meara (Programmer) |
29 Sep 03 12:39 |
Hi Zaki,
You can do this anytime and don't need to worry about it during installation.
A) Creating a Global DataSource in Oracle9iAS
Basically, you need to go into the OEM website and set up a "DataSource" with the settings it needs to connect to your 8i DB (e.g. a username, password, JNDI name, etc.). This will then be made available to your J2EE apps through JNDI. (You can either look it up at that global JNDI location, or remap it to a different location in your deployment descriptors.)
In other words: 1. Log on to the Oracle Enterprise Manager Web Site 2. Select your OC4J instance on the first screen 3. Click on the Data Sources link on the instance screen 4. Click "Create Data Source" 5. Enter values for all of the fields, e.g.: Name: what you want to call it Data Source Class: com.evermind.sql.DriverManagerDataSource Username: your db username Password: your db password JDBC URl: jdbc:oracle:thin:@yourdbserver:1521:yourinstance JDBC Driver: oracle.jdbc.OracleDriver Location: jdbc/YourDataSourceJNDILocation XA Location: jdbc/xa/YourDataSourceJNDILocation EJB Location: YourDataSourceJNDILocation (Obviously you should change all these to your real values) 6. Create it
B) Creating a global DataSource in OC4J Standalone
The instructions above assume that you're using the full Oracle9iAS installation. If you're using OC4J standalone, then just add an entry to j2ee/home/config/data-sources.xml like this:
<data-source class="com.evermind.sql.DriverManagerDataSource" name="MyDataSource" location="jdbc/MyDataSource" xa-location="jdbc/xa/MyDataSource" ejb-location="MyDataSource" connection-driver="oracle.jdbc.OracleDriver" username="mydbuser" password="mydbpassword" url="jdbc:oracle:thin:@mydbserver:1521:mydbinstance" inactivity-timeout="30" />
C) Creating an application-specific DataSource
With OracleAS, you also have the option of configuring a datasource at the application level. In this case, you should configure it in a data-sources.xml type file and then refer to that in the orion-application.xml that you package with your app. In this case, it will only be available to that particular app.
For example, your data source config file should include something like this:
<data-source class="com.evermind.sql.DriverManagerDataSource" name="MyDataSource" location="jdbc/MyDataSource" xa-location="jdbc/xa/MyDataSource" ejb-location="MyDataSource" connection-driver="oracle.jdbc.OracleDriver" username="mydbuser" password="mydbpassword" url="jdbc:oracle:thin:@mydbserver:1521:mydbinstance" inactivity-timeout="30" />
Assuming you name this my-datasources.xml, then you can point to it in your orion-application.xml like this:
<data-sources path="my-datasources.xml" /> |
|