Java开发网 |
注册 |
登录 |
帮助 |
搜索 |
排行榜 |
发帖统计
|
您没有登录 |
» Java开发网 » Java EE 综合讨论区
打印话题 寄给朋友 订阅主题 |
作者 | Re:找寻出错的原因 (JspServletWrapper.service) [Re:skyleon2004] |
skyleon2004
发贴: 10 积分: 0 |
于 2004-08-10 23:43
HibernateUtil.java文件: package mysql; import net.sf.hibernate.*; import net.sf.hibernate.cfg.*; public class HibernateUtil { private static final SessionFactory sessionFactory; static { try { sessionFactory = new Configuration().configure().buildSessionFactory(); } catch (HibernateException ex) { throw new RuntimeException("Exception building SessionFactory: " + ex.getMessage(), ex); } } public static final ThreadLocal session = new ThreadLocal(); public static Session currentSession() throws HibernateException{ Session s = (Session) session.get(); // Open a new Session, if this Thread has none yet if (s == null) { s = sessionFactory.openSession(); session.set; } return s; } public static void closeSession() { try { Session s = (Session) session.get(); session.set(null); if (s != null) s.close(); } catch(HibernateException e) { e.printStackTrace(); System.out.println("error:closeSession"); } } } 菜鸟请教,基本程序调试不通,急急急急急急!!! |
话题树型展开 |
人气 | 标题 | 作者 | 字数 | 发贴时间 |
8374 | 找寻出错的原因 (JspServletWrapper.service) | skyleon2004 | 6979 | 2004-08-07 15:43 |
6980 | Re:找寻出错的原因 | why | 36 | 2004-08-07 19:05 |
6822 | Re:找寻出错的原因 (JspServletWrapper.service) | buxing | 50 | 2004-08-12 16:26 |
7283 | Re:找寻出错的原因 (JspServletWrapper.service) | skyleon2004 | 48 | 2004-08-12 18:15 |
7085 | Re:找寻出错的原因 (JspServletWrapper.service) | skyleon2004 | 530 | 2004-08-08 00:34 |
7020 | Re:找寻出错的原因 1 | skyleon2004 | 119 | 2004-08-08 00:36 |
7042 | Re:找寻出错的原因 (JspServletWrapper.service) | skyleon2004 | 18 | 2004-08-09 10:58 |
6935 | Re:找寻出错的原因 (JspServletWrapper.service) | why | 355 | 2004-08-10 03:01 |
7083 | Re:找寻出错的原因 (JspServletWrapper.service) | skyleon2004 | 1838 | 2004-08-10 23:40 |
6968 | Re:找寻出错的原因 (JspServletWrapper.service) | skyleon2004 | 1206 | 2004-08-10 23:43 |
7021 | Re:找寻出错的原因 (JspServletWrapper.service) | skyleon2004 | 700 | 2004-08-11 00:04 |
6938 | Re:找寻出错的原因 (JspServletWrapper.service) | skyleon2004 | 9 | 2004-08-11 23:04 |
6976 | Re:找寻出错的原因 (JspServletWrapper.service) | zerol | 15 | 2004-08-11 23:10 |
已读帖子 新的帖子 被删除的帖子 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |