This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JDBC and the fly likes ResultSet absolute(), relative() 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 absolute(), relative()" Watch "ResultSet absolute(), relative()" New topic
Author

ResultSet absolute(), relative()

Navin Pillu
Ranch Hand

Joined: Apr 19, 2005
Posts: 103
Hi All

I want to know the difference between absolute() & relative(). Because both are giving same output.

And also want to know how can i fetch rows indexing from 70 to 80 from 100 rows or similar functionality.

Thanks in advance
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

Originally posted by Navin Pillu:
I want to know the difference between absolute() & relative(). Because both are giving same output.


javadocs is the answer, check here the description of both method


want to know how can i fetch rows indexing from 70 to 80 from 100 rows or similar functionality.


I am sorry but this is not clear to me, to fetc rows from 70 to 80 you can
go to 70th row by rs.absolute(70) then fetch next 10 rows

Shailesh


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
Navin Pillu
Ranch Hand

Joined: Apr 19, 2005
Posts: 103
Hi Shailesh

Thanks for giving reply. I went through link & understood point. But Second point is also important. If i have 10000 rows in that case if i used this solution that is fetching rows & moving cursor will take more time. So i want practical solution.

If anybody has practical solution for this please let me know

Thanks in advance
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

I dont think row numbers are would be a critaria to fetch rows unless it is case of paging ,because rows order can be change with respect to your Order by clause.

It order to fetch records from database minimize them at query execution level with your where clause,otherwise use some runnig number column in your table so that you can filter your rows

I dont have any practical figures for cursor movement but I dont think it will take as much observable time that application suffer.

Shailesh
[ July 06, 2005: Message edited by: Shailesh Chandra ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ResultSet absolute(), relative()