title: Parameter 0 of constructor in .. required a bean of type org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate could not be found
body: <p>I have written a simple todo app (based on what comes in <a href="https://www.apress.com/gp/book/9781484236758" rel="nofollow noreferrer">apress pro spring boot</a> in which we use jdbc to deal with database ,in the repository we have the following code to deal with h2 database</p>
  
  <pre><code>package com.apress.todo.repository;
  
  import java.sql.ResultSet;
  import java.time.LocalDateTime;
  import java.util.Collection;
  import java.util.Collections;
  import java.util.Comparator;
  import java.util.HashMap;
  import java.util.Map;
  
  import org.springframework.dao.EmptyResultDataAccessException;
  import org.springframework.jdbc.core.RowMapper;
  import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
  import org.springframework.stereotype.Repository;
  
  import com.apress.todo.domain.ToDo;
  
  @Repository
  public class ToDoRepository implements CommonRepository&lt;ToDo&gt; {
      private static final String SQL_INSERT ="insert into todo (id,\r\n" + 
              "description, created, modified, completed) values (:id,:description,\r\n" + 
              ":created,:modified,:completed)";
      private static final String SQL_QUERY_FIND_ALL = "select id,"
              +"description, created, modified, completed from todo";
      private static final String SQL_QUERY_FIND_BY_ID = SQL_QUERY_FIND_ALL +
              " where id = :id";
      private static final String SQL_UPDATE = "update todo set description ="
              +":description, modified = :modified, completed = :completed"
              +"where id = :id";
      private static final String SQL_DELETE = "delete from todo where id = :id";
      private final NamedParameterJdbcTemplate jdbcTemplate;
  
  
  
  
  
      public ToDoRepository(NamedParameterJdbcTemplate jdbcTemplate) {//HERE IS WHERE THE PROBLEM IS
          System.out.println("hi masoud");
          this.jdbcTemplate = jdbcTemplate;
      }
  
  
  
  
  
      private RowMapper&lt;ToDo&gt; toDoRowMapper = (ResultSet rs, int rowNum) -&gt; {
          ToDo toDo = new ToDo();
          toDo.setId(rs.getString("id"));
          toDo.setDescription(rs.getString("description"));
          toDo.setModified(rs.getTimestamp("modified").toLocalDateTime());
          toDo.setCreated(rs.getTimestamp("created").toLocalDateTime());
          toDo.setCompleted(rs.getBoolean("completed"));
          return toDo;
      };
  </code></pre>
  
  <p>and the following is my main spring boot application runner</p>
  
  <pre><code>package com.apress.todo;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  
  
  @SpringBootApplication
  public class TodoInMemoryApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(TodoInMemoryApplication.class, args);
      }
  
  }
  </code></pre>
  
  <p>but when I run the application using spring boot command line interface I will get the following error:
  Description:</p>
  
  <pre><code>Parameter 0 of constructor in com.apress.todo.repository.ToDoRepository required a bean of type 'org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate' that could not be found.
  
  
  Action:
  
  Consider defining a bean of type 'org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate' in your configuration.
  </code></pre>
  
  <p>there is nothing more explained in the book .</p>