File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connecting to Oracle from Java

 
Rajesh Agarwal
Ranch Hand
Posts: 79
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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();
ocpds.(datastoreProp.getProperty("DBURL"));
ocpds.setUser(datastoreProp.getProperty("ORACLE_ID"));
ocpds.setPassword(datastoreProp.getProperty("ORACLE_PASSWORD"));
ocpds.setNetworkProtocol(datastoreProp.getProperty("Protocol"));
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;
occi.setMaxLimit(j);
occi.setCacheScheme(1);
}
}


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
Marshal
Posts: 33671
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic