Originally posted by Kiran Baratam:
Hi
Thanks for the reply.
If i dont send the resultSet object and loop through i need to execute the SQL inside jsp page.So i need to make all DB stuff insid jsp.
I thought your ResulSet had already been populated in your servlet, just before putting it in the request.
Anyways, if your application is small, here's my $0.02:
- In your servlet, once you have your ResultSet, iterate over it, create a Bean (with setter/getter), and put that bean in a vector.
So, if you have a table CUSTOMER:
name
address
city
create a bean with properties name, address, city. For every row you iterate create a bean and set the values of your bean. Once you've populated it, put it in a vector.
When you finish iterating, you will have a vector full of beans. Put the vector in the request (or session, you decide).
In your jsp, you will get the vector. In position 0, for instance, you will have a bean and you can use getter methods to print your results.
I hope I didn't confuse you more
. There are many solutions, this is just one.
HTH