<%
   int pagess=0;
   int conuRow=0;
   int conuPage=0;
   int pagesize=6;
   String aa=request.getParameter("pID");////获得页数;
      if(aa==null){
        pagess=1;
      }else{
        pagess= Integer.parseInt(request.getParameter("pID"));
      }    String sql="select * from povince";
    ResultSet Setpovince=dbo.getData(sql);
      
    try{   
           Setpovince.last();             ///<----执行这句就会报错java.sql.SQLException: [Microsoft]                          // [SQLServer 2000 Driver for JDBC]Unsupported method:                           // ResultSet.last 这是为什么原因,,请高手帮忙!!!         
           conuRow=Setpovince.getRow();
           Setpovince.absolute(0);
         }catch(SQLException aaa){
           aaa.printStackTrace();      
    }  
        conuPage=conuRow/pagesize;
    if(conuRow%pagesize!=0)
       conuPage++;
   
%>

解决方案 »

  1.   

    Statement stmt=conn.createStatement(java.sql.ResultSet.TYPE_SCROLL_SENSITIVE,java.sql.ResultSet.CONCUR_READ_ONLY);
    给你点提示看下,希望你能明白
      

  2.   

    last
    boolean last()
                 throws SQLException将指针移动到此 ResultSet 对象的最后一行。 返回:
    如果指针位于有效行,则返回 true;如果结果集中不存在任何行,则返回 false 
    抛出: 
    SQLException - 如果发生数据库访问错误或者结果集类型为 TYPE_FORWARD_ONLY从以下版本开始: 
    1.2