You may use the code snippet below to check if a ResultSet is empty or not.

Java Code:
  ResultSet rs;
  ...  
  if (rs.next()) {
     do {
        System.out.println("Record found");
       } while (rs.next());
     }
  else {
     System.out.println("Record not found");
}