Home Discussion Discuss: JSP Get Data Into Dropdown list From Database

  • jsp problemerfaan May 21, 2013 at 11:06 PM

    how to change the select box value according to the other select box value on onchange event before click on submit button

  • Doesn't work properly ! ! !mohanraj April 12, 2013 at 8:24 PM

    sir can you please help me , this code doesn't selevt any value from DB's table :( this is the code am using : <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ page import="java.sql.*;" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Drop Downlist</title> </head> <body> <%! String driverName = "com.mysql.jdbc.Driver";%> <%!String url = "jdbc:mysql://localhost:3306/locationupdates";%> <%!String user = "root";%> <%!String psw = "root";%> <form action="#"> <% Connection con = null; PreparedStatement ps = null; try { Class.forName(driverName); con = DriverManager.getConnection(url,user,psw); String sql = "SELECT * FROM locationupdates.vehicledetails v;"; ps = con.prepareStatement(sql); ResultSet rs = ps.executeQuery(); %> <p>Select Name : <select> <option>Select vehicle ID</option> <% while(rs.next()) { String fname = rs.getString("starting_point"); %> <option value="<%=fname %>"><%=fname %></option> <% } %> </select> </p> <% } catch(SQLException sqe) { out.println(sqe); } %> </form> </body> </html>

  • dynamically listbox databhaskar joshi June 25, 2013 at 12:48 AM

    I amhaving three tables country,state,district. I would like to display data from in all the listboxes dynamically.If I select country I get the list of country,then particular country selection gives states in thate country and so on.I think your could will certainly give the solution.I have tried but i can not succeed.Please help. bhaskar

Post your Comment



Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Related Articles
JSP-Tutorials

JSP Get Data Into Dropdown list From Database
JSP Get Data Into Dropdown list From Database In this section we will discuss about how to fetch data dynamically into the dropdown list in JSP... data from the database and set it into the dropdown list in JSP using MySQL 

Java Beginners

how to add data dynamically from database into a dropdown list in a jsp
how to add data dynamically from database into a dropdown list in a jsp  hi friends i am doing a project in jsp and oracle as my database.In my... get dynamically from the database and whenever a new person has registered his 

Ajax Questions

DropDown list
DropDown list  how to get mysql database values into dropdown usign java servlet and ajax?   Here is a jsp code that displays the database values into dropdown list. 1)country.jsp: <%@page import="java.sql.*"%> 

JSP Interview Questions

3 dropdown list from the database using JSP
3 dropdown list from the database using JSP  Hi, I'm new to JSP I want to create 3 dropdown list each depend on the other and get the options from the database using JSP 

Java Beginners

Retrieval of Dropdown list
Retrieval of Dropdown list  Hi frnds... Am having problem with the below code... I have retrieved data from the mysql database into dropdownlist ... for eg, let A1,A2,A3,A4 be the values in dropdown.. if i click A1 

Java Beginners

jsp- database dependent dropdown list
jsp- database dependent dropdown list   i want 2 dropdown list 1- CLASS 2-SECTION both are should come from database. and if i select a class... respective to that class from database. please help by providing the code in jsp 

Ajax Questions

dropdown
dropdown  I have a dropdown having 2 options-"Open"& "closed".When i select "open" option the related rows of data are retrieved from database and same with the other option.My database is Mysql and coding in PHP 

JSP Servlet Questions

how to get data from database into dropdownlist in jsp
tutorial go through the link JSP Get Data Into Dropdown list From Database   ...how to get data from database into dropdownlist in jsp  Can anybody... the database and set it into dropdown list in jsp please help <br/> 

JSP Servlet Questions

getting and storing dropdown list in database in jsp
getting and storing dropdown list in database in jsp  i have a drop down list to select book from database. i'm able to retrieve dropdown list from database. but unable to store the selected value in database table. please help 

Struts Questions

getting values from dropdown list
getting values from dropdown list  I am having a dropdown list which has hardcoded values ( we need it hardcoded only and will not be populated from the database) My question is when i select a particular value it should be pass 

JSP Servlet Questions

Hi, I'm new to JSP I want to create 3 dropdown list each depend on the other and get the options from the database using JSP
Hi, I'm new to JSP I want to create 3 dropdown list each depend on the other and get the options from the database using JSP  as i said i want to create 3 drop dropdown list each depend on the other and get the options from 

Java Server Faces Questions

dropdown list in jsf
dropdown list in jsf  I want to add a list box to display the country name from the lists on all countries.When I select for e.g India then in the second list box it will display the states related to India only and the flow 

Struts Questions

struts dropdown list
struts dropdown list   In strtus how to set the dropdown list values from database ? I have a ArrayList object and set this object in dropdown jsp page using struts ? please send me jsp code... sample code: **Action 

Applet Questions

retrieving data in to the dropdown box from postgresql database in core java
retrieving data in to the dropdown box from postgresql database in core...=st.executeQuery("SELECT role_name from role WHERE dept_id=1234"); if(rs... database: import java.sql.*; import java.awt.*; import javax.swing.*; import 

JSP Servlet Questions

Dropdown menus onchange atribute
the data from database and stored it into dropdown list. On selecting the value from... from database and store it into dropdown list. On selecting the value from the first dropdown, the values will get stored into another dropdown from the database 

JSP Servlet Questions

retrive the data from access database to drop down list box in jsp
retrive the data from access database to drop down list box in jsp  hai, im new to jsp now im using the jsp along with access database.in table i load all the data's i need to retrive the data from database to dropdown list box 

Flex Questions

How to add a DropDown List in Flex DataGrid
How to add a DropDown List in Flex DataGrid  hi I am trying to add a DropDownList in a DataGrid table. After the user selects one of the items from... select from one of the choices in the list. That's my reason for trying to add 

Framework Questions

Data retrieve from mysql database
Data retrieve from mysql database  Hi sir, please give some example of jsp code for retrieving mysql database values in multiple dropdown list... from the dropdown, related data will get displayed on the textboxes. Here we have 

Flex Questions

How to add a DropDown List in Flex DataGrid
How to add a DropDown List in Flex DataGrid  hi I am trying to add a DropDownList in a DataGrid table. After the user selects one of the items from... select from one of the choices in the list. That's my reason for trying to add 

PHP Questions

dropdown list and text fields in php
dropdown list and text fields in php  How could I use php to populate text fields by selecting a name of a business from dropdown list? Those text... number, description, and opening times from a mysql database. If you can, post 

JSP-Tutorials

JSP Get Data From Database
JSP Get Data From Database In this section we will discuss about how to get data from database using JSP. To get data from database to a JSP page we... example which lets you understand to fetch data from database in JSP 

JSP Servlet Questions

jsp -sevlet connecting to database using dropdown
jsp -sevlet connecting to database using dropdown  How can I get my dropdown list from oracle database and then submit it to another table in JSP. I... to the database and fetches an array of strings from a database table and then sends 

JSP Servlet Questions

help to select a value from the dropdown list
help to select a value from the dropdown list  I have a html file... from the drop down list created in a div and put it in the textbox kim... { $.post("SearchIndex.jsp", {queryString: ""+inputString+""}, function(data 

Struts Questions

dropdown in struts - Struts
write the query (in which file)to get the list from database and how and where can i set the list to context to get it from there in a collection object...dropdown in struts  how to populate a drop down from database entries 

Java Beginners

Dropdown code to retrieve result from oracle database
that will retrieve values from the database into dropdown. As the user choose any option from the dropdown, corresponding values will get displayed in the textboxes...Dropdown code to retrieve result from oracle database  Hi Friends, I 

HTML Questions

dropdown list in jsp
dropdown list in jsp  hai, i have static dropdown list.. i want to get the selected value in string variable without jsp regards asha 

JSP Servlet Questions

Retriving value from dropdown list nad disply it in other page
Retriving value from dropdown list nad disply it in other page  Hello..., and that marker contains a button, on click of that button i need to get the name of the selected value from the dropdown list and dispaly it to on the next page. i 

JSP Servlet Questions

DropDown Department Login
DropDown Department Login  Hi all, I am doing a project using JSP. My Issue is..... I have two departments name Customs and Accounts in the database... list. Since I cannot populate the departments name from each table into drop 

JSP Servlet Questions

how to get data from database into dropdownlist in jsp
how to get data from database into dropdownlist in jsp  //Customer Name: <select name="name"> <% try{ Class.forName...="select * from staff"; ResultSet rs=st.executeQuery(sql); while(rs.next 

Java Interview Questions

how to get data from list to map with out using a loop?
how to get data from list to map with out using a loop?  List list...("15"); how to get this data into map with out using a loop. i want this data like this--map.put(name,id); Is it possible to do without using loop 

DMCA.com