This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes code to retrieve result from databse which are selected in the list box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "code to retrieve result from databse which are selected in the list box" Watch "code to retrieve result from databse which are selected in the list box" New topic
Author

code to retrieve result from databse which are selected in the list box

anu rani
Greenhorn

Joined: Aug 29, 2006
Posts: 14
There are some locations dispalyed in a list box. I have select 3 locations. so I need to displayed the result i.e., (the data present in the databse corresponding to the locations) of all the 3 locations at a time. please help me how to do the code in jsp
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60764
    
  65

What's not working in the code you have written?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
anu rani
Greenhorn

Joined: Aug 29, 2006
Posts: 14
I have selected single location in a list box and pass the arg to the next jsp program using request.getParameter.
then i wrote a query "select * from search where location=selected location in the listbox" and it retrieved all the data from the databse pertaining to taht location.

If i select multiple locations how to pass the multiple locations to the next jsp program and how to retrieve data for the multiple locations from the databse using resultset. i need the code. please help urgent
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60764
    
  65

Originally posted by anu rani:
i need the code. please help urgent

Then you will need to write it. JavaRanch is not the place to come to get others to do your work for you. It is a learning site where you will get help writing your own code. Please read this for more information.

Also, please read this.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60764
    
  65

Be sure to follow best practices and not put Java code in JSPs. Your database code especially should be segregated from the UI code.
 
 
subject: code to retrieve result from databse which are selected in the list box
 
Similar Threads
retrieve data in PL/SQL proc using JDBC in Websphere
search facility
Head first Java telling me to Change an Int Array to ArrayList - Eclipse telling me no can do
jsp + dropdown + automatically populate the vales from the db in the Text box
sun.jdbc.odbc.JdbcOdbcDriver