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代码: