Using c3p0 database pool

From Resin 4.0 Wiki

Revision as of 13:28, 5 September 2013 by Cowan (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Using a c3p0 datasource in Resin, bound into JNDI

This configuration can go in resin.xml as a child of <cluster>, <host>, or <web-app>, or in resin-web.xml. Where you put it depends on how globally you want the pool to be shared between webapps.

You may need to add the c3p0 jar to /var/resin/lib, the main Resin shared lib directory, since the pool will be created as a shared resource upon startup.

In the top XML element, define the c3p0 namespace by adding:


Then create the pool:

 <c3p0:ComboPooledDataSource resin:Jndi="java:comp/env/jdbc/mysql">
Personal tools