Why use JNDI for data sources

后端 未结 5 668
谎友^
谎友^ 2020-12-04 14:29

Can anyone help explain why JNDI should be a preferred way to expose services such as a database / jms?

The posts I run into all talk about the advantage of not havi

5条回答
  •  隐瞒了意图╮
    2020-12-04 15:01

    The real benefit of JNDI over property files comes when deploying to a clustered environment. Using property files leaves the possibility of some of the server instances having a different value. When using JNDI the same value is pushed out to all of the clustered servers by the domain controller, removing the need to copy the same property file to all of the servers (and probably restarting the server/app).

提交回复
热议问题