The moose likes JDBC and Relational Databases and the fly likes JDBC result set question 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 "JDBC result set question" Watch "JDBC result set question" New topic

JDBC result set question

Raj Prasad

Joined: Jan 25, 2006
Posts: 7
I Executed a query and it has 10000 records. After processing for 9990 records, i closed my connection object and i got an exception immediately
can not access the ResultSet object anymore.

Is there any JDBC API still using which i can retrieve all the records 10000 records though the connection is closed at 9990.

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33102

I'm confused. Why are you closing the connection if you aren't done with the data? You could use a cached result set, but it seems better to just get the rest of the data before closing the connection.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
sajja bala

Joined: Dec 12, 2007
Posts: 11
Hello Raj

Yes you have an option; if you closed the connection also. I know that by using the rowset it is possible

Have a Good Day........<br />Sajj Bala Subrahmanyam
I agree. Here's the link:
subject: JDBC result set question
It's not a secret anymore!