I need to SECURELY externalize a username and password for a Spring application context used by some integration tests (for my application itself, I use JNDI).
The idea is like this:
application.properties application/
Then my spring application context datasource bean would look something like this:
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost/my_database" />
<property name="username" value="${application.username}" />
<property name="password" value="${application.password}" />
<property name="initialSize" value="3" />
<property name="maxActive" value="10" />
</bean>
The trick is that in the .properties file, the password must be encypted as well.
I have no idea if this is even possible, but maybe someone has an idea?
Jason