Boa tarde.
Estou usando o Hibernate, fui roda o meu sistema e apareceu o seguinte erro.
DEU MERDA NO LISTAR UF DAO .Erro: >>>>>>org.hibernate.exception.GenericJDBCException: Cannot open connection
DEU MERDA NO LISTAR FUNCIONARIO DAO .Erro: >>>>>>org.hibernate.exception.GenericJDBCException: Cannot open connection
public class UfDao {
@SuppressWarnings({ "unchecked", "rawtypes" })
public List<Uf> listarUf(){
try{
Session session = HibernateUtil.getSessionFactory().getCurrentSession();
Transaction t = session.beginTransaction();
List lista = session.createQuery("from uf_estado").list();
t.commit();
return lista;
}catch(HibernateException e){
System.out.println("DEU MERDA NO LISTAR UF DAO .Erro: >>>>>>"+e);
}
return null;
}
}
Meu HibernateUtil
public class HibernateUtil {
private static SessionFactory sessionFactory;
static{
try {
sessionFactory = new Configuration().configure().buildSessionFactory();
} catch (Throwable e) {
throw new ExceptionInInitializerError(e);
}
}
public static SessionFactory getSessionFactory(){
return sessionFactory;
}
public static void shutDown(){
//closes caches and connections
getSessionFactory().close();
}
}
E não estou achando o erro.
Alguém pode ajuda.
Muito Obrigado