Jyoti Vaskar wrote:how to set the values retrived from select query from a resultset into a bean?
As I know in the bean setter method we do set.
but when we do while(resultset.next()), for 1st loop the values will be set then what? for the next iteration & so on?
the last iteration values will be set only when finish?
How to use bean in this case?
That may depends on what you retrieve in your query. If that contains only one row then you need only one bean instance. Or if it is more than one then if you need to get all those records (i.e: list of beans) then you need to have a List (or any data structure that can hold many objects), populate the bean and add it to your data structure in each iteration. What's the exact issue you are having ? What have you tried so far?
Jyoti Vaskar wrote: but I do have a very huge data that has to be set in bean.
means see for four coloums say I can set for 1 iteration.
But then what for the next iterations ? How can I get all the values to display in the jsp?
You should set the list of beans in a suitable scope (perhaps request scope) and in JSP you can get the list of beans, iterate and display them. You are using MVC or any other framework ? If not you should read atleast about MVC.