Search code examples
mysqlconnectionjndiconnection-pooling

Connection pool to MySQL server?


I find many resources about how to create the connection pool with JNDI to the MySQL Server; however, I want to know if I just want to use a standalone Java class to connect the MySQL Server and with a connection pool mechanism (without the help of app server), how could I figure it out?


Solution

  • Tomcat's connection pool is a separate component named DBCP. You can download it and use it without Tomcat:

    http://commons.apache.org/dbcp/

    Another very popular connection pool is C3P0 (which I believe is used by Hibernate internally). It can be downloaded here:

    http://sourceforge.net/projects/c3p0/