cantene
May 13th, 2001, 11:27 AM
Dear Friends,
If I use
query = "SELECT * FROM Officer WHERE OfficerID='" + OfficerID + "'";
rs = stmt.executeQuery(query);
to check whether the guy exists. IF not found, then I will return loginResult = 0.
But I am afriad of the undetermined result in rs. What's in rs if the OfficerID is not found? Is it null or "" or so? How should I write the following condition?
if ( ... )
loginResult = 0
else
loginResult = 1
If I use
query = "SELECT * FROM Officer WHERE OfficerID='" + OfficerID + "'";
rs = stmt.executeQuery(query);
to check whether the guy exists. IF not found, then I will return loginResult = 0.
But I am afriad of the undetermined result in rs. What's in rs if the OfficerID is not found? Is it null or "" or so? How should I write the following condition?
if ( ... )
loginResult = 0
else
loginResult = 1