【问题标题】:How to autowire NamedParameterJdbcTemplate in Spring Boot如何在 Spring Boot 中自动装配 NamedParameterJdbcTemplate
【发布时间】:2017-03-01 11:02:54
【问题描述】:

我了解 Spring Boot 会自动为我们配置 JDBCTemplate。但是当我想自动装配 NamedParameterJdbcTemplate 时,我不知道哪种方式是正确的。

private NamedParameterJdbcTemplate template

private NamedParameterJdbcTemplate namedParameterJdbcTemplate;

P.S : 我使用的是 Spring Boot 1.5.1 版本

【问题讨论】:

    标签: spring-boot named-parameters


    【解决方案1】:

    我刚刚通过阅读 Spring Boot API 找到了答案,这两种方法都有效,并且不依赖于我们的名称。问题解决了。

    【讨论】:

      猜你喜欢
      • 2017-10-09
      • 1970-01-01
      • 2017-09-07
      • 1970-01-01
      • 2019-10-21
      • 2019-05-03
      • 1970-01-01
      • 2016-10-03
      • 1970-01-01
      相关资源
      最近更新 更多