| Author |
Relational Links to .txt files (Eclipse Indigo)
|
Greg Reeder
Ranch Hand
Joined: Jun 14, 2011
Posts: 99
|
|
Hi everyone,
first off, it has been a long time since I visited the ranch, so greeetings everyone! Secondly, although this question fits IO, but at the same time might be better off in an IDE forum, I hope that it is acceptable here. My problem is this:
I am working with eclipse indigo, and I want to have a configuration text file for my program. This would be home to, among a few other things, the path to my database which my program uses. The last thing I want to do is code a final path to the database directly in my db controller class. I, at the same time, do not necessarily want to do the same thing to my config file either. Is there a way to solve this problem well? I thought about it, and would like to use a relational link to my text file. Does java itself offer a solution? How would I go about working this into eclipse indigo?
Thank you for your help!!
Greg
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 13842
|
|
The usual thing is to just put the configuration file into your classpath and use code like this:
to access it.
As for Eclipse, you just put the configuration file at the root of your source code tree. In the "src" folder if you did it that way, probably.
|
 |
Greg Reeder
Ranch Hand
Joined: Jun 14, 2011
Posts: 99
|
|
Thank you, that was the key.
|
 |
 |
|
|
subject: Relational Links to .txt files (Eclipse Indigo)
|
|
|