Below is the code which i have written to retrieve values from the database (I have added the whole code so it will be easier for you to understand what i am trying to say h
Use list in class as return value,
List sectionName = new ArrayList(); while (resultSet.next()) sectionName.add(resultSet.getString("section_name"));
then do
${parameter}
Here parameter is meadiator variable to access list variable value You can use String array also