Hi team, It is very simple question, but I can't find, how to catch HibernateException. I just want do Exception Handling in my code, I wrote,
SessionFactory sessionFactory = new Configuration().configure("hibernate.cfg.xml").buildSessionFactory();
in my code and configure method throws HibernateException, so in try/catch block I catch HibernateException.
To test this, I just delete my Database and run the code, it was not catch in catch block, and it gives me exception, com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException.
Please help me.
|