使用 Spring的JndiObjectFactoryBean配置数据源时要记得在描述文件中增加资源引用
<root-node>
<resource-ref>
<res-ref-name>jdbc/spring</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</root-node>

root-node具体为何要根据容器决定,web应用中为web-app
在spring中用java:comp/env/jdbc/spring配置
本文介绍如何在Spring框架中使用JndiObjectFactoryBean配置数据源,并提供了一个具体的XML配置示例,展示了如何在描述文件中增加资源引用。
794

被折叠的 条评论
为什么被折叠?



