I have below code, which works fine. But i need to get the column Headers. Is there any way to get ResultSet reference from ScrollableResults? I noticed that AbstractScrollableResults has ResultSet, but i cannot get handle to it.
List<String> lists = new ArrayList<>() ;
try (ScrollableResults r = statelessSession
.createNativeQuery("SELECT * FROM TBL** where id=?")
.setParameter("id", id).
.setReadOnly(true)
.setFetchSize(FETCH_SIZE)
.setCacheable(false)
.scroll(ScrollMode.FORWARD_ONLY)) {
while (r.next()) {
String result = Arrays.asList(r.get()).toString();
lists.add(result);
}
}
Anyone knows how to get column headers? Thanks in Advance.