| Author |
use of properties file
|
Arun Kumar
Ranch Hand
Joined: Jan 21, 2005
Posts: 128
|
|
I need to connect to a database I have specified the driver class and url in a .properties file, I have placed this .properties file in the classes folder of WEB-INF once I create the war file and sent it to the client, They need to change the url but since we are delivering a war file they cannot do it. How can i achieve this?
|
 |
Deepak Bala
Bartender
Joined: Feb 24, 2006
Posts: 6603
|
|
Dont put it in your war file. Maintain a seperate folder where all the apps properties files will be available. If it is too late to do that you could write a program that programatically opens the war file, and replaces the properties file with the URL that the client wants. They could run it from a java program like so... java com.RestoreProperties c:\java\warFile.war myURL I think you should be able to open the war file using the JarFile class http://java.sun.com/j2se/1.4.2/docs/api/java/util/jar/JarFile.html
|
SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
|
 |
 |
|
|
subject: use of properties file
|
|
|