aspose file tools*
The moose likes JDBC and the fly likes ResultSet Cursor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "ResultSet Cursor" Watch "ResultSet Cursor" New topic
Author

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
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3710
    
    5

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).


My Blog: Down Home Country Coding with Scott Selikoff
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ResultSet Cursor