-1

I'm new to java servlet programming.

In my doPost method, I will do fetch data from mysql database and write something back. I know I should somehow use a connection pool to improve performance. But wondering how. Should I main a connection pool in my java code or just need to config tomcat server?

Can you give me some suggestions about how to do this?

Pratik Singhal
  • 6,283
  • 10
  • 55
  • 97
VicX
  • 721
  • 8
  • 13

1 Answers1

0

Yes. See the tomcat documentation here which describes how to configure MySQL DBCP (Database Connection Pool). Also you might consider setting up 'Preventing database connection pool leaks' configurations to reuse abandoned connections.

Jerome Anthony
  • 7,823
  • 2
  • 40
  • 31
  • Since this document is for tomcat 6, is that same for 7? – VicX Dec 05 '15 at 02:36
  • And there is a document for [tomcat 7](https://tomcat.apache.org/tomcat-7.0-doc/jndi-datasource-examples-howto.html) if others searched this post. – VicX Dec 05 '15 at 02:59