It's not a secret anymore!
The moose likes JDBC and Relational Databases and the fly likes Connecting to Oracle from Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Connecting to Oracle from Java" Watch "Connecting to Oracle from Java" New topic

Connecting to Oracle from Java

Rajesh Agarwal
Ranch Hand

Joined: Aug 01, 2005
Posts: 79
Hi All, I am hosting a application which is runnind well on a Unix Dev region to my own local PC. Also the appserver in dev is websphere, but I am now hosting it on Weblogic. I am getting DB connection error as follows. Help is appreciated.

The system uses these 2 classes

import oracle.jdbc.pool.OracleConnectionCacheImpl;
import oracle.jdbc.pool.OracleConnectionPoolDataSource;

and sets all the database properties reading them from a property file as below.

if(datastoreProp == null)
datastoreProp = new PersistenceProperties(s, s1);
if(ocpds == null)
DBSCHEMA = datastoreProp.getProperty("DBSchema");
ocpds = new OracleConnectionPoolDataSource();
if(occi == null)
occi = new OracleConnectionCacheImpl(ocpds);
occi.setMinLimit((new Integer(datastoreProp.getProperty("MinLimit"))).intValue());
int i = occi.getMinLimit();
int j = (new Integer(datastoreProp.getProperty("MaxLimit"))).intValue();
if(i > j)
j = i;

I am not able to connect to the db using the above. My doubt is do I need to set any Datasource in weblogic. if Yes then what would be the Datasource Name, I dont see any name being used in the code.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33098

Originally posted by Rajesh Agarwal:
I am getting DB connection error as follows.

I see the code, but not the message in your post.

ocpds. (datastoreProp.getProperty("DBURL"));

I think there was a copy/paste error. The above line doesn't even compile. Can you fill in the blank on this one. I don't want to assume anything since it is such an important line.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Connecting to Oracle from Java
It's not a secret anymore!