UnsupportedOperationException: The application must supply JDBC connections

后端 未结 3 660
走了就别回头了
走了就别回头了 2020-12-03 19:28

If I dont set anything programmatically and just call Configuration configuration = new Configuration().configure(); and use the hibernate.properties (as below)

3条回答
  •  时光取名叫无心
    2020-12-03 19:50

    An alternate way will be load all properties from hibernate.cfg.xml or hibernate.properties and overwrite only the one required programmatically.

    Configuration config = new Configuration().configure();
    config.setProperty("hibernate.connection.username", "xyz" );
    config.setProperty("hibernate.connection.password", "password" ); 
    

提交回复
热议问题