| Author |
Question on Properities class
|
Dinesh Tahiliani
Ranch Hand
Joined: Aug 06, 2007
Posts: 486
|
|
Hello Ranchers, I have heard that Properties class/file is very helpful whenver you want to add something new to existing,instead manipulating the java code, you can just add new things to properties file and that will reflected in your o/p when you compile java code. Can someone please explain its use with example please..... I will be thankful to you all. Thanks in advance Dinesh
|
Thanks<br />Dinesh
|
 |
Kishore Kumar
Ranch Hand
Joined: Oct 15, 2007
Posts: 71
|
|
Hi, I am giving a small example of how to read the properties file. In the properties file, i am using Driverclass, Drierurl, username and password which are useful for obtainging database connection. I am reading the properties file through java code. So, later when you change the driver also, just change the properties file. ans Run the program, all the changes will be reflected in your program. //Property.java while running the above file use java -DFile="Path where you stored the file.props file"
|
 |
 |
|
|
subject: Question on Properities class
|
|
|