JavaRanch » Java Forums »
Databases »
JDBC
| 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.
|
 |
 |
|
|
subject: SQLExecption
|
|
|
|