aspose file tools*
The moose likes JDBC and the fly likes Scrollable ResultSet 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 » Databases » JDBC
Bookmark "Scrollable ResultSet" Watch "Scrollable ResultSet" New topic
Author

Scrollable ResultSet

A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 979
Hi all,

In real time applications...how much use of scrollable resultsets is made..

Any scenario where we have to go for scrollable sets than non scrollable resultsets..


Thanks & Regards
Maximilian Xavier Stocker
Ranch Hand

Joined: Sep 20, 2005
Posts: 381
Originally posted by A Kumar:
Hi all,
In real time applications...how much use of scrollable resultsets is made..


Hard question to answer definitively but I would say very little. I couldn't remember the last time I used a scrollable result set in anything (either JDBC or ODBC or ADO), years anyway.

Often for well designed code I would say they are not required. One of the major uses appears to be people looking for row counts but that's not really a very good use of them.

I think largely if you really must have a scrolling result you are probably better off with a CachedRowSet anyway.

But as I said these aren't really hard and fast rules, in my opinion though there isn't much use for them.
A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 979
Thanks Xavier..

So we can use the non-scrollable ..ones for our work..
rarely needing the scrollable resultsets



Regards
stu derby
Ranch Hand

Joined: Dec 15, 2005
Posts: 333
I second the previous post.

In addition, this is in part because in at least some of the major database, scrolling result sets either don't perform particularly efficiently, or because the entire result set gets cached by the driver in memory, or both.

In other words, they're best used for small results, and for small results is often easier to use a non-scrollable anyway and convert each row to a Java object; there's just not that much benefit.

In the long run, if DB vendors and driver writers improve the driver implementations substantially, scrollables could be a lot more usable...

It's certainly possible to use them in a limited way, and I suppose there may be a driver implementation out there that works well, but it's not something I'd generally recommend to beginners (if they'd listen to me); you have to know a lot about how the underlying implementation is really doing things, or restrict yourself to toy or small-scale projects.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Scrollable ResultSet
 
Similar Threads
Count the numbers of rows in a resultset
scrollable resultsets
Error When Entering Data
why con.createStatement() throw Exception?
Result set type is TYPE_FORWARD_ONLY