title: Jdbc returns empty list but SQL query succesfully gets data [Spring]
body: <p>I am trying to execute this query:</p>
  
  <pre><code>@Override
  public UserInfo get(Long id) {
      String sql = "SELECT * FROM users WHERE id = ? ";
      List&lt;UserInfo&gt; list = jdbcTemplate.query(sql,new UserInfoMapper(),id);
      return list.get(0);
  }
  </code></pre>
  
  <p>but jdbc return empty list and I get exception at return line. 
  But if try to execute directly though the console it returns:
  <a href="https://i.stack.imgur.com/wm0hO.png" rel="nofollow noreferrer">Query,</a> <a href="https://i.stack.imgur.com/zmv4c.png" rel="nofollow noreferrer">Answer</a></p>
  
  <p>Query was executed with id 1 and retured correct anwser;
  But in method its returned <a href="https://i.stack.imgur.com/ZzZa0.png" rel="nofollow noreferrer">this</a></p>
  
  <p>I couldn't find any same questions so that may be point at my inattention to something. But I can't see any problem that may cause this. Thanks in advance;</p>
  
  <p><strong>Updated 1</strong>
  Changing code to</p>
  
  <pre><code>@Override
  public UserInfo get(Long id) {
      String sql = "SELECT * FROM users WHERE id = ? ";
      List&lt;UserInfo&gt; list = jdbcTemplate.query(sql, new Object[] {id},new UserInfoMapper());
      return list.get(0);
  }
  </code></pre>
  
  <p>resulted in same: <a href="https://i.stack.imgur.com/LhttD.png" rel="nofollow noreferrer">result</a>
  Updated 2</p>
  
  <pre><code>@Override
  public UserInfo mapRow(ResultSet resultSet, int i) throws SQLException {
      UserInfo info = new UserInfo();
      info.setId(resultSet.getLong("id"));
      info.setFirstname(resultSet.getString("firstname"));
      info.setMiddlename(resultSet.getString("middlename"));
      info.setLastname(resultSet.getString("lastname"));
      info.setUsername(resultSet.getString("username"));
      info.setPassword(resultSet.getString("password"));
      info.setEmail(resultSet.getString("email"));
      info.setMobilephone(resultSet.getString("mobilephone"));
      info.setPosition(resultSet.getString("position"));
      return info;
  }
  public class UserInfo {
      private Long id;
      private String firstname;
      private String middlename;
      private String lastname;
      private String username;
      private String password;
      private String email;
      private String mobilephone;
      private String position;
  
      public UserInfo() {
      }
  }
  </code></pre>
  
  <p>Getter and setters for each field is there but I think there is no need to show them up.</p>