简体   繁体   中英

Hibernate: Unable to load class

Caused by: org.hibernate.boot.registry.classloading.spi.ClassLoadingException: Unable to load class [com.mysql.jdbc.Driver]

http://www.tutorialspoint.com/hibernate/hibernate_quick_guide.htm

I'm following the hibernate guide and i'm getting this error someone knows why?

Thanks for help.

You need to grab the mysql connector jar from here and add it to your classpath. Perhaps your /lib folder

If you are using maven, try including

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.6</version>
</dependency>

In your pom.xml

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM