I want to add items from a SQL table to an Java ArrayList. To get each item in the table, I am using the loop:
while(results.next())
However, I believe that this won't quit the loop if there are no more results found unlike the .hasNext available from some classes and will cause an error of some sort. How would I get the while loop to quit if there is nothing else in the SQL table without causing an error?