Multiselect Dropdown selected after reloading the page.

I have multiSelect drop down on my web page designed in JSP. End user will select required options and save the form to Database. Below is the original Dropdown that gets values and index from Database Master Table. Selected values are saved in another table.

Original Dropdown on the page.

Below code retrieve saved database values and display them as selected in new select tag. However, I want the selected values to be show in above table instead of new Dropdown.