org.hibernate.internal.util.config.ConfigurationException: Could not locate cfg.xml resource [/HibernateTest/src/hibernate.cfg.xml]

前端 未结 6 704
故里飘歌
故里飘歌 2020-12-28 11:50

I am trying to connect to Postgresql9.1 in ubuntu with pgadmin3. My Pgadmin3 GUI tool does not give any option to create tables by right clicking the database, but it is ava

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-28 11:50

    All the previous answers are perfect. However, if u need a really quick solution then I would recommend you to just put your hibernate.cfg.xml file in your source folder and write

    SessionFactory sessionFactory = new Configuration().configure("hibernate.cfg.xml").buildSessionFactory();
    

    This is simple and works!

提交回复
热议问题