• Post Reply Bookmark Topic Watch Topic
  • New Topic

rs.get???

 
Sarada Bhasker
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
When I do a rs.getxxx(x) ,am I going back to the database server and fetching the row from the database cache or am I getting the resultset copied to my in my program's memory?
 
prabhat kumar
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it gets copied in to ur program memory
 
Premkumar N
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Saradha:
The ResultSet object fetches based on the row-fetch-size you've specified. and stores it in your program-space .. but once you exhaust this resultset repeatedly-using rs.next() .. it again goes back to the database and fetches again.

setFetchSize(int rows)
JDBC 2.0 Gives the JDBC driver a hint as to the number of rows that should befetched from the database when more rows are needed for this result set.
Prem
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!