How can I avoid a closed result set exception

43 Views Asked by At

I am using below code

public List<Test> getData(String sectionNumber) {
    String query = "SELECT  FROM test WHERE section_number = ?";

    log.info("Executing method {}", "getData");
    log.info("fetching details for {}", query);

    return jdbcTemplate.query(query, new Object[] { sectionNumber }, new RowMapper<Test>() {

        public Test mapRow(ResultSet rs, int rowNum) throws SQLException {
            Test cal = new Test();
            cal.setAsseType(rs.getString("INV_SEQ_ID"));
            return cal;
        }
    });

}

It's working fine if result set size is small, but if size is big, I get an exception as result set closed.

I'm not able to identify the issue from above.

0

There are 0 best solutions below