How to implement RowMapper using java lambda expression : <p>I had a working RowMapper code that maps database table row in to a java object. I wanted to change the implementation using lambda expression. However, I am always getting error; Code snippet as follows;</p>

<pre><code>String queryString = "select * from person where person_id = ? ";
RowMapper rowMapper = (rs, rowNum) -&gt; {

Person p = new Person();

p.setName(rs.getString("personName"));
p.setAddress(rs.getString("address"));
p.setAge(rs.getInt("age"));
}

Person person = getJdbcTemplate().query(queryString, personId, rowMapper);

return person;
</code></pre>

<p>Can someone help me to implement code correctly?
Any idea to get list of persons?</p>
