how to check if rs next is null

Java
 if (rs.next() == false) {
        System.out.println("ResultSet in empty in Java");
      } else {

        do {
          String data = rs.getString("emp_name");
          System.out.println(data);
        } while (rs.next());
      }
Source

Also in Java: