I have some data in database in parent child relation, where my table is actually representing a forest of tree data structure.
And the table structure is like:
row1 parent: null
row2 parent:row1
row3 parent:row2
row4 parent:row1
Now when I am loading this data from DB to my data structure by JDBC, then what I am doing now is:
1. load all row where parent is null [load all the root of trees]
2. Then for each child of each root load the child in a recursive manner.
3. But here all the trees are loaded one by one.
What I want to do, spawn a thread for each tree, thus all the trees can be loaded concurrently. Any framework I can use with JDBC for the same, or any suggestion, help please.