I am developing software For SMS Gateway that: - do many select, insert, update and delete statements like more than one million hit on database every day. - I have some difficulties in managing resources like DB connection, so I do not know where to close the connection to minimize the number of created connections. - I use Driver Manager. - When I keep the connection unclosed I get memory leak in tomcat. - In the console app there are threads using DAOs and the have static connection so I do not close it.
1) Is it good idea not to close the connection of DB after the query done, and leave it open?
2) I have servlet running to receive SMS on http connection and insert them in DB, and I expect thousands of http connections on this servlet (maybe per minutes), shall I close and create DB connection for every request for the servlet?
3) what is the best practice for using DB Connections in this case?