sessionFactory初始化过不去,无法往下执行

public class MyHibernateSessionFactory {

private static SessionFactory sessionFactory;

private MyHibernateSessionFactory(){

}

public static SessionFactory getSessionFactory(){

if(sessionFactory==null){

Configuration config=new Configuration().configure();

ServiceRegistry serviceRegistry =new ServiceRegistryBuilder().applySettings(config.getProperties()).buildServiceRegistry();

sessionFactory=config.buildSessionFactory(serviceRegistry);

System.out.println();

return sessionFactory;

}else {

return sessionFactory;

}

}

}


慕九州0120569
浏览 1914回答 2
2回答

慕九州0120569

没有用applicationContext.xml

oldmee

是不是applicationContext.xml文件哪里写错了
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java