File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes ResultSet TYPE_FORWARD_ONLY Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "ResultSet TYPE_FORWARD_ONLY" Watch "ResultSet TYPE_FORWARD_ONLY" New topic


nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580

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

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

have a look
I agree. Here's the link:
subject: ResultSet TYPE_FORWARD_ONLY
jQuery in Action, 3rd edition