Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Connect OAS 9.0.2.1 with Oracle 8i DB?

Status
Not open for further replies.

mz74

Programmer
Aug 4, 2002
17
0
0
GB
Hi all,

I want to know how to connect OAS 9 with Oracle 8i DB while both these are installed on different machines.

Server1 : Oracle 8i DB
Server2 : Oracle Application Server

Now the problem is that OAS is unable to connect with DB on Server1. It will be highly appreciated if anyone can help in this regard. Can we do this during installation or it can be configured anytime?

Thanks
Zaki

 
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:eek:racle:thin:mad: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:eek:racle:thin:mad: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:eek:racle:thin:mad: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=&quot;my-datasources.xml&quot; />
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top