title: Loading application configuration properties from database in spring based application using java based configuration
body: <p>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 :</p>
  
  <pre><code>&lt;bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;
     &lt;property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" /&gt;
     &lt;property name="properties"&gt;
        &lt;bean class="org.apache.commons.configuration.ConfigurationConverter" factory-method="getProperties"&gt;
           &lt;constructor-arg&gt;
              &lt;bean class="org.apache.commons.configuration.DatabaseConfiguration"&gt;
                 &lt;constructor-arg&gt;
                    &lt;ref bean="dbDataSource" /&gt;
                 &lt;/constructor-arg&gt;
                 &lt;constructor-arg value="DOMAIN_CONFIG" /&gt;
                 &lt;!-- DB Table --&gt;
                 &lt;constructor-arg value="CONFIG_NAME" /&gt;
                 &lt;!-- DB Key Column --&gt;
                 &lt;constructor-arg value="CONFIG_VALUE" /&gt;
                 &lt;!-- DB Value Column --&gt;
              &lt;/bean&gt;
           &lt;/constructor-arg&gt;
        &lt;/bean&gt;
     &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>But the same thing i'm trying to achieve using java based configuration but no luck.
  Can anyone please help me.</p>