T - the type of object produced by this mapperpublic interface RowMapper<T>
ResultSet to an instance of a given
type.
Example:
RowMapper<Person> personMapper = new RowMapper<>() {
public Person mapRow(ResultSet rs, int rowNum) throws SQLException {
Person person = new Person();
person.setId(rs.getLong("id"));
person.setName(rs.getName("name"));
person.setAge(rs.getInt("age"));
return person;
}
};
T mapRow(ResultSet rs, int rowNum) throws SQLException
ResultSet to a new instance of the
receiver's declared data type.rs - result set positioned to the row that is to be mappedrowNum - current row number (the first row is row 1)TSQLExceptionCopyright © 2014–2015 Carl Harris, Jr. All rights reserved.