
hibernate.cfg.xml文件中怎么引入properties文件
1个回答
2017-09-21
展开全部
你使用hibernate不知道你有没有工厂类SessionFactory自动生成的话,其中有这句改变后面路径(你的应该是/sever/hibernate.cfg.xml)privatestaticStringCONFIG_FILE_LOCATION="/config/hibernate/cfg/hibernate.cfg.xml";自己写的工厂类的话应该会有加载的路径publicstaticfinalStringHIBERANTE_CONFIG_FILE="/sever/hibernate.cfg.xml";(成员变量)Configurationconfiguration=newConfiguration().configure(HIBERANTE_CONFIG_FILE);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询