1、新建动态web项目。
2、添加jar包
将mysql jdbc驱动添加到tomcat安装目录下的lib目录。
3、在META-INF下添加content.xml文件。内容如下:
- WatchedResource - The auto deployer will monitor the specified static resource of the web application for updates, and will reload the web application if is is updated. The content of this element must be a string.
4、连接jdbc的Java代码:
本文介绍如何在Tomcat中部署动态Web项目并实现MySQL数据库的连接,包括配置context.xml文件及通过Java代码获取数据库连接。
150

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



