aspose file tools*
The moose likes JDBC and the fly likes Problem with MySql Connections in servlet application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Problem with MySql Connections in servlet application" Watch "Problem with MySql Connections in servlet application" New topic
Author

Problem with MySql Connections in servlet application

John Schretz
Ranch Hand

Joined: Sep 10, 2008
Posts: 188

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

amit punekar
Ranch Hand

Joined: May 14, 2004
Posts: 512
Hi,
Just curious to know if there is any reason you are not using commons DBCP connection pool ?
Regards,
Amit
John Schretz
Ranch Hand

Joined: Sep 10, 2008
Posts: 188
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

Joined: May 14, 2004
Posts: 512
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
 
 
subject: Problem with MySql Connections in servlet application