使用sql server 数据库Statement stmt = conn.createStatement();
sql="select UserPass from Users";
ResultSet rs = stmt.executeQuery(sql);请问如何在这里判断查询出的是 0 条记录VB里面有rs.eof,不知道java里面用什么啊?请高手赐教

解决方案 »

  1.   

    rs.wasNull();
    其实这些可以去文档里查,很方便的
      

  2.   

    用rs.hasnext()看看返回的是true 不
      

  3.   

    rs.first()Returns:
    true if the cursor is on a valid row; false if there are no rows in the result set
      

  4.   

    一般语句这样写:
    while(rs.hasNext())
    {
    ......//对取出的数据一行一行进行相应的处理
    }
      

  5.   

    rs.hasNext()就可以判断了,java很多地方都是用类似的方法来判断是否结尾
      

  6.   

    没有rs.hasNext 一般是 if (rs.next()) 来判断.
      

  7.   

    用 rs.wasNull()得出的怎么一直都是false;搞不懂