Hi folks,
On the loading of my application i want to test the establishement of connection to the db.
For this, i opened a session to see if i could connect to the db but the problem is that there is no thrown exception when there is there is a bad connection string.
Is there any method in hibernate that throw an exception for connection failing? or there is another way to test the connection?
Thx,
Amine.
Code:
sessionFactory = new Configuration().configure().buildSessionFactory();
Session s = sessionFactory.openSession();
.
Hibernate version: 3.1