• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

selection box values from database

 
amit malhotra
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends,
How can I populate my selection box values from database,please help me out
 
ernest fakudze
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used the code below. It gets all the userNames from the db and populate the drop down menu. Of course remember to first initialise your Connecetions and ResultSets.
out.pritnln("<SELECT NAME =selectedCustomer>");
out.println("<OPTION VALUE =none SELECTED> Please Select A userID </OPTION>");
while(rs.next()) {
userID = rs.getString("userID");
out.println("<OPTION VALUE =\"" + userID + "\" + ");
out.println(">" + userID + "</OPTION>");
} // end while
out.println("</SELECT>");
[This message has been edited by ernest fakudze (edited October 05, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic