| 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
Saloon Keeper
Joined: Oct 23, 2005
Posts: 3652
|
|
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
|
 |
 |
|
|
subject: ResultSet Cursor
|
|
|