This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Java in General and the fly likes Fetchsize Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Fetchsize" Watch "Fetchsize" New topic
Author

Fetchsize

srivijaya
Greenhorn

Joined: Nov 02, 2002
Posts: 12
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

Joined: Dec 10, 2001
Posts: 7023
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!


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
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.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
srivijaya
Greenhorn

Joined: Nov 02, 2002
Posts: 12
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Fetchsize
 
Similar Threads
JDBC ResultSet
Setting fetch size for fast retrieval of data
get part of ResultSet from a large table
Database data retrieval in many steps?
Performance Issue - Constant Delay in ResultSet.next()