I have this code in my app:
private static List<Info> loadInfo(String query) throws SQLException {
CallableStatement cs = null;
ResultSet rs = null;
Coection co = null;
List<Info> list = new ArrayList<>();
try {
co = getCoection();
cs = co.prepareCall(query, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
SQLServerStatement stmt = cs.unwrap(com.microsoft.sqlserver.jdbc.SQLServerStatement.class);
stmt.setResponseBuffering("adaptive");
rs = cs.executeQuery();
while (rs.next()) {
Info info = new Info();
info.setCode(rs.getString(CODE));
info.setId(rs.getLong(ID));
info.setLevel(rs.getShort(TYPE));
info.setName(rs.getString(NAME));
info.setShortName(fixString(rs.getString(SHORT_NAME)));
list.add(info);
}
log.info("Loaded");
retu list;
} catch (Exception e) {
log.info("EXCEPTION: ", e);
throw e;
} finally {
close(rs, cs, co);
}
}
When I run it, it successfully coects to db, gets the ResultSet and processes 673 rows. But at 674th row it executes rs.getString(CODE), rs.getLong(ID) and after that it stops executing on rs.getShort(TYPE). No one exception is thrown. Application is runing.
What could be the problem?
