So do I understand this correctly? Tomcat will read the context.xml file in the META-INF directory and get the data source from there?
I also added a resource ref in my web.xml because that's what various tutorials suggest. After that is done, how do I obtain a connection? and one more question, is it correct to make a DAO a singleton? Thanks, On Sun, Mar 22, 2009 at 7:57 PM, Caldarale, Charles R < chuck.caldar...@unisys.com> wrote: > > From: Mighty Tornado [mailto:mighty.torn...@gmail.com] > > Subject: Tomcat Data sources and connection pools > > > > 1. I used WebLogic previously and there you had to configure > > connection pools and then create data sources and link them > > to connection pools. > > You can manage the pool yourself, but it's certainly easier if you let > Tomcat do it. The doc is here: > http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html > > > 2. From what I understand I need to create the data source > > definition in the Context element of an xml file. Which xml > > file is it? > > You can define the data source in a <Context> file if you want it available > only to one webapp, or as a <GlobalResource> if you want it available to all > webapps. A <Context> element describes the Tomcat-specific configuration > for a webapp; it is normally located within the webapp at > META-INF/context.xml, or you can also put it at > conf/Catalina/[host]/[appName].xml if you want to keep it outside of the > webapp's .war file or directory. (For compatibility with older Tomcat > versions, you can also put it in conf/server.xml, but that's strongly > discouraged these days.) Doc is here: > http://tomcat.apache.org/tomcat-6.0-doc/config/context.html > > Do not use the path of docBase attributes when using one of the standard > location for your <Context> element and webapp. > > - Chuck > > > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY > MATERIAL and is thus for use only by the intended recipient. If you received > this in error, please contact the sender and delete the e-mail and its > attachments from all computers. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >