You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Gangaa D <ga...@yahoo.com> on 2006/02/14 03:09:21 UTC

Loading data in tree model from database table by Java

How do I loading data in tree model from database
table by Java?
1) ReadData(Result); read following table;
table structure:
id msg  child 
1  msg1  0  
2  msg2  1  
3  msg3  2

2) ViewTree(); print following tree;
Tree View:
 msg1
   msg2
     msg3

Please help me solve it.



 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Loading data in tree model from database table by Java

Posted by Pulkit Singhal <pu...@gmail.com>.
I guess you would just have to write a function to process the data. you
probable need to look at the "result set" and use a data structure where you
can, one by one, add the each child to the parent.
Then you could write a output method that goes through this and for each
node tabs the children and prints them.

On 2/13/06, Gangaa D <ga...@yahoo.com> wrote:
>
> How do I loading data in tree model from database
> table by Java?
> 1) ReadData(Result); read following table;
> table structure:
> id msg  child
> 1  msg1  0
> 2  msg2  1
> 3  msg3  2
>
> 2) ViewTree(); print following tree;
> Tree View:
> msg1
>    msg2
>      msg3
>
> Please help me solve it.
>
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>