This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

use of properties file  RSS feed

 
Arun Kumar
Ranch Hand
Posts: 135
Chrome Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!