-Included a check on whether a ResultSet is empty before proceeding for each function.