title: How to solve Empty Result Data Access Exception
body: <p>org.springframework.dao.EmptyResultDataAccessException: Incorrect result size: expected 1, actual 0</p>
  
  <pre><code>NamedParameterJdbcTemplate jdbcTemplate;
  @Autowired
  public void setJdbcTemplate(NamedParameterJdbcTemplate jdbcTemplate) {
      this.jdbcTemplate = jdbcTemplate;
  }
  @Override
  public UserDetailModel getUserDetail(UserDetailModel detailModel) throws ClassNotFoundException, SQLException {
      StringBuilder query = new StringBuilder();
      Map map = new HashMap();
      SqlParameterSource param;
      query.append(" select ");
      query.append(" bu.FIRST_NAME as 'firstname', bu.LAST_NAME as 'lastname', bu.EMAIL as 'email', MOBILE as 'mobile', bu.ID  as 'id', ");
      query.append(" bu.ENABLED as 'enable', bu.IS_ADMIN as 'isadmin', bu.USERNAME as 'username', bu.PASSWORD as 'password' ");
      query.append(" from bamboo_users bu ");
      query.append(" where upper(trim(bu.USERNAME))=upper(trim(:USERNAME)) ");
      query.append(" AND ENABLED='1' ");
      map.put("USERNAME", detailModel.getUsername());
      param = new MapSqlParameterSource(map);
      return (UserDetailModel) jdbcTemplate.queryForObject(query.toString(), map, new UserRowMappers());
  }
  </code></pre>