This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JSP and the fly likes Reading from database and putting into Combo Box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Reading from database and putting into Combo Box" Watch "Reading from database and putting into Combo Box" New topic
Author

Reading from database and putting into Combo Box

Ben Reeves
Greenhorn

Joined: Jan 23, 2006
Posts: 5
Hey,
Sorry for disturbing you but im having problems trying to get data from a mysql database and displaying it in a combo box on a jsp page. I had a look at some sample code you gave on the forums, but im still not sure. Im doing an airline booking system. I want to get the list of origins from my database and put it in a combobox on my jsp. then i have a combo-box which should have a list of destinations which changes depending on the origin selected from the drop down list. Im really stuck with this, could you please help me???

Thanks,
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Where is the problem?

- In retrieving the data from DB
- In filling the combo box with that data
- filtering the other combo based on origin combo
Ben Reeves
Greenhorn

Joined: Jan 23, 2006
Posts: 5
At the moment its filling the combo box with data. I know how to retrieve data from a table. Would i need to put all the code on the jsp or can i put it in the java class?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63208
    
  69

Most definitely not in the JSP.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63208
    
  69

Similar previous topics:

http://www.coderanch.com/t/288857/JSP/java/Populating-html-select-tag-without

http://www.coderanch.com/t/285869/JSP/java/Map-Dropdown-JSTL-EL
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Reading from database and putting into Combo Box
 
It's not a secret anymore!