druid版本过低引发的bug

在测试的时候引发的bug:
由于我在项目中使用了druid数据源,由于druid数据源的版本太低,不支持JDK8中的LocalDate、LocalTime、LocalDateTime等日期类型,所以解决方案就是下载新版本的druid依赖。

十一月 17, 2023 12:52:50 上午 org.springframework.test.context.support.AbstractTestContextBootstrapper getDefaultTestExecutionListenerClassNames
信息: Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.event.ApplicationEventsTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener, org.springframework.test.context.event.EventPublishingTestExecutionListener]
十一月 17, 2023 12:52:50 上午 org.springframework.test.context.support.AbstractTestContextBootstrapper getTestExecutionListeners
信息: Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@4b952a2d, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@3159c4b8, org.springframework.test.context.event.ApplicationEventsTestExecutionListener@73846619, org.springframework.test.context.support.DependencyInjectionTestExecutionListener@4bec1f0c, org.springframework.test.context.support.DirtiesContextTestExecutionListener@29ca901e, org.springframework.test.context.transaction.TransactionalTestExecutionListener@5649fd9b, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@6adede5, org.springframework.test.context.event.EventPublishingTestExecutionListener@2d928643]
十一月 17, 2023 12:52:51 上午 com.alibaba.druid.support.logging.JakartaCommonsLoggingImpl info
信息: {dataSource-1} inited

org.springframework.dao.InvalidDataAccessApiUsageException: Error attempting to get column 'create_time' from result set.  Cause: java.sql.SQLFeatureNotSupportedException
; null; nested exception is java.sql.SQLFeatureNotSupportedException

对于异常(org.springframework.dao.InvalidDataAccessApiUsageException)的处理:

org.springframework.dao.InvalidDataAccessApiUsageException是Spring框架中的一个异常类,
通常在使用Spring Data JPA时出现。
它表示尝试将一个游离状态(detached)的实体对象持久化(persist)到数据库中时出现了异常。
而这个异常的原因是因为实体对象已经存在于数据库中,但是在持久化时却被当做一个新的实体对象来处理,导致了数据冲突。
引用中的错误信息是在尝试从结果集中获取名为’create_time’的列时出现了java.sql.SQLFeatureNotSupportedException异常,
这个异常通常是由于JDBC驱动程序不支持某些特定的功能或方法而引起的。
可能的解决方法是升级JDBC驱动程序或更改代码以避免使用不支持的功能或方法。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值