JiveJdon Community Forums
在线158人   首页   主题表   培训咨询   标签   精华   查搜   注册    登陆 RSS
首页 » 论坛 » J2EE/JavaEE/JEE/EJB/JSF等技术讨论
???en_US.forumThreadPrev.name??? 上一主题
google yahoo 365Key网摘 CSDN网摘 添加到百度搜藏 POCO网摘 新浪ViVi 天极网摘
???en_US.forumThreadNext.name??? 下一主题
Go 共有 4 回复 / 1
 发表新帖子   回复该主题贴
guozt

悄悄话
发表文章: 4
注册时间: 2003年08月28日 12:07
请教:在hibernate应用中,使用hibernate.cfg.xml的方式进行配置;SessionFactory 如何取得。 2003年08月28日 12:11 到本帖网址 加入本帖到收藏夹 回复该主题
标签
同上。
magician

悄悄话
发表文章: 27
注册时间: 2003年05月23日 17:32
Re: 请教:在hibernate应用中,使用hibernate.cfg.xml的方式进行配置;SessionFactory 如何取得。 2003年08月28日 12:21 到本帖网址 加入本帖到收藏夹 回复该主题
SessionFactory sf = new Configuration().configure().buildSessionFactory();

/reference/html/session-configuration.html#session-configuration-s6
guozt

悄悄话
发表文章: 4
注册时间: 2003年08月28日 12:07
Re: 请教:在hibernate应用中,使用hibernate.cfg.xml的方式进行配置;SessionFactory 如何取得。 2003年08月28日 12:41 到本帖网址 加入本帖到收藏夹 回复该主题
null
guozt

悄悄话
发表文章: 4
注册时间: 2003年08月28日 12:07
我用的hibernate-1.2。构造器 cirrus.hibernate.cfg.Configuration() 不可视 2003年08月28日 12:42 到本帖网址 加入本帖到收藏夹 回复该主题
null
penglq

悄悄话
发表文章: 1
注册时间: 2003年08月28日 16:54
Re: 我用的hibernate-1.2。构造器 cirrus.hibernate.cfg.Configuration() 不可视 2003年08月28日 17:00 到本帖网址 加入本帖到收藏夹 回复该主题
如果用war包的话,使用

Configuration configuration = null;
java.net.URL configFileURL = null;
java.io.InputStream is = null;
String _configFilePath = "/hibernate.cfg.xml";
InputStream is = HibernateSessionFactory.class.getResourceAsStream(_configFilePath);
configuration = (new Configuration()).addInputStream(is).configure();
sf = configuration.buildSessionFactory();
标签
共有 4 回复 / 1Go
???en_US.forumThreadPrev.name??? 上一主题
  Go back to the topic 返回本主题   Go back to the topic listing返回主题列表    返回页首返回页首
???en_US.forumThreadNext.name??? 下一主题
热点TAG:
正在读取,请等待...
查询本论坛内 回复超过的热门帖子
标题
 
粗体: [b]文本[/b] 斜体: [i]文本[/i] 下划线 [u]文本[/u] 插入图片 [img]http://wwww.xxxx.com/img.ext[/img] 插入代码 [code]程序代码[/code]  插入url链接 [url]http://url[/url] / [url=http://url]URL加下滑线[/url] 插入附件 插入word文档 Txt等文件
内容
  提交时自动拷贝以上内容到剪贴板 Ctrl-V可取出;提问题前先查询标签列表

RSS 手机阅读 add to google add to yahoo
解惑之道在J道 ,打造中国最具影响力的的企业软件社区 推荐Chrome快速浏览本站
OpenSource JIVEJDON v3.5 Powered by JdonFramework Code © 2002-09 jdon.com

anti spam