I've using Hibernate ORM for a year now and c3p0 about a couple of months. I've read on web, c3p0 is a JDBC connection and statement pooling library, that enhances JDBC drivers.
But, I wants to know, where exactly does it sit?
For reference, here is the schematic of JDBC-ODBC bridge.
Now, c3p0 replaces the JDBC API?
or it works along with JDBC API using some enhanced classes rather than traditional JDBC API classes?
If neither, than what it does & where it belongs in this schematic or even out of this schematic?
Please elaborate more about C3P0, that you know!
The picture you have posted pertains to the Type-1 JDBC drivers, which is mostly legacy today. More generally, the picture explains the lower-level details which are not relevant to understanding C3P0.
C3P0 is simply an implementation of the DataSource
API, which conceptually sits just above the raw JDBC DriverManager
. The main function of a DataSource
is acquiring a standard JDBC Connection
from it and releasing it in the end.