Using a JNDI datasource created by another application with Tomcat

前端 未结 5 1218
梦谈多话
梦谈多话 2020-12-10 21:56

I have a .properties file in my application which contains dataSource properties. I set up a JNDI reference to this dataSource using the following code :

//          


        
5条回答
  •  余生分开走
    2020-12-10 22:21

    JNDI context are private to each webapp. Context created in one app can't be accessed by others.

    Try to create an entry in GlobalNamingResources and links in both webapps using to see if it works.

    I used this setup before to read from both apps but never tried to write from one. So not sure if it will work.

提交回复
热议问题