You may use the code snippet below to check if a ResultSet is empty or not.
Code:ResultSet rs;
...
if (rs.next()) {
do {
System.out.println("Record found");
} while (rs.next());
}
else {
System.out.println("Record not found");
}
Printable View
You may use the code snippet below to check if a ResultSet is empty or not.
Code:ResultSet rs;
...
if (rs.next()) {
do {
System.out.println("Record found");
} while (rs.next());
}
else {
System.out.println("Record not found");
}