1.通过@Value注入
2.通过ConfigurationProperties(prefix = "")注入
3.数组注入
4.map注入
1.通过@Value注入
oracle.datasource.druid.initial-size=20
Value("${oracle.datasource.druid.initial-size}")
protected String size;
2.通过ConfigurationProperties(prefix = "")注入
oracle.datasource.druid.initial-size=20
@ConfigurationProperties(prefix = "oracle.datasource.druid")
private int initialSize;
3.数组注入
credit.wx.user=${credit_wx_user:abc,@all}
@Value("#{'${credit.wx.user}'.split(',')}")
public List<String> mentionedList;
标签:druid,Value,Application,datasource,更新,oracle,注入,properties,size
From: https://www.cnblogs.com/yorkiiz/p/16896752.html