No type handler could be found to map the property 'updateTime' to the column 'updateTime'

在使用ibatis查询数据时,出现如下错误:

org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; 
uncategorized SQLException for SQL []; SQL state [null]; error code [0];   
--- The error occurred in maps/read/xxxxx.xml.  
--- The error occurred while applying a result map.  
--- Check the xxxx.xxxxResult.  
--- Check the result mapping for the 'updateTime' property.  
--- Cause: com.ibatis.sqlmap.client.SqlMapException: No type handler could be found to
 map the property 'updateTime' to the column 'updateTime'.  One or both of the types,
 or the combination of types is not supported.

1.起初,以为是属性拼写错误,经过检查拼写没有问题,是一致的。

2.然后,怀疑是Bean中定义的updateTime类型与数据库中字段的类型不一致,经过检查都是Timestamp。

3.最后,还是觉得是类型问题,于是再次仔细检查,终于发现问题所在。Bean中定义的updateTime类型确实是时间戳,担不是Timestamp,而是TimeStamp。TimeStamp是org.apache.commons.net.ntp.TimeStamp,而Timestamp是java.sql.Timestamp。显然应该使用Timestamp而不是TimeStamp。

总结:要细心、细心、细心。。。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值