java - Unable to store Database results into a Map -
i have made query shown above fetched me folowing results mysql> select distinct category_id , t1 ca +-------------+--------------------+ | category_id | t1 | +-------------+--------------------+ | 1 | popcorn | | 2 | popcorn | | 3 | popcorn | | 4 | popcorn | | 5 | popcorn | | 6 | popcorn | | 7 | soft drinks | | 8 | soft drinks | | 9 | soft drinks | | 10 | soft drinks | for each t1 coulmn , trying store category_id so looks popcorn=[ 1, 2, 3, 4, 5, 6, ] softdrinks=[ 7, 8, 9, 10, ] i have followed below approach accomplish map<string,linkedlist<integer>> categoryitemslist = new hashmap<string,linkedlist<integer>>(); preparedstatement stmt2 = connecti...