how can I retrieve values from database randomly ?
suppose in my database there are 13 rows . and I want to retrieve these in random order ?
is there any method to do it ?
SCJP 6 (88%), SCWCD 5 (78%), preparing for SCBCD
Sandeep Kumar S Jakkaraju
Ranch Hand
Joined: Oct 18, 2006
Posts: 37
posted
0
you can do "order by rand()" .....if it is an rdbms ......
How many records are we talking about? Unless your passing the result set to the presentation layer (scary) I don't see how your not putting things into memory. A resultset is just a database-backed hashmap.
Saurabh Naik
Ranch Hand
Joined: Apr 24, 2008
Posts: 87
posted
0
Thank you Jean.. it works with order by rand()..
but is there any mechanism to fetch result randomly through function..
what is this ResultSet.FETCH_UNKNOWN... how to use it ?