首页 > 其他分享 >Application.properties文件(持续更新)

Application.properties文件(持续更新)

时间:2022-11-16 17:45:46浏览次数:50  
标签:druid Value Application datasource 更新 oracle 注入 properties size

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

相关文章