Definitely this gives good solution,
ResultSet rs = stmt.execute("SQL QUERY");
// With the above statement you will not have a null ResultSet 'rs'.
// In case, if any exception occurs then next line of code won't execute.
// So, no problem if I won't check rs as null.
if (rs.next()) {
do {
// Logic to retrieve the data from the resultset.
// eg: rs.getString("abc");
} while(rs.next());
} else {
// No data
}