Hi guys,
I'm new of Hibernate, please help me to understand my issue...I found other solution on forum, but they didn't help me.
I developed a Javafx application that should interact with derby database via hibernate.
When I run application, at first query time this exception:
Code:
AVVERTENZA: No connection properties specified - the user must supply JDBC connections
Initial SessionFactory creation failed.org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
This is my hibernate.cfg.xml
Code:
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.DerbyDialect</property>
<property name="hibernate.connection.driver_class">org.apache.derby.jdbc.ClientDriver</property>
<property name="hibernate.connection.url">jdbc:derby://localhost:1527/dbname</property>
<property name="hibernate.connection.username">root</property>
<property name="show_sql">true</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<mapping resource="application/entity/Paziente.hbm.xml"/>
</session-factory>
</hibernate-configuration>
this is my HibernateUtil
Code:
try {
sessionFactory = new AnnotationConfiguration().addFile("D:\\testApp\\src\\application\\hibernate\\hibernate.cfg.xml").buildSessionFactory();
} catch (Throwable ex) {
// Log the exception.
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
}
and this is my package organization
Code:
application
application.dao
application.entity
Paziente.hbm.xml
Paziente.java
application.hibernate
HibernateUtil.java
hibernate.cfg.xml
hibernate.revenge.xml
application.res
I'm using hibernate 3, derby database and netbeans.
Thanks,
Regards