Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes JDBC and Relational Databases and the fly likes Nested set from SQL to Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Nested set from SQL to Java" Watch "Nested set from SQL to Java" New topic

Nested set from SQL to Java

Knolf Moervenson

Joined: Jul 25, 2008
Posts: 12
Hi there!
In a Java application I am using an SQL table in Nested Set structure for saving a XML tree. The nested set structure is said to be able to rebuild the tree structure very quickly (just one select), which is exactly what I need.
Now, I am trying to get the tree structure out of the database table and put the result in a Java tree. In the web there are excellent examples for that quick select statement, but sorry, the result is not a tree but as a matter of select statements in general the result is ofcourse always a list. Has anyone experiences with getting a Nested Set Tree from an SQL table back in a Java tree? Do I have to rebuild the tree structure in Java on my own or is it possible to get a tree structure directly out of the MySQL datatable using a certain statement (so that the result set is not a list but a tree)?

I agree. Here's the link:
subject: Nested set from SQL to Java
It's not a secret anymore!