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

Posted glorythesky

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了JDBC 报错 "SQLException: Column 'addtime' not found",求助!相关的知识,希望对你有一定的参考价值。

<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",求助!的主要内容,如果未能解决你的问题,请参考以下文章

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

请问为啥我的这几行代码总报sql异常?明明在mysql下执行的很好,但到jdbc下执行就不行

SQL Server 报错:com.microsoft.sqlserver.jdbc.SQLServerException: The "variant" data type is

mybatis配置,idea报错:java.sql.SQLException: No suitable driver found for jdbc://localhost:3306/mybatis_t

如何修复:“找不到适合 jdbc:mysql://localhost/dbname 的驱动程序”错误

软工实训--学习回顾2