http://tools.jboss.org/downloads/jbosstools/neon/4.4.4.Final.html#zips
2017-12-13
我用的是 Eclipse + MySQL 5.7.14 + hibernate-release-5.2.12.Final,跟老師不同地方
MySQL 5.0 以后
連接地址后面加 &useSSL=false
方言:org.hibernate.dialect.MySQL5InnoDBDialect
hibernate5.X以上參考CSDN上貼子 http://bbs.csdn.net/topics/391955731
MySQL 5.0 以后
連接地址后面加 &useSSL=false
方言:org.hibernate.dialect.MySQL5InnoDBDialect
hibernate5.X以上參考CSDN上貼子 http://bbs.csdn.net/topics/391955731
如果用myeclipse自帶的hibernate3.X版本 創(chuàng)建Sessionfactory方法。
http://www.jianshu.com/p/e48e3a3452f3
http://www.jianshu.com/p/e48e3a3452f3
我的運(yùn)行出錯(cuò)結(jié)果為 JDBCConnectionException:coulld not open connection
太贊了,聽到這個(gè)聲音我就放心了?。。。。。。?!
太贊了,聽到這個(gè)聲音我就放心了?。。。。。。?!
太贊了,聽到這個(gè)聲音我就放心了!?。。。。。?!
太贊了,聽到這個(gè)聲音我就放心了?。。。。。。?!
太贊了,聽到這個(gè)聲音我就放心了!?。。。。。?!
5.X試試:
Student stu = new Student(2,"小明","男",new Date(),"廣西");
Configuration con = new Configuration();
SessionFactory sf = con.configure().buildSessionFactory();
Session s = sf.openSession();
s.beginTransaction();
s.save(stu);
s.getTransaction().commit();
s.close();
sf.close();
Student stu = new Student(2,"小明","男",new Date(),"廣西");
Configuration con = new Configuration();
SessionFactory sf = con.configure().buildSessionFactory();
Session s = sf.openSession();
s.beginTransaction();
s.save(stu);
s.getTransaction().commit();
s.close();
sf.close();
http://blog.csdn.net/jin970505/article/details/78656764
2017-11-28
最新回答 / 慕田峪3481485
用下面的方法創(chuàng)建?sessionFactory 對(duì)象吧;好像是版本有更新,空指針異常可能是其他方面導(dǎo)致的Configuration cfg = new Configuration().configure(); ?ServiceRegistry ?builder= ?(ServiceRegistry) new StandardServiceRegistryBuilde(). ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?...