Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

isLast() method for a TYPE_FORWARD_ONLY result set

I have been trying to search for a way in which I would know if I am on the last row of my result set and I found the isLast() method.

I did something like:

if(rs.isLast()) {
    //do some operation here
}

But it game me an error: The requested operation is not supported on forward only result sets.

I searched for a solution and it said that I should change the TYPE_FORDWARD_ONLY. But right now, I was wondering if there is a way for me to know if I am in the last record set by using the TYPE_FORWARD_ONLY?

Thanks.

like image 928
Atasha Avatar asked Nov 13 '22 05:11

Atasha


1 Answers

There is also a methodisAfterLast which you can check after a call to next. This is also not required to be supported for TYPE_FORDWARD_ONLY, but you might try it anyway.

like image 178
Jörn Horstmann Avatar answered Nov 16 '22 03:11

Jörn Horstmann