Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

db.properties file location

843841Jul 25 2003 — edited Jul 25 2003
Hi there,

I'm using your DBConnectionManager class from http://webdevelopersjournal.com/columns/connection_pool.html and it's great. Although, now i'm facing some problems with the location of the
db.properties file.

I had it working just fine with Tomcat 4.1.17. I had to update Tomcat to
version 4.1.18, and now i'm receiving "Can't read the properties file. Make
sure db.properties is in the CLASSPATH". But the location is indeed in the
CLASSPATH and my db.properties is in the very same loation it was prior to
my Tomcat update, so i believe it was supposed to be working.

In addition to that, i am just developing the servlets under Win98, but they
will actually run under linux.

In order to try that to work, i tried i little adjustment of the code. Here
is what i did:

String strPath = System.getProperty("user.home") +
System.getProperty("file.separator") + "db.properties";
InputStream is = getClass().getResourceAsStream(strPath);

"System.getProperty("user.home")" returns c:\\Windows, so i placed
db.properties under this directory, which i believed would work, but it
didn't.

Now can you help me figure out a way to fix that?
Any kind of hint will help.

thanks a lot.

eduardo
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 22 2003
Added on Jul 25 2003
2 comments
312 views