This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Connection Pool that is local to my application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Connection Pool that is local to my application" Watch "Connection Pool that is local to my application" New topic
Author

Connection Pool that is local to my application

Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Is it possibel to configure a connection pool in the xml file under $CATALINA_HOME/conf/Cataline/localhost?

I noticed that in the Tomcat docs the context was in Server.xml which I don't really like...


SCJP 1.5
http://devpinoy.org/blogs/lamia/ - http://everypesocounts.com/
Masoud Kalali
Author
Ranch Hand

Joined: Jul 08, 2004
Posts: 531

you can put the connection pool declaration in a context.xml file and put this file inside your_application/META-INF folder .
you should know that meta-inf folder is a sibiling of web-inf folder.

hth


Masoud Kalali
Software Engineer - My Weblog - GlassFish Security
Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Thank you for your reply. That was very enlightening.
Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Hmmm... What if I don't have a context.xml file because I deployed a webapp from a war file?
Masoud Kalali
Author
Ranch Hand

Joined: Jul 08, 2004
Posts: 531

before you create the war file you can create that meta-inf folder and add context.xml to it.
even you can extract the war file create that folder and xml file and rearchive the war file.

if you the the later make sure that content of archive file should be your web application content not the folder that contains your web application.
Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Hi again, sorry if I'm getting this slow. Does context.xml need be the same name as my application like what you do with $CATALINA_HOME/conf/engine/host? Also, would all the attributes on the context tag still be mandator?

<Context path="/DBTest" docBase="DBTest"
debug="5" reloadable="true" crossContext="true">

</Context>

I was wondering if it would be possible to just put

<Context>
</Context>

since this is inside my app's META-INF folder...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Connection Pool that is local to my application
 
Similar Threads
Configure Datasource with Tomcat
New Article: JDBC Connection Pooling
connection pooling in tomcat
connection pool ? (JBoss / DBCP / c3po )
I need to connect WAS 6.1.0.0 to MS-Access through ODBC