0

I want to pass the value of name to text as combobox. I am getting value of name from database.

{
 String name=resultset.getString(1);
}

Thanks.

Vinoth Krishnan
  • 2,925
  • 6
  • 29
  • 34
Satinder
  • 13
  • 3

1 Answers1

0

Here is Why you should use JSTL than JSP scriptlets. You should start use JSTL.

I've given you the scriptlet code here. You can iterate the resultset between select tag and set values for option.

<select name="username">
    <%  while(resultset.next()){ %>
        <option value="<%=resultset.getString(1)%>"><%=resultset.getString(1)%></option>
    <% } %>
</select>
Community
  • 1
  • 1
Vinoth Krishnan
  • 2,925
  • 6
  • 29
  • 34