jQuery in Action, 3rd edition
The moose likes JDBC and Relational Databases and the fly likes SQLExecption Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "SQLExecption" Watch "SQLExecption" New topic


duhit Choudhary
Ranch Hand

Joined: Apr 01, 2012
Posts: 64
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

Joined: Sep 11, 2012
Posts: 72

can you paste your complete stacktrace.
subhod lagade

Joined: Feb 17, 2009
Posts: 6

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.

Java Professional
Wendy Gibbons

Joined: Oct 21, 2008
Posts: 1107

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.
I agree. Here's the link: http://aspose.com/file-tools
subject: SQLExecption
It's not a secret anymore!