Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Fetchsize

 
srivijaya
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
How to get the recordcount(I mean fetched records from the database).I know that there is a method called getFetchSize() in ResultSet.But it's giving the fetchsize is 1.How can it be possible?
Regards.
Vijaya.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vijaya,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Thanks Pardner! Hope to see you 'round the Ranch!
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The fetch size is *not* the total number of rows in the ResultSet, but the number of rows that get fetched at one time. It's for nothing more than performance optimization.
 
srivijaya
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
ThanQ! U mean to say that we can set the fetchsize explicitly.By default it fetches 1.Can we set more that one.I heard that we can fetch one by one only.I tried by using setFetchSize(int rows).But it's giving exception.
One more doubt regarding resultset scrolling.By default recordset is TYPE_FORWARD_ONLY .If resultset is TYPE_SCROLL_INSENSITIVE then we can get the recordcount.I'm unable to set this cursor.Can any one clear this .
Regards.
Vijaya.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic