This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java in General and the fly likes need help regarding property file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "need help regarding property file" Watch "need help regarding property file" New topic
Author

need help regarding property file

nitude gupta
Ranch Hand

Joined: Sep 04, 2008
Posts: 34
Hi DERE!!
I am writing a Java code in which I am trying to use property file where I have defined connection details and few constants

here is my code


CheckListReportComponent.java
########################

connection.properties
########################


when I use strURL or strUser etc in getMyConnection() function I start getting err "Driver not Found!!!"
where as when I prnt these properties in main...using SOP I m able to do that..
Please suggest where I m missing n why these property are not available inside other functions

TIA......


David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

properties in the files shouldn't have quotes around them
eg
nitude gupta
Ranch Hand

Joined: Sep 04, 2008
Posts: 34
hey Thanks for the prompt reply...It worked!!!
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

You're welcome. Thanks for the feedback.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: need help regarding property file
 
Similar Threads
Help with Chat software
Not able to execute after sucessfull compilation
please help me to sove the GZIP exception
how to read config file from other mahine using java
JDBC connection for DB2 database