问题描述
Spring boot集成mybatis实体中时间类型LocalDateTime,查询的时候报错
Error attempting to get column 'create_time' from result set. Cause: java.sql.SQLFeatureNotSupportedException
原因分析:
因为mybatis和druid的依赖版本兼容问题导致。
我使用的mybatis-plus版本和Druid版本:
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.17</version>
</dependency>
解决方案:
方式一:升级Druid到1.1.21
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.21</version>
</dependency>
方式二:mybatis-plus版本将至3.0.5
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.0.5</version>
</dependency>
版本的降低和升级不一定要完全按照上面,可以自己测试一下,切换到兼容的版本即可。














![机器学习周记(第三十四周:文献阅读[GNet-LS])2024.4.8~2024.4.14](https://img-blog.csdnimg.cn/direct/f6ec91422f164580a55921531e2fd5b1.png)




