开发者

Accessing a JNDI DataSource without the java:comp/env prefix

开发者 https://www.devze.com 2023-01-11 09:14 出处:网络
I\'ve noticed that both ways of looking up a DataSource using JNDI work: jdbc/DataSource java:comp/env/jdbc/DataSo开发者_JAVA技巧urce

I've noticed that both ways of looking up a DataSource using JNDI work:

  1. jdbc/DataSource
  2. java:comp/env/jdbc/DataSo开发者_JAVA技巧urce

With the added bonus that the first one doesn't seem to anger Websphere when used from an unmanaged thread ( started by Quartz ).

Are there any pitfalls from accessing JNDI objects without the prefix?


This should be OK, since java:comp/env is the global JNDI namespace. It may depend on the application server where such configurations also appear in the JNDI tree.

Locate your JDBC DataSource in WebSphere Application Server using JNDI

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号