有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

spring Java springJDBC在CollectionFactory类中没有方法,

当我在junit中使用jdbcTemplate的queryForList(String sql)方法时,我遇到了一个问题。然后我调试并发现CollectionFactory没有找到createLinkedCaseInsensitiveMapIfPossible(int columnCount)。这很糟糕,因为我编写的测试就像spring框架引用一样

enter image description here


共 (1) 个答案

  1. # 1 楼答案

    您需要检查您的spring版本
    方法CollectionFactory#createLinkedCaseInsensitiveMapIfPossible已在Spring4中删除,这个commit可以在github中获得更多细节
    因此,您有两种解决方案:

    • 使用此方法,包括spring3对您的依赖关系
    • 将SpringJDBC从版本3更改为版本4