Im connecting to a MySQL database from a stand alone java application via NetBeans 5
Sometimes the application does not display data from the database & when I check the connection through NetBeans I get an error saying that the Max No. of database connections has been reached in the JVM
I the coding in my application I have enclosed the the database connection within a try catch block which also includes a finaly statement.Within the finaly statement I check if any result sets or connections are open and I close them. So I dont quite understand how the no. of connections can continue to build up till the max limit is reached.
According to my knowledge I dont understand why this happens.Have I missed anything?
Maybe you're not really closing and cleaning everything as needed. It would be difficult to tell without seeing the code, but make sure all the Statement, ResultSet, Connection instances are closed in any place (best place would be the finally clause)