if(name.equals(rs.getString(2)) && password.equals(rs.getString(4)))先改成这样试试。Rs是一个对象。而不是一个字符串,不能用引号引起来。这是错误的。