请问 Resultset  rs 
      rs.absolute(-18)
      while(rs.next()){
      }
是什么意思,有什么作用,为什么是-18呀,请高手指教,多谢!

解决方案 »

  1.   

    boolean absolute(int row)
                     throws SQLExceptionMoves the cursor to the given row number in this ResultSet object. 
    If the row number is positive, the cursor moves to the given row number with respect to the beginning of the result set. The first row is row 1, the second is row 2, and so on. If the given row number is negative, the cursor moves to an absolute row position with respect to the end of the result set. For example, calling the method absolute(-1) positions the cursor on the last row; calling the method absolute(-2) moves the cursor to the next-to-last row, and so on. An attempt to position the cursor beyond the first/last row in the result set leaves the cursor before the first row or after the last row. Note: Calling absolute(1) is the same as calling first(). Calling absolute(-1) is the same as calling last(). 写得很详细了