需要C3P0的xml文件
com.mysql.cj.jdbc.Driver jdbc:mysql://localhost:3306/books?serverTimezone=UTC root 123456 5 10 5 10 5 2
然后通过配置文件中的name-config创建数据源对象
ComboPooledDataSource comboPooledDataSource = new ComboPooledDataSource("mysql_C3P0");
就可以直接建立连接
Connection connection = comboPooledDataSource.getConnection();



