This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes how to get a number of record from the Resultset Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "how to get a number of record from the Resultset " Watch "how to get a number of record from the Resultset " New topic
Author

how to get a number of record from the Resultset

Robert Smith
Greenhorn

Joined: Oct 14, 2003
Posts: 23
how to get a number of record from the Resultset ? for example , from 10 rows to 20 rows records ,please give me some examples!
thanks!
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
"skyspeed skyspeed",
Your more than welcome to the JavaRanch but your display name does not comply with our naming policy so I'll have to ask you to change it.
Thanks.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Sainudheen Mydeen
Ranch Hand

Joined: Aug 18, 2003
Posts: 218
Hi
Inside while(rs.next()) loop you can write a logic to skip the first 9 records and the records after 20.
-Sainudheen
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8843
    
    7

If your database supports the TOP keyword you can use a subquery to ORDER BY x ASC and get the top 20, and have the outer query ORDER BY x DESC and get the top 10.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Robert Smith
Greenhorn

Joined: Oct 14, 2003
Posts: 23
thanks !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to get a number of record from the Resultset
 
Similar Threads
How to find the number of rows in the resultset
Resultset row count
Can we extract the data from resultset after the connection get closed.
setFetchSize() ??
How to know no of records resultset contains in xml file