my dog learned polymorphism*
The moose likes Tomcat and the fly likes How to access Database configuration from server.xml in tomcat5.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Bookmark "How to access Database configuration from server.xml in tomcat5.0" Watch "How to access Database configuration from server.xml in tomcat5.0" New topic
Author

How to access Database configuration from server.xml in tomcat5.0

Jyothsna Panchagnula
Ranch Hand

Joined: Jul 11, 2005
Posts: 113
Hi all,

I have the following set up in my server.xml .I want to know how to access the database connection in the java file.
do I need to write a separate class again to access the database or I can simply say get connection and run the query.





Thanks,
Jyothsna
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
Look at http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html & http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to access Database configuration from server.xml in tomcat5.0