Set datasource values in enviornment for springboot app

I am trying to set below values in enviornment

spring.datasource.url = jdbc:mysql://localhost:3306/abc?useSSL=false spring.datasource.username = root spring.datasource.password = root

****I am using Ubuntu 22.04 ****I have set values in enviornment as

export spring_datasource_url_prefix=mysql export spring_datasource_host=localhost export spring_datasource_port=3306 export spring_datasource_database=abc export spring_datasource_username=root export spring_datasource_password=root

*****And in my springboot app, application.properties file I have used it as

spring.datasource.url=jdbc:${spring_datasource_url_prefix}://${spring_datasource_host}:${spring_datasource_port}/${spring_datasource_database} spring.datasource.username=${spring_datasource_username} spring.datasource.password=${spring_datasource_password}

But I am unable to fetch values using this.

Am I missing anything or doing it wrong?

I have tried setting enviornment through nano .bashrc and as mentioned above.