Change Spring XML bean property value at runtime

87 Views Asked by At

I have datasource bean where DB password value changes automatically after 90 days. Here I want to update bean property value when password changes.

<bean id="DBCred" class="com.test.DBCredService" />
<bean class="oracle.ucp.jdbc.PoolDataSourceImpl" id="dataSource">
    <property name="connectionFactoryClassName" value="oracle.jdbc.pool.OracleDataSource"/>
    <property name="URL" value="${db.url}" />
    <property name="user" value="#{DBCred.getUserName()}" />
    <property name="password" value="#{DBCred.getPassword()}" />
</bean>

I tried to refresh Connection Pool using UniversalConnectionPoolManager but that did not use updated value.

0

There are 0 best solutions below