我有以下代码
if (rs != null)
{
out.println("result set has got something");
while (rs.next())
{
//I am processing result set now
}
}
else
{
out.println("result set is empty");
}
即使 rs 为空,它也会打印"resultset has got something"。为什么会这样,我如何检查空结果集?