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;
}
}
}