mmall项目总结

1、

<context:component-scan base-package="com.mmall" annotation-config="true"/>

总是说扫描 不到"com.mmall”这个包,找了很多原因,原来一开始就错了,main下的java包要设置成resources root

2、

[21:23:19.092][DEBUG][org.mybatis.spring.SqlSessionUtils][http-bio-8088-exec-10] Creating a new SqlSession
[21:23:19.092][DEBUG][org.mybatis.spring.SqlSessionUtils][http-bio-8088-exec-10] SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@27aedc67] was not registered for synchronization because synchronization is not active
[21:23:19.093][DEBUG][o.m.s.t.SpringManagedTransaction][http-bio-8088-exec-10] JDBC Connection [jdbc:mysql://localhost:3306/mmall_learning?characterEncoding=utf8, UserName=root@localhost, MySQL-AB JDBC Driver] will not be managed by Spring
[21:23:19.093][DEBUG][com.mmall.dao.UserMapper.checkUsername][http-bio-8088-exec-10] ==>  Preparing: select count(1) from mmall_user where username=? 
[21:23:19.093][DEBUG][com.mmall.dao.UserMapper.checkUsername][http-bio-8088-exec-10] ==> Parameters: null
[21:23:19.093][DEBUG][com.mmall.dao.UserMapper.checkUsername][http-bio-8088-exec-10] <==      Total: 1
[21:23:19.094][DEBUG][org.mybatis.spring.SqlSessionUtils][http-bio-8088-exec-10] Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@27aedc67]

3、org.springframework.jdbc.support.SQLErrorCodesFactory <init>

使用spring+mybatis整合时报错:org.springframework.jdbc.support.SQLErrorCodesFactory - SQLErrorCodes loaded

错误原因是;

1.参数与数据库字段不匹配,可能是映射文件sql语句写错了,字段名与数据库中的字段名不匹配。

2.也有可能是传递的参数超过了数据库字段限定的长度。

3.也有可能是resultMap映射字段不对。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值