C3p0 connection pool configuration problems,
Correct configuration file
1 <?xml version="1.0" encoding="UTF-8"?> 2 3 <c3p0-config> 4 5 <named-config name="mvcapp"> 6 <property name="user">root</property> 7 <property name="password">Ouyangan</property> 8 <property name="driverClass">com.mysql.jdbc.Driver</property> 9 <property name="jdbcUrl">jdbc:mysql://localhost:3306/mysql</property>10 11 <property name="acquireIncrement">5</property>12 <property name="initialPoolSize">10</property>13 <property name="minPoolSize">10</property>14 <property name="maxPoolSize">15</property>15 16 <!-- intergalactoApp adopts a different approach to configuring statement 17 caching -->18 <property name="maxStatements">20</property>19 <property name="maxStatementsPerConnection">5</property>20 21 </named-config>22 </c3p0-config>
The whole process is to watch the video, but an error occurs in this line.
<property name="jdbcUrl">jdbc:mysql:///localhost:3306/mysql</property>
The correct format is "//"
<property name="jdbcUrl">jdbc:mysql://localhost:3306/mysql</property>