Its better to store the configuration properties in a database table so that it can be managed easily for different environments. The approach to store and retrieve the configuration properties from database table in xml based configuration is like below :
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" /> <property name="properties"> <bean class="org.apache.commons.configuration.ConfigurationConverter" factory-method="getProperties"> <constructor-arg> <bean class="org.apache.commons.configuration.DatabaseConfiguration"> <constructor-arg> <ref bean="dbDataSource" /> </constructor-arg> <constructor-arg value="DOMAIN_CONFIG" /> <!-- DB Table --> <constructor-arg value="CONFIG_NAME" /> <!-- DB Key Column --> <constructor-arg value="CONFIG_VALUE" /> <!-- DB Value Column --> </bean> </constructor-arg> </bean> </property> </bean> But the same thing i'm trying to achieve using java based configuration but no luck. Can anyone please help me.