File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes ResultSet Cursor 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 "ResultSet Cursor" Watch "ResultSet Cursor" New topic

ResultSet Cursor

Niranjan Prasad
Ranch Hand

Joined: Aug 13, 2005
Posts: 62
When query is executed,we get ResultSet

What this ResultSet actual contains?
It maintains a cursor,if it like this cursor is Current Set of Rows and so
at the client side we get excuted rows,when we say next the it fetches the
data from cursor which are in client side.

So people say ResultSet maintains rowid's of the excuted query

plse give me internals of ResultSet
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3753

I believe the internals of ResultSet is completely up to the JDBC Driver, so there's no simple answer to your question. For a lot of connections though, you can set a fetch size which will retrieve a specific number of records from the database at a given time often used to optimize network traffic. After all, its not often ideal to hit the database for each record.

Think of Google's search engine. You may have a million matches, but it only shows 10 at a time. You wouldn't want it to hit the database for every single item anymore than you'd want it to return all million records. The simple ideal solution is to return 10 (in practice this can vary precisely, as in the first record might be returned quickly and the following 9 might be grouped).

[OCA 8 Book] [Blog]
I agree. Here's the link:
subject: ResultSet Cursor
It's not a secret anymore!