Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java EE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Re:找寻出错的原因 (JspServletWrapper.service) [Re:skyleon2004]
skyleon2004





发贴: 10
积分: 0
于 2004-08-10 23:43 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
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.setMoon;
}
    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

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   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