File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ResultSet TYPE_FORWARD_ONLY

 
nimo frey
Ranch Hand
Posts: 580
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 580
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mysql has limit and offset that can take care of this thing

have a look
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic