• Post Reply Bookmark Topic Watch Topic
  • New Topic

Relational Links to .txt files (Eclipse Indigo)

 
Greg Reeder
Ranch Hand
Posts: 99
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21867
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 99
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, that was the key.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!