I'm using Spring in a console Java application. My application will be deployed like:
folder/myJar.jar
folder/db/connection.properties
How do I load the connection.properties in a PropertyPlaceholderConfigurer
in application context?
I have tried
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="db/connection.properties"/>
</bean>
but it won't work.
I need it this way for my database username/password and other details.
Add the prefix
file:
to the location value:Specify that the file is on the classpath in the value attribute