mysql - Hibernate not working Intellij driver not found -
I have a web application and I am working on hibernate.
As soon as I call my webservice, which uses Hibernate, I am getting the error
org.hibernate.service.classloading.spi.ClassLoadingException: The specified JDBC driver can not be loaded
I have read some posts on SO, where the solution was to add the driver to the classpath.
What I did for the first time, I've added the dependence to my pom.xml, but later it did not download any of the lbs, so I downloaded it manually from Maven.
Now I "mysql-connector-java-5.1.31.jar" and other things in my labs
but it did not have any effect.
Later I copied Lib in my Tomcat / Libs folder, which had no effect.
Why to load the driver and how can I fix it?
My hibernate.cfg.xml:
& lt ;? XML version = '1.0' encoding = 'UTF? -8 '& gt; & Lt ;! DOCTYPE Hibernate-Configuration PUBLIC "- // Hibernate / Hibernate Configuration DTD / / n" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> & Lt; Hibernate-configuration & gt; & Lt; Session-Factory & gt; & Lt; Property Name = "connection.url" & gt; Jdbc: mysql: // localhost: 3306 / microproject & lt; / Property & gt; & Lt; Property Name = "connection.driver_class" & gt; Com.mysql.jdbc.Driver & lt; / Property & gt; & Lt; Property Name = "connection.username" & gt; Hibernate & lt; / Property & gt; & Lt; Property Name = "connection.password" & gt; Hibernate & lt; / Property & gt; & Lt; Mapping Class = "Database. DvsetLLTT" / & gt; & Lt ;! - DB Schema will be updated if necessary - & gt; & Lt ;! - & lt; Property Name = "hbm2ddl.auto" & gt; Update & lt; / Property & gt; - & gt; & Lt; / Session-Factory & gt;
Comments
Post a Comment