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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
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: 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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: SQLExecption
 
Similar Threads
inserting queries advance
inserting queries
Insert query from java program
iTunes Import into DB
update db