码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2017-08-17 20:05:00      阅读:309      评论:0      收藏:0      [点我收藏+]

标签:select   sql   UI   order   报错   get   ram   cat   images   

<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",求助!

标签:select   sql   UI   order   报错   get   ram   cat   images   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!