hibernate的hibernate.cfg.properties

1.hibernate.cfg.properties  配置文件要放在工程目录src下,编译的时候会自动放在/bin目录下 ,所以Configuration configuration=new Configuration ();configuration.configure();

2.configuration.configure()  括号里面不需要configuration.configure(“hibernate.cfg.properties”)因为从源码可以看出,默认是加载hibernate.cfg.properties文件,如果配置文件名不是它,就需要加上了。

原文地址:https://www.cnblogs.com/keyi/p/6101323.html