• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SQLExecption

 
duhit Choudhary
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am trying to use resultset method but i am getting an error like this:

java.sql.SQLException: Operation not allowed after ResultSet closed
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
at com.mysql.jdbc.ResultSetImpl.checkClosed(ResultSetImpl.java:796)
at com.mysql.jdbc.ResultSetImpl.next(ResultSetImpl.java:6857)

and here is my code

 
nir sharma
Ranch Hand
Posts: 72
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you paste your complete stacktrace.
 
subhod lagade
Greenhorn
Posts: 6
Hibernate Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have faced this problem many times.

The only solution i found is using different statement reference for insert queries as execute update close the resultset.

Please try this out if not please correct me.
 
Wendy Gibbons
Bartender
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am think that the result set is connected to the staement. You then tell the statement to scrap it's old sql job and start a new one. So you have scrapped the old result set as well.

As duhit Choudhary use a new statements where you are still processing an old one.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic