rs.getInt(1) > 0帮忙解释一下谢谢
try { String sql = "select count(*) from users where userName=? and userPwd=?"; prepar = conn.prepareStatement(sql); prepar.setString(1, userName); prepar.setString(2, userPwd); res = prepar.executeQuery(); if (res.next()) { if (res.getInt(1) > 0) { useBean = this.getUser(userName); } else { useBean = null; } } else { useBean = null; } } catch (Exception e) { useBean = null; e.printStackTrace(); }