aspose file tools*
The moose likes JDBC and the fly likes ResultSet TYPE_FORWARD_ONLY Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "ResultSet TYPE_FORWARD_ONLY" Watch "ResultSet TYPE_FORWARD_ONLY" New topic
Author

ResultSet TYPE_FORWARD_ONLY

nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
Hello,

when using TYPE_FORWARD_ONLY, can I positioning my cursor at a absolut row or do I have to use TYPE_SENSITIVE?

I want to use a cursor and begin my cursor at a specified position.
nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
when using TYPE_FORWARD_ONLY and setRow(200);

then I get a Exception, that says I should use TYPE_SENSITIVE or TYPE_INSENSITIVE,

but when using SENSITIVE or INSENSITIVE-Cursor, my query execution time is much much slower than when using TYPE_FORWARD_ONLY.

For example, 10.000.000 rows using TYPE_FORWARD_ONLY returns the (first) 100 rows within max 2 seconds.

When using TYPE_SENSITIVE or TYPE_INSENSITIVE, the same query returns 100 rows within more than 5 minutes!

Any ideas how I can solve that?
jay desi
Greenhorn

Joined: Jul 02, 2009
Posts: 27
mysql has limit and offset that can take care of this thing

have a look
 
wood burning stoves
 
subject: ResultSet TYPE_FORWARD_ONLY