How to retrieve data by using combo box value in jsp?

Ads
 

How to retrieve data by using combo box value in jsp?

I am using a single jsp form.. i did not get from another form.. i do not use 2 jsp form.. all are satisfaction in this form.. What will i do. My code is following there...


<select select name="productid">




<%

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:Airworld");
query=con.prepareStatement("select * from Productdetails where productid='?'");


rs=query.executeQuery();
while(rs.next())
{
pid=rs.getString(1);


%>

<option><% out.println(pid); %></option> /// Here stored Combobox values from database.



<%
System.out.println("Product Id=" +pid);

}

rs.close();
query.close();
%>


</select>

</td>
<%



productid=pid;

query=con.prepareStatement("select * from Productdetails where productid="+"'"+productid+"'");


rs=query.executeQuery();

while(rs.next())
{
pname =rs.getString(2); // Here i am not store product name into text box.
}

%>

<td width="541"><input type="text" width="525" name="productname" value="<% out.println(pname);%>" /></td>


Note: I am using only this jsp form.. i do not use to get values from another form...
View Answers

Ads









Related Tutorials/Questions & Answers:
How to retrieve data by using combo box value in jsp? - JSP-Servlet
How to retrieve data by using combo box value in jsp? - JSP-Servlet
Advertisements
How to retrieve data using combo box value in jsp? - JSP-Servlet
How to retrieve data by using combo box value in jsp? - JSP-Servlet
How to retrieve data from database by using combo box value in jsp? - JSP-Servlet
How to retreive data by using combo box value - JSP-Servlet
How to retreive data by using combo box value - JSP-Servlet
retrieve the data to text fields from database on clicking the value of combo box
Populate a combo box using data from a database
how to get combo box value - JSP-Servlet
how i conditional access the data from database using combo box. - JSP-Servlet
how to retrieve data from database using combobox value without using request.getParameter in jsp - JSP-Servlet
How to pass the value of Selected Value of combo box into sql ??
Acees data from database using combo box - JSP-Servlet
Retrieving data from data base using jsp combo box
how can retrive value from combo box in servlet?
combo box value
combo box value
How to create textbox on combo value selection using javacsript in jsp?
how to retrieve data into combo from database in java applet?
How to Retrieve Data from Facebook Using PHP
How to Retrieve Data from Facebook Using PHP
Combo box value Error - WebSevices
Retrieving Data from Database to fill Combo Box
base the value of first combo box, how i display the second combox - JSP-Servlet
Re: base the value of first combo box, how i display the second combox - JSP-Servlet
Re: base the value of first combo box, how i display the second combox - JSP-Servlet
How to show autocomplete textbox values on combo box option selection using database?
How to create Combo Box in SWT
how to create a combo box in html
loading value into combo box by selecting value from other combo box - JSP-Servlet

Ads