Mybatis Error attempting to get column 'xxx' from result set. Cause: java.sql.SQLDataExcepti

Posted Faink

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Mybatis Error attempting to get column 'xxx' from result set. Cause: java.sql.SQLDataExcepti相关的知识,希望对你有一定的参考价值。

Mybatis实战报错

Error attempting to get column ‘xxx‘ from result set. Cause: java.sql.SQLDataException: Unsupported conversion from LONG to java.time.LocalDateTime
技术图片

可能的原因

  • 数据库字段与实体类字段映射没有一一对应
  • xml文件的结果集映射出错(jdbcType等)
  • 实体类的构造器缺乏
    mybatis查询出来的数据封装入实体需要类的全参构造器
    详情请观看Mybatis官网文档

以上是关于Mybatis Error attempting to get column 'xxx' from result set. Cause: java.sql.SQLDataExcepti的主要内容,如果未能解决你的问题,请参考以下文章

mybatis报错Error attempting to get column ‘id‘ from result set. Cause: org.postgresql.util.PSQLExcept

Error attempting to get column 'e_gender' from result set

SignTool Error: An error occurred while attempting/Error information: “SignerTimeStamp() failed.“(代码

InnoDB: Error: io_setup() failed with EAGAIN after 5 attempts

PollingBlockTracker - encountered an error while attempting to update latest block:

Error attempting to get column from result set