Updation problem

How do i update multiple rows in jsp

This is my JSP code:-

<jsp:useBean id="bookingController" class="bl.Traf" />

<% long id=Long.parseLong(request.getParameter("tpid"));

Enumeration params =request.getParameterNames();

while (params.hasMoreElements())

{

//get the next parameter name

String paramName=(String) params.nextElement();

//If there are multiple values then use getParameterValues()

String paramValues[]=request.getParameterValues(paramName);

?

}

%>

The tpid is a hidden value which i'm getting from the main JSP page.

There are 5 fields named Comments,Status,ftno,ticketno,airwaysName which i want to update in all the rows and then pass all the values to this code which is shown above

What to do next?.

Plz help...

[851 byte] By [vishala] at [2007-10-2 8:34:07]
# 1

The fact noone answers your problem should have you think about how you asked it.

What exactly do you wont ? You say you need to update, fine then I excpet you have either some EJB's or some JDBC you are planning to do but nothing is mentioned in your question nor in your source.

In your code we see you loop over all your request parameters, are you trying to write some generic framework that reads all parameters and then does some updates with it ?

Give the forum a more specific answer and then we can really try to help you, is your problem more a very general , I dont have a clue what to do problem then start by reading tutorials on servlets, JDBC, ....

pgeuensa at 2007-7-16 22:35:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
All the JDBC connection has been done in other classes.I just want to pass the values of those five fields along with the hidden value from the main jsp to this jsp code.
vishala at 2007-7-16 22:35:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

String [] comments = request.getParameterValues("comment");

String [] status= request.getParameterValues("status");

String [] ftno= request.getParameterValues("ftno");

...

for (int i=0;i<comments.length;i++)

{

doYourSqlCode(comments[i],status[i],ftno[i],....);

}

For your JSP it doe not matter whatsoever if the field was hidden or not just treat them all the same.

WHat exaclty do you want the tpid to do ?>

pgeuensa at 2007-7-16 22:35:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
hey thanks for the help.The tpid is a unique id assigned to each rowAnd based on the tpid I want to send one row (which contains the 5 updated fields) to the database
vishala at 2007-7-16 22:35:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
You have 1 unique tpid but mutliple rows ? How do you determine what row corresponds with that id ?
pgeuensa at 2007-7-16 22:35:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
There is one tpid assigned for each row i.e each row has its own tpid
vishala at 2007-7-16 22:35:30 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...