The code for retrieving data from database into Drop Down List.

The code for retrieving data from database into Drop Down List.

<% DataSource data = new MysqlDataSource(); Connection con = data.getConnection("root","system"); System.out.println("Connected to MySQL"); PreparedStatement pre = con.prepareStatement("select * from library.booklist"); ResultSet result = pre.executeQuery();

%> Book List :

// my code for displaying quantity is below but its now working.I am new to jsp, so dont know how to populate the textbox//

  <%

 String value = request.getParameter("BookList");
 pre = con.prepareStatement("select Quantity from library.booklist where Book = ? ");  
 result = pre.executeQuery();
 %>
  <font color="black" size="5"><td> Quantity : </td>
<%

 while (result.next())
 {
int quantity = result.getInt("Quantity");
System.out.println("quantity dikha raha hai");
%>
<input name = "Quantity" type = "text" size = "25" readonly = "readonly" value = "<%=quantity%>"> <%=quantity%> </input>
 <%
 }
 %>
 </td>
 </tr>
View Answers









Related Tutorials/Questions & Answers:
The code for retrieving data from database into Drop Down List.
The code for retrieving data from database into Drop Down List.  <% DataSource data = new MysqlDataSource(); Connection con... to MySQL"); PreparedStatement pre = con.prepareStatement("select * from
view data from database using drop down list
view data from database using drop down list  hi i want to view the data from database by selecting a value in a drop down list. for an example drop down list have picture element.when click it select pictures from the database
Advertisements
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
Drop down list from database
Drop down list from database  Hi, Can I know how do we get the drop down list from database? Eg: select country--select state--select district--so... * from country"); while(rs.next()){ %> <option value="<
how to make drop down list in JSF & fetch data Item from database
how to make drop down list in JSF & fetch data Item from database  how to make drop down list in JSF & fetch data Item from database
data should not repeat in the drop down list when it is loading dynamically from database
for loading the data dynamically from the data base but my problem is it is retrieving the whole department field from the data base (i.e in the drop down list...data should not repeat in the drop down list when it is loading dynamically
data should not repeat in the drop down list when it is loading dynamically from database
data should not repeat in the drop down list when it is loading dynamically from database  selDept.jsp <%@page import="java.sql.*"%>... the data dynamically for database but my problem is in the list the same
data should not repeat in the drop down list when it is loading dynamically from database
data should not repeat in the drop down list when it is loading dynamically from database  selDept.jsp <%@page import="java.sql.*"%> <..._NO`) ); the data is coming from
how to retreive data dynamically from mysql to drop down list
how to retreive data dynamically from mysql to drop down list   sir... fron end using jsp , after storing the data successfully .i want to retrieve the data of a particular column in a table into drop down list dynamically
jsp code for a drop down box to retrive value from database
jsp code for a drop down box to retrive value from database  my project needs to get the value from database in to the drop down box..... pls give me code for that ..... tan q   1)login.jsp: <html> <script>
I want to display the quantity of the selected item of a drop down list in a textbox. The data is stored in database.
I want to display the quantity of the selected item of a drop down list in a textbox. The data is stored in database.  The code for retrieving data from database into Drop Down List. <% DataSource data = new
How to send the data selected from drop down menu from html page to sql 2005 database.
How to send the data selected from drop down menu from html page to sql 2005... by user from html drop down menu such as check-in date for hotel reservation system ,how can I save these data in database and how to retrieve later .Thanks
Display related data in other drop down list on selecting one data in one drop down list
Display related data in other drop down list on selecting one data in one drop down list  How to display related datas in dropdown list from database on selecting one data in previous dropdownlist in Java Server Page
store values of drop down list box in database
store values of drop down list box in database  how to store values of drop down list box in oracle database in jsp?I have information inserting form where i have date of birth as drop down list box
How to insert multiple drop down list data in single column in sql database using servlet
How to insert multiple drop down list data in single column in sql database using servlet  i want to insert date of birth of user by using separate drop down list box for year,month and day into dateofbirth column in sql server
Pls provide me jsp code to get values in drop down list from another table's field....
Pls provide me jsp code to get values in drop down list from another table's... in customer registration page and should be shown in drop down box in front end... pages..... when i insert data in company registration .. it ll have company id
Retrieving Data from Database to fill Combo Box
Retrieving Data from Database to fill Combo Box  Sir, I have a JSP Page with a combo box and a label. I have a database that has two fields id... displaying path that is stored in the database but not the image itself. Kindly
how to import values from database to the drop down box
how to import values from database to the drop down box   hi iam... employee page i kept a drop down box for employee Ids i want all employee IDs will display in the drop down box please help me with the code
dynamic drop down list
dynamic drop down list  I want to create 2 drop down list, where it takes value from database and the two list are dependent..means if I select a particular value from one the other list is developed accordingly..depending
to update drop down list value when selected from website
to update drop down list value when selected from website  hi help me, i want to insert value into db when i select from a drop down list...=mysql_query("select * from age order by Age_Desc"); while($row_list=mysql_fetch
to update drop down list value when selected from website
to update drop down list value when selected from website  hi help me, i want to insert value into db when i select from a drop down list...=mysql_query("select * from age order by Age_Desc"); while($row_list=mysql_fetch
to update drop down list value when selected from website
to update drop down list value when selected from website  hi help me, i want to insert value into db when i select from a drop down list...=mysql_query("select * from age order by Age_Desc"); while($row_list=mysql_fetch
drop down list in Struts
drop down list in Struts  How to create a drop down list in Struts
how to check dates while retrieving data from database
how to check dates while retrieving data from database  i want to update database record based on delivery date i have tried this query but it wont work b="update deliveryorder set prtnm='"+arr[1]+"',stn='"+arr[0]+"',sbston
retrieving data from database to the textbox depending upon the id in jsp
retrieving data from database to the textbox depending upon the id in jsp  Hi, our project involves fetching of data from database into textbox... will be checked to database weather it exist or not and if it exists
Dependent drop down list
dependent drop down list is used my code is successful but when i select class from first drop down list all the data get lossed means the value entered in fields before drop down list get blank.what can i do for this? This is the code
validation for drop down list
validation for drop down list  Hi all I have a form, it contain 12 drop down list. Each drop down has 1 to 5 values,i need to validate this form. the following condition should be true. 1.you can choose only 3 times 5 value. 2
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
Get values in drop down list
Get values in drop down list  Pls provide me jsp code to get values in drop down list from another table's field. my project has customer... in drop down box in front end..... pls provide me code.. thanx
insert data using drop down box in java into database postgresql
insert data using drop down box in java into database postgresql  can... data into database using an drop down box .....as i m using eclipse as jdbc and postgresql as data base syntax which i m using is like:- java class
insert data using drop down box in java into database postgresql
insert data using drop down box in java into database postgresql  can... data into database using an drop down box .....as i m using eclipse as jdbc and postgresql as data base syntax which i m using is like:- java class
insert data using drop down box in java into database postgresql
insert data using drop down box in java into database postgresql  can... data into database using an drop down box .....as i m using eclipse as jdbc and postgresql as data base syntax which i m using is like:- java class
insert data using drop down box in java into database postgresql
insert data using drop down box in java into database postgresql  can... data into database using an drop down box .....as i m using eclipse as jdbc and postgresql as data base syntax which i m using is like:- java class
how to retrieve the id value itself from the access database to drop down listbox in jsp
how to retrieve the id value itself from the access database to drop down listbox in jsp  how to retrieves the id which is an int datatype, from access database to drop down list box in jsp...plz send the code for that.....plz
how to make a radiobutton selected when retrieving data from database using struts framework and spring jdbc
how to make a radiobutton selected when retrieving data from database using struts framework and spring jdbc  how to make a radio button selected when retrieving data from database using struts framework and spring jdbc
how to insert list box in java script dynamically and elements retrieving from database like oracle
how to insert list box in java script dynamically and elements retrieving from database like oracle  Hi, how to dynamically increase size of list box in javascript when elements retrieving from database.. That is whenever I
how to insert list box in java script dynamically and elements retrieving from database like oracle
how to insert list box in java script dynamically and elements retrieving from database like oracle  hi all, how can i insert elements into java script list box retrieving from Database. whenever I insert any element in the Db
retrieving xml document from database
retrieving xml document from database  Hi Guys, I want to retrieve the xml document stored in the database on to a jsp page using jdbc/odbc connnection.Please help me in implementing this feature. Thank You Madhu
Retrieving JTree structure from database
the data from the database. Here is the full code for "JTreeStructure.java... Retrieving JTree structure from database       This example shows how to retrieving data from
Dependant & dynamic drop down list
be in this or AJAX forum. I have one dynamic drop down list from data base (working... on the values selected by user in first drop down list. How to achieve this ?   ...`));   This will select only ONE row (country) from first drop down. In my case
code for selected checkbox columns data from database
code for selected checkbox columns data from database  in my page iam... one or more checkboxes i have to get data of that selected columns only. what is the jsp code for this thanks in advance kalyani
how to store multiple values from drop down in database where i am using java struts 1.3
how to store multiple values from drop down in database where i am using java struts 1.3  hii, i am coding a form where i need a keyskills attribute... is displaying.. i need code in java so that it takes multiple values
Retrieving the Image from a database Table
Retrieving the Image from a database Table Consider a case where we want... to retrieve the image from the database table. You can do it very easily after... from the database table our java program need to make a connection
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 ... of the persons who work in that department.The values into the drop down list should... and department fields also.I have a create an jsp page in which there should 2 drop down
Excel Cell Drop Down List
Excel Cell Drop Down List In this section, you will learn how to validate data entered in a cell and provide a drop down list of possible values to the user... the drop down as follows :ADS_TO_REPLACE_2 Download Source Code
Retrieving specific data from excel
Retrieving specific data from excel  Hello everyone, i have written a simple code to retrieve data from excel sheet and working fine, the excel file... to be printed. here is my sample code try { FileInputStream file = new
related retrieving value from oracle database
related retrieving value from oracle database  how we get the value from database in the given textbox
related retrieving value from oracle database
related retrieving value from oracle database  how we get the value from database in the given textbox
check radio button on retrieving the value from database.
check radio button on retrieving the value from database.  HI i am new to jsp.In my applcation i having a problem. I am retrieving user payment from... information from database the i want to show cash radio button checked.How can i do
Select functionality of drop down list - Struts
Select functionality of drop down list  Hi, I have to write a code(in struts application) in which if user select HIDE from the drop down list... for entering Age,Now if user select "HIDE" from drop-down list the below text

Ads