首页 > 数据库技术 > 详细

JDBC 报错 "SQLException: Column 'addtime' not found",求助!

时间:2017-08-17 19:12:40      阅读:4975      评论:0      收藏:0      [点我收藏+]
<select id="listComntedProdId" resultType="java.util.Map">
select op.*, oc.comment, oc.score + 0 as score, oc.sid, oc.images, oc.is_show + 0 as is_show, oc.addtime  as comment_addtime
from onlineshop_comment as oc 
inner join onlineshop_product as op on oc.goods_id = op.id
where oc.user_id = #{uid}

order by oc.id DESC

<if test="start >=0 and limit>0"> 
limit #{start},#{limit} 
</if> 
</select>

在java环境中运行mybatis相关代码,出错

org.springframework.jdbc.UncategorizedSQLException: Error attempting to get column ‘addtime‘ from result set. Cause: java.sql.SQLException: Column ‘addtime‘ not found.

后将  “oc.addtime  as comment_addtime” 改为 "oc.addtime" ,报错消失,原因不明,求助!

JDBC 报错 "SQLException: Column 'addtime' not found",求助!

原文:http://www.cnblogs.com/yxmfighting/p/7383760.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!