Wednesday, March 5, 2003 09:11 PM
i am developing a small application in java involving jdbc.the database is in ms access in table i have 3 fields namely id(primary key), question,answers,i want to randomly select 10 rows from entire data base without duplication of row. i want to populate the values in a grid.
any sugessions are welcome thank u in advance.
Re: retriving rows from database with out duplication
Friday, March 7, 2003 09:22 AM
Thursday, March 6, 2003 01:56 AM
I'm sure there are a number of different possable ways. My thought would be to load the database into a vector. Then in a "for" (or other) loop, make random selections from that vector (ie. int (randomnumber* vectorlength)) and move selections from the first vector to a second vector.