JSP: populating dropdown from database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • seshu veluri
    New Member
    • Oct 2007
    • 1

    #1

    JSP: populating dropdown from database

    hai,
    i am using combobox to select the some options.now i am using the values from jsp page by giving the <select> options.now i want use the list from the database.so i created the table for that.now i want to use the values from that table to select the any field to use it. thats whay how i can use the values getting that table by select option.

    plzzzzzzzzzzzzz zz tell the solution.


    srii
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by seshu veluri
    hai,
    i am using combobox to select the some options.now i am using the values from jsp page by giving the <select> options.now i want use the list from the database.so i created the table for that.now i want to use the values from that table to select the any field to use it. thats whay how i can use the values getting that table by select option.

    plzzzzzzzzzzzzz zz tell the solution.


    srii
    Are you opening the JSP from a servlet?
    Just use that servlet or some other utility class to connect to the database and return the results to the JSP page, say, in an ArrayList.
    You can then use the values in the arraylist to populate your dropdown.

    Comment

    Working...