如何在 Tomcat 中配置数据库连接池并在 servlet 中获取连接?
我是使用 Java Servlet/JSP 进行 Web 开发的新手。如果我理解正确的话,我应该能够在 tomcat 中配置容器级数据源,并通过调用 getConnection() 方法在 servlet 代码中获取连接。
数据源和连接池的实现过程是怎样的?我使用 Oracle XE 作为数据库,Tomcat 作为服务器。
I am new to web development using Java Servlets/JSP. If I understand correctly, I should be able to configure a container level data source in tomcat, and obtain a connection in my servlet code by calling the getConnection() method.
What is the process for implementing a datasource and connection pool? I am using Oracle XE as the database and Tomcat as the server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论