Code example for ResultSet

Methods: getDouble, getInt, getLong, getString

0
 * Time: 16:56:05 
 */ 
public class ThesisMapper implements ParameterizedRowMapper<Thesis> { 
    public Thesis mapRow(ResultSet resultSet, int i) {
        try { 
            return new Thesis(resultSet.getLong("id"), resultSet.getLong("review_id"),
                    resultSet.getLong("thesis_unique_id"), resultSet.getString("content"),
                    resultSet.getInt("frequency"), resultSet.getDouble("positivity"),
                    resultSet.getDouble("importance"));
        } catch (SQLException e) {
            // Something is wrong with the base, i.e. one of column labels isn't presented. 
            return new Thesis(-1, -1, -1, "NOCONTENT", 0, 0.0, 0.0); 
        } 
    } 
}