• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Resultset not Open?

 
Qaiser Mehmood
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get following error on Result set
java.sql.SQLException: ResultSet not open. Verify that autocommit is OFF.
at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
at org.apache.derby.client.am.ResultSet.next(Unknown Source)

 
Jan Cumps
Bartender
Posts: 2584
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You close the connection in your finally block. This will also close the ResultSet 'res' that you return.
 
Qaiser Mehmood
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reultset res is outside finaly block.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Qaiser Mehmood wrote:Reultset res is outside finaly block.


Not sure what you mean by that, but Jan is right. Your method returns a ResultSet that is closed, because you closed it in your finally block (by closing the connection).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic