Forums Register Login
JDBC - ResultSet- Pls help
I need the following information on ResultSet very urgently. can someone pls help me or let me know where can I get this info?
1). We can use SetFetchsize() to datasize to be retrieved from Result Set at one shot. When we use SetFetchSize(1024) and the there are only 10 records in ResultSet, what is the impact?
2). If we use the following to set the FetchSize equal to the number of rows and bring back cursor for fetching in normal, any impact on time?
3). If we set FETCH_FORWARDONLY, any gain in the execution speed
4). Any other features in JDBC2.0 that can improve performance?
5). Setting FetchSize same as RowCount(select count(*) from table), is it optimal?
also if u know any web sites or books I can refer to this pls pls let me know...
Thanx in advance!
Can someone pls give some info on this...pls!
Any books to refer or any site??
I searched on web...didnt get any info on this.
any help would be very great help!
From my understanding of concepts, i'll try to give the answers to your questions.
1. There is no impact, if actual values are less than the "size" which was set.
2. This way you can't set the size, and will fail for 'TYPE_FORWARD_ONLY'. Refer JDK API.
3. Definitly yes, but it is default, so no need to set explicit.
4. No idea !
5. Definitly NOT ... why additional query ? count(*) is as costly as retrieving all the values ...
If you use Oracle then there is a great book by O'reilly "Java Programming with Oracle JDBC" by Donald Bales.
Even without Oracle you can get alot out of this book.

This thread has been viewed 778 times.

All times above are in ranch (not your local) time.
The current ranch time is
Oct 19, 2018 10:30:40.