Please tell me if there has any of error and I want to correct and learn this method very clearly guys... thanks a lot...

February 22nd, 2012, 04:08 AM

Sean4u

Re: JDBC Too Many Connection Error

You've got some lame* exception handling in your code and you're not adequately closing the Java/MySQL resources. The MySQL Connector/J resources must be very carefully closed off after use, or you'll hit problems like yours or suffer memory leaks. Close down resources exactly as Mark Matthews does it in this post:

If either of the first two lines throw an Exception, your close() method won't be executed. Either write separate try blocks or (better) use a 'finally' block to clean up - with separate try blocks inside it if you're cleaning up more than one resource.