title: Using encrypted password for database connection in spring boot application through spring auto configuration
body: <h2>Trying to use encrypted database password to connect to database using spring auto configuration</h2>
  
  <p>I am using Spring auto configuration to connect to database. For that i added below properties in properties file: </p>
  
  <pre><code>spring.datasource.url=jdbc:oracle:thin:@ABCDE2D.com:1888:ABCDE2D1
  spring.datasource.username=user
  spring.datasource.password=password
  spring.datasource.driver-class-oracle.jdbc.driver.OracleDriver
  </code></pre>
  
  <p>In my dao class, i have @Autowired NamedParameterJdbcTemplate and using it directly to get data from database.</p>
  
  <blockquote>
    <p>Till here it is working fine.</p>
  </blockquote>
  
  <p>Now i need to encrypt the password in properties file.
  For that i did the below:</p>
  
  <blockquote>
    <ol>
    <li>Added jasypt-spring-boot-starter in pom</li>
    <li>Added spring.datasource.password=ENC(NoIv2c+WQYF3LenN0tDYPA==) in properties file</li>
    <li>Added jasypt.encryptor.password=key in properties file</li>
    </ol>
  </blockquote>
  
  <p>Now i am getting the below error:</p>
  
  <pre><code>Failed to bind properties under 'spring.datasource.password' to  
  java.lang.String:
  Reason: Failed to bind properties under 'spring.datasource.password' to   
  java.lang.String
  </code></pre>