Thread moved out of 'What's wrong with my code', and for future reference please wrap code in the code tags.

Read the API for ResultSet, especially the next() method. If it returns false (eg the...