Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...On your site I feel quite confident that the contacts and feedback will make my life a little less hectic..."

Geography

Where in the world do Tek-Tips members come from?

How to Connect OAS 9.0.2.1 with Oracle 8i DB?

mz74 (Programmer)
29 Sep 03 5:44
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

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" />

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close