After I retrieve the records from database by some search criteria, I need to randomly pickup particular number of records based on the user input. Assuming database resultset retrieves 1000 records and I have pick up 350 random from them Is there a good way to approach this. Sri
You would want to generate the 350 random numbers into an array, sort them, and then either use the absolute() method or simply iterate through the ResultSet only keeping the records that match an entry in your array. Bouncing around back and forth through the ResultSet would probably be a performance pig.