1. Introduction of the C3P0 jar package
2. Add a configuration in Hibernate's core configuration
<!--c3p0 Connection pool settings
-<!--use the C3PO connection pool To configure the vendor that the connection pool provides-
<property name= Connection.provider_ Class >org.hibernate.connection.c3p0connectionprovider
</property>
<!--the minimum number of database connections available in the connection pool-
<property name= "c3p0.min_size" >5</property>
<!--the maximum number
of connections in a connection pool-- <property name= "C3p0.max_size" >20</property>
<!--set the expiration time of the database connection, in seconds,
If a database connection in the connection pool is idle for more than the timeout time, it is purged from the connection pool-
<property name= "C3p0.timeout" >120</property >
<!--Check for idle connections in all connection pools in seconds--
<property name= "C3p0.idle_test_period" for every 3,000 seconds >3000</ Property>