tomcat 6.0 + mysql + jndi 数据库连接池配置

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

     

     

     


版权声明:本文为guopengzhang原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。