I'm discovering Hibernate today, and I'm struggling while trying to make a minimal program find my "hibernate.cfg.xml" configuration file.
Here is what I already tried :
My main :
package testHibernate;
import org.hibernate.cfg.Configuration;
public class Main
{
public static void main(String[] args)
{
Configuration configuration = new Configuration().configure();
}
}
at the same level of this main file :
hibernate.cfg.xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration SYSTEM
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/pianissimo</property>
<property name="hibernate.connection.username">admin</property>
<property name="hibernate.connection.password">nx5fDdVdEGVDS6Tq</property>
</session-factory>
</hibernate-configuration>
Any help will be greatly appreciated :) Sincerely, Alann