Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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

Win a copy of The Software Craftsman this week in the Agile forum!
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
It is sorta covered in the JavaRanch Style Guide.
subject: Connection Pooling in tomcat