• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Problem with MySql Connections in servlet application  RSS feed

 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am having a problem in tomcat, i am getting the below connection error.
I have my max connections set to 300 and when i check the connections in MYSql admin it only shows 27 connections.

I am using connection pooling. I have supplied the code below that i use in my application that pertains to this issue.

Is there a better way to handle the connections than what i am doing.

This is all in a simple servlet/jsp application



Connection pool


all my data classes look like this


Utility class



tomcat configuration

 
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Just curious to know if there is any reason you are not using commons DBCP connection pool ?
Regards,
Amit
 
John Schretz
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

amit punekar wrote:Hi,
Just curious to know if there is any reason you are not using commons DBCP connection pool ?
Regards,
Amit



I never knew of this. What are the advantages of it?
 
amit punekar
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Advantages as in you get basic connection pool ready that can be easily configured for Tomcat.
I had written one entry on configuring the connection pool in tomcat.
Here is the entry, hope that helps you.

Regds,
Amit
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!