Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'Exhausted resultset' problem using prepared statements

Status
Not open for further replies.

dendenners

Programmer
Jul 17, 2001
110
IE
Hi there,
I'm having a problem with an 'exhausted resultset' SQLException in one of my statements. I've read a few FAQs about this, and the consensus is that the problem occurs when you try to access a ResultSet when you've already closed it. However i havent done this, and I'm still getting this error! I was wondering if it would have something to do with the fact that I'm accessing the USER_TAB_COLUMNS table. Any ideas? thanks

Code snippet:
sqlString = "SELECT COLUMN_NAME FROM USER_TAB_COLUMNS WHERE TABLE_NAME = ? ORDER BY COLUMN_NAME ASC";
prepStmt = con.prepareStatement(sqlString);
prepStmt.clearParameters();
prepStmt.setString(1, tableName);
ResultSet results = prepStmt.executeQuery();
while(results.next());
{
//Exhausted ResultSet SQLException thrown in next line
col = results.getString("COLUMN_NAME");
fieldList.add(makeFieldBean(col));
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top