Home  >  Q&A  >  body text

How to dynamically load jdbc.properties

Because I want to distinguish the username and password of the database in development, test, and production environments, is there a way to dynamically read the specified jdbc configuration file, such as jdbc_dev.properties, jdbc_test.properties, etc.

目前项目的common.properties中有设置运行环境参数。
#开发环境环境标记dev/product/test
development_environment=product
请问这种处理的思路是什么,多谢了!

I don’t know if this idea is correct, I hope an experienced driver can give me some advice.

PHPzPHPz2712 days ago744

reply all(2)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-17 10:09:55

    mvn profile

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-17 10:09:55

    If you use Spring, you can use Spring’s Profile

    reply
    0
  • Cancelreply