Monday, August 27, 2012

Check that ResultSet is not empty

I think it's most common method to find if ResultSet is empty, and then to loop through results:

if (resultSet.next()) {
  do {
    //your code
  } while (resultSet.next());
}
else {
  // throw an Exception
}

No comments:

Post a Comment