Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

too many MySql Connections

Status
Not open for further replies.

HoMyGod

Programmer
Jul 17, 2000
59
CH
Hello,

I have a super class like this :

public ConnectTools()
{
try
{
this.connexion(Constant.hostName, Constant.userName, Constant.passWord, Constant.drvrName);
}
...

It allows me to connect to a MySql database.
I have several classes that inherit from ConnectTools. And a child class implement another class...so that, each time I implement one class, I have several connections on mySql.

My questions:

- How can I transform my code to have only one connection on mysql?
- How can I deconnect from the database when the user quit the browser (because the thread keep running while the session isn't finished)

One idea is to put it on the HttpSessionBindingListener (bound)...but how can I keep the connection on mysql accessible.

Thank you for any help on this painful problem
H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top