IntelliJ IDEA-2018.2 连接MySQL数据库报错:java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/hlx20080808/article/details/88945319

解决:

     在web项目中,当Class.forName("om.mysql.jdbc.Driver")时idea是不会去查找字符串,不会去查找驱动的

 只需要把apache-tomcat-8.5.39.jar拷贝到tomcat下lib目录就可以了。

猜你喜欢

转载自blog.csdn.net/hlx20080808/article/details/88945319