在使用pooled数据源时和c3p0数据源时 property中driver,url,username名字不同
pooled
<dataSource type="POOLED">
<property name="driver" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/mybatis?characterEncoding=UTF-8"/>
<property name="username" value="root"/>
<property name="password" value="admin"/>
</dataSource>
c3p0
<dataSource type="c3p0.C3P0DataSourceFactory">
<property name="driverClass" value="com.mysql.jdbc.Driver"/>
<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/mybatis?characterEncoding=UTF-8"/>
<property name="user" value="root"/>
<property name="password" value="admin"/>
</dataSource>
网友评论