If you define a datasource within Spring's applicationContext.xml, and don't want to put the db's parameters hardcoded into the file, but have them read from an external configuration file, you can use Spring's PropertyPlaceholderConfigurer
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="file:${jdbc.configuration}"/>
</bean>
<!-- Datasource -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driverClassName}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.user}"/>
<property name="password" value="${jdbc.password}"/>
</bean>
and set the "jdbc.configuration" parameter as a VM parameter. When the propertyResolver doesn't find an existing property, it tries to fallback on the VM's system parameters, and this is just what we need.
Only the external configuration file contains the actual jdbc values, while applicationContext.xml doesn't contain any hardcoded data. Very smooth and clean!