简体   繁体   中英

More information about <data-source> tag in web.xml

I was looking for something standard about the DataSource configuration for a Java EE application, but all I found on the Internet was container specific (example : context.xml with Tomcat).

I found this very rare subject about the <data-source> tag. See the links inside, it's very interesting. I couldn't find more information in the Sun/Oracle documentation.

So I have a few questions :

  1. Does the <data-source> tag work with all web servers ? (Tomcat, JBoss)

  2. Multiple resources : Can we have more than one <data-source> tag in the web.xml ?

  3. Do we have to use the <resource-ref> tag (for @Resource annotation) in the web.xml when we use <data-source> tag, or is it unnecessary ?

  4. When we call the DataSource with "InitialContext" or "@Resource", is it the same instance for each call ? If yes, is it more like EJB Session Bean @Stateless (which could possibly be the same instance), or more like EJB Session Bean @Singleton (must be the same instance) ?

  5. I understand that the <data-source> tag appeared with the Java EE 6 standards, but where can I found more informations about it ? Which JSR ?

Thanks

您可以使用JSR88 API查看包含Java EE 6数据源的应用程序。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM