If possible, change the DB table structure .. apply 1NF and 2NF to aggregate Prize columns into single row for any Student.
If it is not possible, then, you can define a Map with key as Student id (String type) and value as Set of Prizes [ Map<String,Set><String>].
While iterating through DB records,
now you have a map of Prizes with Student id as key. So at the end of iteration, you shall have a Set of Prize 1,2,3,4 for Student id 121.
posted 5 years ago
Thanks for reply.
How is this works ? Is this possible in 1.5 ? Is giving me an syntax error.
Map<String,Set><String> prizeMap = new HashMap<String, Set><String>();
But HashMap won't support dublicate values or key. ? if adding more than one dublicate values , its going to overwrite...I want all values as like and only different is last column adding all rows values into one column.