正确配置文件
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>
整个过程是看视频对着敲得,但是在这一行出现错误.
<property name="jdbcUrl">jdbc:mysql:///localhost:3306/mysql</property>
正确写法是"//"
<property name="jdbcUrl">jdbc:mysql://localhost:3306/mysql</property>
时间: 2024-10-10 20:45:00