I am facing problem while retrieving values from the jsp page.
my database structure is as follows:
-----------------------------------------------------------------------
m_emp_no|from_date|to_date|approver|status|
________________________________________
1002 | 22/9/2008 | 23/9/2008|1003 |pending
1004 | 29/9/2008 | 30/9/2008|1003 |pending
2044 | 15/9/2008 | 16/9/2008|3076 |pending
--------------------------------------------------------------------------
I am retrieving values from database properly using the following sql statement.
the username is stored in session which is the login id of the user.
p=con.prepareStatement("select * from emp_leave_application where approver='"+username+"'");
ResultSet r=p.executeQuery();
while(r.next())
{
String id=r.getString("m_emp_no");
I get two values for the approver 1003 and i am able to display that.I am using <input type="text" name="id" value="<%=id%>" size="4">
but when i want to retrieve these values in a jsp i am using code: String id=request.getParameter("id");
so that i can update the rows in database for the status whether it is approved or cancelled.
But here i am getting only one value using the above code whereas i should get two values if i login with the id 1003.
Please provide a suggestion.
thanks in advance.