Switch to full style
What's behind JSP & Servlets
Post a reply

How to fill a ComboBox with data from a database in jsp

Thu Jan 01, 2009 7:15 am

How to fill a ComboBox with data from a database in jsp?
i use my sql to store data bsae



Re: How to fill a ComboBox with data from a database in jsp

Thu Jan 01, 2009 10:56 am

It is done like the following :
I assume now you put your sql results in Resultset right :

in jsp you will make a for loop

Code:
<select>
<%
         for(----)
           {
                      String line =   return each line from Resultset object
                       out.print("<option>"+line+"   </option>");
                     
            }

%>

</select>


Post a reply
  Related Posts  to : How to fill a ComboBox with data from a database in jsp
 Delete data from database by ID in php     -  
 Displaying images from database instead of the url from data     -  
 Delete data from database table in php     -  
 Display data from database as Tree Structure in JSP     -  
 form to insert data, upload many files and images , database     -  
 Fill in a shape     -  
 Draw Fill Rectangle     -  
 Fill DataGrid In Connected Mode     -  
 fill selection options from list     -  
 fill all Squares of game board - 2d Java Game Example     -