检查当前游标位置的方法

Resultset提供了下面这些方法在可滚动的结果集中检查当前游标位置的方法。

boolean isBeforeFirst() throws SQLException

如果游标定位在before the first row上,就返回true。

boolean isAfterLast() throws SQLException

如果游标定位在after the last row上,就返回true。

boolean isFirst() throws SQLException

如果游标定位在first row上,就返回true。

boolean isLast() throws SQLException

如果游标定位在last row上,就返回true。

boolean getRow() throws SQLException

返回游标定位的记录的记录序号,如果游标定位的不是有效记录,就返回0。

如果游标定位的记录不是有效记录,则isFirst(),isLast(),isBeforeFirst()和isAfterLast()都返回false,而不是抛出异常。