Pessoal, quero saber se o Hibernate precisa tanto do Hibernate.cfg.xml quanto do Hibernate.properties ou basta usar o Hibernate.cfg.xml.
A dúvida é pq estou usando somente o Hibernate.cfg.xml é quando dou um getSession() a exceção do try catch(...) é lançada.
public class HibernateUtil {
private static final SessionFactory sessionFactory;
static {
try {
sessionFactory = new AnnotationConfiguration().buildSessionFactory();
} catch (Throwable ex) {
// Log exception!
throw new ExceptionInInitializerError(ex);
}
}
public static Session getSession()
throws HibernateException {
return sessionFactory.openSession();
}
}
O meu hibernate.cfg.xml é:
[list]
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
Se precisar mando maiores detalhes!
Valeu!

