| 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
|
|
"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: 8264
|
|
|
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 !
|
 |
 |
|
|
subject: how to get a number of record from the Resultset
|
|
|