DEBUG [main] - Logging initialized using 'class org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter. DEBUG [main] - PooledDataSource forcefully closed/removed all connections. DEBUG [main] - PooledDataSource forcefully closed/removed all connections. DEBUG [main] - PooledDataSource forcefully closed/removed all connections. DEBUG [main] - PooledDataSource forcefully closed/removed all connections. DEBUG [main] - Opening JDBC Connection DEBUG [main] - Created connection 1486017704. DEBUG [main] - Setting autocommit to false on JDBC Connection [com.mysql.jdbc.JDBC4Connection@5892d4a8] DEBUG [main] - ==> Preparing: insert into account(user,pass) values(?,?) DEBUG [main] - ==> Parameters: feng112(String), 000223(String) DEBUG [main] - <== Updates: 1
<insert id="insertUser" parameterType="com.upsoft.user.User" >
insert into account(user,pass) values(#{user},#{pass})
</insert>
<!-- 我的插入语句 -->
我Junit已经绿了也显示成功了,我数据库里还是就我手动添加的一条记录,之前百度了
Setting autocommit to false on JDBC Connection [com.mysql.jdbc.JDBC4Connection@5892d4a8]
这一块提示的信息,是自动提交关闭了,我又去数据库里设置的自动提交,但是还是不好使。。。就很烦。。。
没有commit吧
我是用mybatis写的还用commit吗?不是自动装填吗?我的实体类属性名与数据库表的字段都是相对应的。
@春風: 你手动在代码里面提交一下 看数据是否插入进去
查下数据库log是不是字段/类型不对,或者有触发器拦截了?