你有没有用rs.next();使记录指针下移。

解决方案 »

  1.   

    有 ,我这里省略了现补上。。
    rs.next();
    n++;
    }
    ....
      

  2.   

    在while (n<20 &&!rs.isAfterLast())判断中,只有当n<20的知道才会为加,在记录集里面,记录指针指向本记录,所以rs.isAfterLast()永远为假
      

  3.   

    原来是这样的
    .......
    int n=0;
    while (n<20 &&!rs.isAfterLast()){
    .......
    rs.next();
    n++;
    }
    .....
      

  4.   

    .......
    int n=0;
    while (n<20 &&!rs.isAfterLast()){
    .......
    rs.next();
    n++;
    }
    .....
    过程是这样的