Forums Register Login

Connecting to Oracle from Java

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
 

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.
Farmers know to never drive a tractor near a honey locust tree. But a tiny ad is okay:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1121 times.
Similar Threads
Random numbers and arrays
Stupid deployment question - Again!
converting string to integer
Rollback not working with @Transactional
RTP Streams
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:52:16.