Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]

前端 未结 9 1442
遥遥无期
遥遥无期 2020-12-08 18:30

I am trying to configure hibernate orm mapping tool to my java class and using PostgreSQL as my database and configured the password as "password". When I tried to

9条回答
  •  时光说笑
    2020-12-08 19:12

    I got the same error and changing the following

    SessionFactory sessionFactory =
        new Configuration().configure().buildSessionFactory();
    

    to this

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

    worked for me.

提交回复
热议问题