FYI - There really is nothing in the Core
JAVA API that "Connects" a JTree and a Database. You retrieve info from the DB and then build your JTree with that information, like maggie said.
That being said, you could probably hunt the internet for some 3rd party API's that do this automagically for you. But if you are needing to learn then the best thing to do is do it yourself.
It's really not that hard once you understand the TreeModel and DefaultMutableTreeNode, etc. The
JDBC stuff is a breeze.
Why don't you see what you can get, provide the code for us to see when you are having issues and we will help you through it.
BTW - It might be a good idea to get the JTree working with some static
test data that is hardcoded. Once you have that working replace the hardcoded test data with data from a DB. It won't be difficult.