搭建jfinal框架时报 Could not load driverClass com.mysql.jdbc.Driver

Posted 锋齐叶落

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了搭建jfinal框架时报 Could not load driverClass com.mysql.jdbc.Driver相关的知识,希望对你有一定的参考价值。

搭建jfinal框架时报 Could not load driverClass com.mysql.jdbc.Driver

没有加载MySQL的驱动,你有没有把mysql的驱动包放到你项目的WEB-INF目录下的lib目录中,这是一个原因
另外,在Tomcat服务器的根目录下也有一个lib目录,你也要把mysql的驱动包放进去
连接池是应用服务器提供的,tomcat不是应用服务器,tomcat的连接池不能在mian方法中运行只能借助于web

容器运行,也就是必须是在tomcat中运行,jboss,weblogic是正真的应用服务器,它们可以在main方法中运行,但

也要设置它的运行环境才行!



以上是关于搭建jfinal框架时报 Could not load driverClass com.mysql.jdbc.Driver的主要内容,如果未能解决你的问题,请参考以下文章

使用 Gradle 编译 Java 项目时报错: Could not find Tools.jar

eclipse启动时报错 Could not create the java virtual machine

解决使用eclipse创建maven web项目时报Could not resolve archetype的问题

NFS启动时报错Linux NFS:could not open connection for tcp6

require sqlite3时报The specified module could not be found.错误

MyBatis配置时报错:Type interface * is not known to the MapperRegistry 和 Could not find resource *