I have hibernate.cfg.xml file.
Use constants from Environment
class
Try to call conf.configure();
here.
And properties may need to have hibernate prefix like "hibernate.connection.username"
Hope it helps.
Try like this it is working fine
AnnotationConfiguration conf = new AnnotationConfiguration().configure("/dronehibernate.cfg.xml");
conf.setProperty("hibernate.connection.url","jdbc:mysql://localhost/PAT_DRONE_DB1");
SessionFactory sessionFactory = conf.buildSessionFactory();
Session session = sessionFactory.openSession();
List<NetworkType> channelList = session.createQuery("from NetworkType").list();