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

时间: 2024-09-29 18:45:57

JDBC 报错 "SQLException: Column 'addtime' not found",求助!的相关文章

JDBC报错 消息 Could not get JDBC Connection; nested exception is java.sql.SQLException: Unknown system variable &#39;tx_isolation&#39;

今天用JDBCTemplate时,发现启动服务器之后报错: Could not get JDBC Connection; nested exception is java.sql.SQLException: Unknown system variable 'tx_isolation'. 网上说是因为MySQL版本过高的问题,我的MySQL版本是8.0,里面已经没有tx_isolation,变成了transaction_isolation,用了以下几种解决方法: (1)更改MySQL  无效,仍然

hibernate报错:Column &#39;id&#39; cannot be null

报错内容: 17:21:59,843  INFO org.hibernate.tool.hbm2ddl.SchemaExport:226 - Running hbm2ddl schema export 17:21:59,859 DEBUG org.hibernate.tool.hbm2ddl.SchemaExport:242 - import file not found: /import.sql 17:21:59,859  INFO org.hibernate.tool.hbm2ddl.Sch

MySql数据库执行insert时候报错:Column count doesn&#39;t match value count at row 1

遇到这个问题之后,第一反应就是前后列数不等造成的,但是我检查SQL之后,发现列数是相同得,但是插入还是有问题,然后又写了简单得SQL只插入不为空得字段,执行还是报这个错,最后请教了高人,指点之后,大概是因为当前插入得表被锁住了,然后执行下面得SQL后,之前得SQL就可以正常插入了 LOCK TABLES `system_function_info` WRITE;  UNLOCK TABLES; MySql数据库执行insert时候报错:Column count doesn't match val

Idea中使用jdbc报错:Wed Mar 21 09:28:33 CST 2018 WARN: Establishing SSL connection without server&#39;s identity verification is not recommended...

报错提示: Sat Oct 21 09:28:33 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit opti

JDBC 报错 CommunicationsException: Communications link failure

|--报错内容 com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. at com.mysql.cj.jdbc.exceptions

jdbc 报错解决办法

刚刚看到一个童鞋出现了这个问题 其实这个问题很好解决 在工程中创建一个lib目录: 然后讲mysql包复制进去 然后对着包点击右键 build path就可以了 最后面再次运行就可以了 jar包地址下载: http://dev.mysql.com/downloads/connector/j/

java项目连接jdbc报错:com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server

原因:相关jar包版本太低 解决方法:下载最新版的mysql-connector-java即可 原文地址:https://www.cnblogs.com/zhengna/p/9098694.html

mysql 案例 ~ 程序端报错案例

一 简介:汇总程序报错提示的相关问题二 问题 1 程序错误信息 max_allowed_packet 设置过小导致java程序写入失败    答案  1 max_allowed_packet=32M 写入配置文件并重启              2 set global max_allowed_packet=33554432    问题2 mysql错误日志 sort    错误日志:    [ERROR] /usr/local/mysql/bin/mysqld: Sort aborted: Q

mysql插入报错:java.sql.SQLException: Incorrect string value: &#39;\xE6\x9D\xAD\xE5\xB7\x9E...&#39; for column &#39;address&#39; at row 1

界面报错: 日志报错: java.sql.SQLException: Incorrect string value: '\xE6\x9D\xAD\xE5\xB7\x9E...' for column 'address' at row 1 at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) ~[mysql-connector-java-8.0.17.jar:8.0.17] at com.mys