调试3M网站项目时出现错误提示:ClassNotFoundExceptioncom.mysql.jdbc.Driver

 ClassNotFoundExceptioncom.mysql.jdbc.Driver_Class

原因分析:项目中缺少mysql-connector-java-5.1.22-bin.jar

解决办法:

右键工程名->New->Folder,新建文件夹lib,右键lib文件夹->Import导入mysql-connector-java-5.1.22-bin.jar

选中jar包右击--->BuildPath--->Add To Build Path,如下图所示:

ClassNotFoundExceptioncom.mysql.jdbc.Driver_Not_02

测试结果:在浏览器中输入地址:http://localhost:8080/3M/,显示正常

ClassNotFoundExceptioncom.mysql.jdbc.Driver_Class_03