你的stmt = conn.createStatement();结果集不用用LAST方法,必须加参数;
stmt = conn.createStatement(ResultSet.....here,some code...);

解决方案 »

  1.   

    转发==forwardOnly? if you want to use last(), do not use forward only cursorby default, with createStatement(), you will get a forwardonly readonly resultset, try
    stmt = conn.createStatement(TYPE_SCROLL_INSENSITIVE , ResultSet.CONCUR_READ_ONLY);
      

  2.   

    要设置ResultSet的可滚动性,需要指定生成Statement时的相应值:
    Statement stmt = connect.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY)其中,前一个参数有三种选择:ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.TYPE_FORWARD_ONLY;
    后一个有两种:ResultSet.CONCUR_READ_ONLY,ResultSet.CONCUR_UPDATABLE