File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes SQLExecption Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "SQLExecption" Watch "SQLExecption" New topic
Author

SQLExecption

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
Greenhorn

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
Bartender

Joined: Oct 21, 2008
Posts: 1098

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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: SQLExecption
 
Similar Threads
inserting queries
update db
inserting queries advance
Insert query from java program
iTunes Import into DB