错误信息:ORG.APACHE.IBATIS.TRANSACTION.TRANSACTIONeXCEPTION:Error configuring AutoCommit,Your driver may not support getAutoCommit() or setAutoCommit(). Requested setting: false. Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 604,992,953 milliseconds ago.
修改mybatis配置文件:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<!-- 引入数据库联接配置文件 -->
<properties resource="db.properties" />
<!-- 环境定义 -->
<environments default="development">
<environment id="development">
<transactionManager type="jdbc" />
<dataSource type="pooled">
<property name="driver" value="${driver}" />
<property name="url" value="${url}" />
<property name="username" value="${userid}" />
<property name="password" value="${passwd}" />
<property name="poolPingQuery" value="SELECT NOW()" />
<property name="poolPingEnabled" value="true" />
</dataSource>
</environment>
</environments>
<!-- 注册自己的 mapper 文件 -->
<!-- 分两种:XML文件形式 和 Annonation注释形式 -->
<!-- 注释形式需要注册 Mapper接口 -->
<mappers>
<mapper class="cn.golfonline.sureface.sport.mapper.SportMapper" />
</mappers>
</configuration>