title: springboot + JDBTemplate (No datasource specified error even though specified in application.properties
body: <p>Application.properties</p>
  
  <pre><code>spring.datasource.url=
  spring.datasource.username=
  spring.datasource.password=
  spring.datasource.driver-class-name=
  </code></pre>
  
  <p>i placed this <code>application.properties</code> in resources folder.</p>
  
  <p>Java Class</p>
  
  <pre><code>@Component
  public class data{
  
        @Autowired
        private JdbcTemplate jdbcTemplate;
  
        public void queryData(){
            String sql = "select * from DEPOSIT";
            jdbcTemplate = new JdbcTemplate();
            jdbcTemplate.execute(sql);
        }
  
  }
  </code></pre>
  
  <p>I am getting </p>
  
  <blockquote>
    <p>java.lang.Illegal Argument Exception:No Data Source Specified</p>
  </blockquote>
  
  <p>I am getting this error message even though i specified data source in <code>application.properties</code></p>
  
  <p>I am using <code>Spring Boot</code> for this task. I Have added almost all the dependencies required in <code>POM</code>.  </p>
  
  <p>Not sure why i am not able to access data source. basically trying to access data from DB using <code>Spring boot</code>, <code>MySQL</code>, <code>jdbcTemplate</code>.<br>
  Not sure whats wrong here.<br>
  Do i have to add anything in the code so that data source can be specified in java class? </p>