Code snippet below shows how to check if a ResultSet is empty or not.

Java Code:
  boolean found;
  ResultSet rs;
  ...      
  // execute the query and then
  found = rs.next();
  if (found)
      System.out.println("Record found");
  else
      System.out.println("RECORD NOT FOUND");