JDBC ResultSet.getString Before/After Start/End of ResultSet Exception
- by Geowil
I have done a lot of searching about this topic through Google but I have yet to find someone using getString() in the way that I am using it so I have not been able to fix this issue in the normal ways that are suggested.
What I am trying to do is to obtain all of the information from the database and then use it to populate a table model within the program. I do so by obtaining the data with getString and place it into a String[] object:
try
{
while (rSet.next())
{
String row[] = {rSet.getString("DonorName"),rSet.getString("DonorCharity"),((String)rSet.getString("DonationAmount"))};
model.addRow(row);
}
}
However I am always getting a dialog error message stating those error messages in the title:
Exception: Before start of result set
Exception: After end of result set
The data is still added and everything works correctly but it is just annoying to have to dismiss those message windows. Does anyone have some suggestions?