This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I searched a bit in java.sun.com and the Java Tutorial but didn�t find anything on this topic. Thanks, Francisco
Francisco<br />SCJP<br />please use the [code][/code] tags when showing code.Click <a href="http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=ubb_code_page" target="_blank" rel="nofollow">here</a> to see an example.
Properties are passe; Preferences are the current rage. That said, properties are still useful for quick-and-easy settings. Basically, a Properties file contains key/value associations: ConnectionURL=jdbc dbc:MyDatabase DriveClass=sun.jdbc.odbc.JdbcOdbcDriver Password=pass_word UserName=web_user This is an example of a properties file specifying a Database connection. It is saved in the classpath with a .properties extension. (Say, as "MyDatabase.properties" in the "mypackage" package.) You use it by using the java.util.(Property)ResourceBundle class
Unfortunately, I've not had the time to really get into the Preferences API, so my code still uses Properties. In the coming months I'll get around to making the switch (I've wrapped the Properties API anyway, so switching to Preferences should (hopefully) noe be that big a deal.) However, you can read Thomas Paul's newsletter article on the subject. [ May 27, 2003: Message edited by: Joel McNary ]
Hi, I am developing some java classes(APIs) which will be used by other developers in there applications. I use a property file to store application dependant values. ex:log file path name. I have put the .propertie file to same folder where my class file exists. In command prompt my class is running without problem. But when I use my IDE (Eclipse 2), it does not work(it cannot fine the file)). I have added the properties file to system classpath, it also not work. Please help me. Sudheera [ May 27, 2003: Message edited by: Sudheera Liyanage ]