Tuesday, 10 September 2013

Forming a parent child structure using the data from the result set

Forming a parent child structure using the data from the result set

I am developing a webpage where the user can able to select the list of
options based on the category.So a parent node has the category and the
child node has the list of options to select using a radio button.
here it goes
After Retrieving the records from the database
while(resultSet.next())
{
entertainment = resultSet.getString(1);
listofChoices = resultSet.getString(2);
}
In this looping , i need to form a parent child structure and store it in
a map(Key value pair combination) to pass it to my JSP page.
1.Not all child nodes come under the category.This means that the list of
choices can be congifured under null category also.
Is there any way on how to achieve this?
Ex:
Entertainment Themeparks
Entertainment Casino
NULL ToyStore
Thanks for your help ...

No comments:

Post a Comment