What 1.C3P0 is.
C3P0 is a library. It extends the traditional JDBC database connection pool and supports standard extensions for JDBC3 specifications and JDBC2.
2. Why use C3P0.
First, C3P0 is a JDBC database connection pool. So why use a database connection pool? Because database connectivity is a critical, limited, and expensive resource. Traditional patterns (such as the traditional Java Web project, in the beans of the servlet to establish a database connection), each connection needs to authenticate users, consuming a lot of time and resources. When the database connection pool is initialized, the database connection is stored in memory as an object, and when the user needs to access the database, it is not a new connection, but an established idle connection object is removed from the connection pool. When used, the user does not close the connection, but instead puts the database connection object back into the connection pool. The database connection pool manages the establishment and disconnection of data connections, while monitoring the number and usage of database connections. Using database connection pooling significantly increases the scalability of the entire application (greatly increasing the number of connections) and robustness (the ability to respond to large numbers of users connecting to the database, reducing system resource consumption) and improving the performance metrics of the application.
3.java Web project Deployment c3p0 (MyEclipse)