My project is based on Spring 4.1.0 and its datasource is configured as following. How can I convert this to use credential and other properties from AWS-Secret-manager?
<bean name="test_dbDS" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${test_db.connection.driver_class}" />
<property name="username" value="${test_db.connection.username}" />
<property name="password" value="${test_db.connection.password}" />
<property name="url" value="${test_db.connection.url}" />
<property name="maxIdle" value="${test_db.minPoolSize}" />
<property name="maxActive" value="${test_db.maxPoolSize}" />
<property name="validationQuery" value="${test_db.validationQuery}" />
<property name="testWhileIdle" value="${test_db.testWhileIdle}" />
<property name="testOnBorrow" value="${test_db.testOnBorrow}" />
<property name="timeBetweenEvictionRunsMillis" value="${test_db.timeBetweenEvictionRunsMillis}" />
<property name="numTestsPerEvictionRun" value="${test_db.numTestsPerEvictionRun}" />
<property name="minEvictableIdleTimeMillis" value="${test_db.minEvictableIdleTimeMillis}" />
<!-- This was the key to getting junit to rollback an insert -->
<property name="defaultAutoCommit" value="false" />
</bean>
I replaced org.apache.commons.dbcp.BasicDataSourc with com.amazonaws.secretsmanager.sql.AWSSecretsManagerMySQLDriver but it didnt work.
New contributor
Deep Kumar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.