This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JDBC and the fly likes SQLException problem? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQLException problem?" Watch "SQLException problem?" New topic
Author

SQLException problem?

Sam Doder
Ranch Hand

Joined: Feb 06, 2008
Posts: 204
I am getting this exception from the lines below

java.sql.SQLException: Operation not allowed after ResultSet closed



Basically I have to get data out of many different tables so I have to execute about 6 different sql statments. What I want to know is how I can execute these statements and get their results without haveing to close the database connection and the resultset each query.

Why is this happening what is the best/easiest way to remedy this.

Thanks again.

Ahhhhhhhh
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30361
    
150

Sam,
That looks like the same prepared statement 6 times. How are you changing the query each time?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: SQLException problem?