This is my hibernate config file. I put it in src/main/resources and I put it in src .
But all the time I get this error:
Could not locate cfg.xml resource [hibernate.cfg.xml]
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
</session-factory>
</hibernate-configuration>
This is how I wrote my config file. I am using spring. I just found out that actually all this is not necessary in spring. You could just autowire SessionFactory.