从另一个项目访问持久性文件
我按以下方式设置了 EJB 项目
EAR Project
EJB Proj
EJB Client Proj
JPA Proj
Web Proj
我当前需要使用 JPA proj 中的 persistance.xml 文件从 servlet(在 Web proj 中)查询数据库
访问此项目的最佳方式是什么? 谢谢 乔恩
I have an EJB project setup in the following way
EAR Project
EJB Proj
EJB Client Proj
JPA Proj
Web Proj
I am in current need to use the persistance.xml file from the JPA proj to query the db from a servlet (in the web proj)
What would be the best way to gain access to this?
Thanks
Jon
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不需要 persistance.xml 文件来访问数据库连接。
在Web项目中,您可以通过JNDI查找来获取数据库连接。
尝试一下:
You do not need persistance.xml file to get the access to database connection.
In the web project you can get database connection by JNDI lookup.
Try something: