TYPE_FORWARD_ONLY结果集的isLast()方法 [英] isLast() method for a TYPE_FORWARD_ONLY result set
问题描述
我一直在尝试寻找一种方法,该方法可以知道我是否位于结果集的最后一行,并且找到了isLast()方法.
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.
我做了类似的事情:
if(rs.isLast()) {
//do some operation here
}
但是它给我带来了一个错误:仅向前结果集不支持所请求的操作.
But it game me an error: The requested operation is not supported on forward only result sets.
我搜索了一个解决方案,它说我应该更改TYPE_FORDWARD_ONLY.但是现在,我想知道是否可以使用TYPE_FORWARD_ONLY来让我知道自己是否在最后一个记录集中?
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?
谢谢.
推荐答案
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.
这篇关于TYPE_FORWARD_ONLY结果集的isLast()方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!