File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Connection Pooling in tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Connection Pooling in tomcat" Watch "Connection Pooling in tomcat" New topic

Connection Pooling in tomcat

Glenny Dsilva
Ranch Hand

Joined: May 09, 2005
Posts: 42
I am using servlets tomcat 5.0 webserver and mysql as database in my project.

I want to use connection pooling.

If i want 50 active connections in my application.

How do i configure it in my web application.

Can someone explain or give me a url to configure it.
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Presuming you are happy using Tomcat's default connection pool (DBCP) you just configure your DataSource to use up to 50 connections with the "maxActive" parameter. If you read through the Tomcat documentation, particularaly the part about JNDI resources, you'll see how its done.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ben Souther

Joined: Dec 11, 2004
Posts: 13410


There is a forum devoted to Apache Tomcat on this site.
Your question will probably get better responses there.

Here is the documentation Paul mentioned:

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: Connection Pooling in tomcat
It's not a secret anymore!