title: how to override JndiObjectFactoryBean in spring and set decrypted password in java
body: <p>I have a datasource in tomcat which has password that is encrypted using some algorithm and I want to decrypt the same when i establish connection with DB.</p>
  
  <p>Following is my spring config code</p>
  
  <pre><code>&lt;!--&lt;bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"&gt;
      &lt;property name="jndiName" value="${jdbc.jndiName}"/&gt;
  &lt;/bean&gt;--&gt;
  
  &lt;bean id="dataSource" class="my.app.util.EncryptedDataSource"&gt;
      &lt;property name="jndiName" value="${jdbc.jndiName}"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>The above bean is a custom one that extends the JndiObjectFactoryBean</p>
  
  <pre><code>public class EncryptedDataSource extends JndiObjectFactoryBean{ ... }
  </code></pre>
  
  <p>What should I do here to get the encryted password and set it back.
  I have my decrytion algorithm with me but I am not sure which super class method will fetch me the password that i can set back again.</p>
  
  <p>Please suggest, i have search and tried a lot.</p>