• Post Reply Bookmark Topic Watch Topic
  • New Topic

ResultSet Errors in JSP!  RSS feed

 
Mike London
Ranch Hand
Posts: 1441
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have code like the code below that runs in a JSP page that gets REFRESHED every 10 seconds.
=======================================================
String sql = "Select * from users ";
ResultSet rs = stmt.executeQuery(sql);
while (rs.next())
{
Timestamp ts_user = (Timestamp) rs.getObject("usr_lastHeartBeat");
String userLogin = (String) rs.getObject("usr_login");
out.println("<br>" + "'"+ userLogin + "'" + " is logged in!");

}
=========================================================
The problem is that I'm getting an error every so often that says:
"java.sql.SQLException: Operation not allowed after ResultSet closed"
I'm not sure why this is happening.
Can anyone please help?
Thanks ... Mike
 
Mike London
Ranch Hand
Posts: 1441
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I forgot to mention in my initial message that this problem is happening in Tomcat 5.
It seems like some kind of threading issue, but I don't see how this could be the case.
The JSP page is getting a hold of a "Connection" object created in a Servlet and creating a statement and ResultSet from that.
Any help would GREATLY be appreciated!
Thanks very much,
-- Mike
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!