一样的啊
try
{
     while(rs.next())
     {
                your code
     }
}
catch(SQLException ex)

      ex.getMessage();
}

解决方案 »

  1.   

    try
    {
    get rs...
    while(rs.next())
    {
    }
    }catch(SQLException se){}
      

  2.   

    这样写的话,你一旦碰到任何异常,所有读记录过程都会结束。
    try{
    while(rs.next()){
    //ur code
    }catch(){
    }这样写的话,你处理到有异常的记录,就会跳过处理下一条
    while(true){
    try{
         rs.next()
    }catch(SQLException ex){
    continue;
    }}
      

  3.   

    就是用while啊,try—catch就可以了。
      

  4.   

    while(true){
    try{
         if(rs.next()){//ur code}
    else{break;}   //==>前面错了,会死掉了
    }catch(SQLException ex){
    continue;
    }}
      

  5.   

    帮帮忙,最好不要将try--catch放在循环里,那样对性能的影响太大了!
      

  6.   

    while(rs.next())
    {
        request.setAttribute("...", rs.getString(".."));
    }
    你上面得到了rs这个集了吗?用resultset rs还是什么?怎么会有误呢?说的详细点好了啊!
      

  7.   

    对不起,我指的是  freeever(stone)
      

  8.   

    gary_shi(Gary Shi)  万分感谢...