Connecting to database in web server

I have a database in my web site and I want to get the DB table details from the database and also send data to my DB. How can I connect to my database and get the DB details from my web server and how I can display them in my app?
can any one help me?


jdbc, hibernate, spring data … How is it related to JME though?