How to separate jdbc.properties and my deployed application JAR or WAR file

I want my user to change easily jdbc.properties

in my deployed application. The user does not want to check out the compiled JAR or WAR file, edit jdbc.properties

and update it again. I googled for a solution at the time, but still can't find an answer.

I am using Spring and Hibernate using DAO.

Here is my applicationContext.xml for jdbc:

<context:property-placeholder location="classpath:jdbc.properties" />

      

I tried changing it to classpath:../jdbc.properties

etc. and find jdbc.properties

in all possible places but still doesn't work.

Can this be done? If this is not possible, how can my application load the specified jdbc.properties

location, hardcoded?

Note. This is used for a separate development and production stage in my workplace. Therefore, the developer does not know the specifications on the production side.

+3


source to share


1 answer


Many application servers (such as JBoss or Websphere) support "exploded.war" .war (or .ear) is literally a directory and you can manipulate files directly.

Otherwise, this sounds like a job for JMX:



+1


source







All Articles