package com.shuyinghengxie.doudou;

import static org.junit.Assert.*;

import org.hibernate.SessionFactory;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.Configuration;
import org.hibernate.service.ServiceRegistry;
import org.junit.Test; public class TEST01 { //测试 Hibernate连接
@Test
public void test()
{
//获取配置文件
Configuration cfg = new Configuration().configure() ; //注册配置
ServiceRegistry sr = new StandardServiceRegistryBuilder().
applySettings(cfg.getProperties()).build(); //获取SessionFactory
SessionFactory sf = cfg.buildSessionFactory(sr) ; //System.out.println(sf); sf.close(); //关闭,释放资源
} }

最新文章

  1. Ubuntu jdk安装
  2. jqueyr获取动态创建的元素
  3. Mysql 排名查询
  4. paper 107:图像的白平衡
  5. Ubuntu Firefox installs Flashplayer
  6. angularJS directive详解
  7. win64位 apache2.4 php5.4 mysql5.6
  8. iOS开发 MVVM+RAC 的使用
  9. 查看centos系统位数和强制关闭yum
  10. 洛谷 P1494 [国家集训队] 小Z的袜子
  11. 帆软报表(finereport) 折叠树
  12. 16.ajax_case01
  13. annotation的概念及其作用
  14. 关于jQuery出现的新添加元素点击事件无效
  15. spring boot 在不同环境下读取不同配置文件的一种方式
  16. Python全栈-day11-函数3
  17. 存储过程参数CHAR传过来null导致超时.
  18. MVC输出字符串常用四个方式
  19. Ignite内存数据库与sql支持
  20. 【Python学习笔记】Jupyter Lab目录插件安装

热门文章

  1. Java应用程序的打包和发布
  2. 创建数据库和表的SQL语句【转】
  3. 关于undefined reference to `WSASocketA@24'问题的解决
  4. overflow的劲爆知识点
  5. shell中读写mysql数据库
  6. 深入理解GCD(一)
  7. Windows下打包Python的exe可执行文件
  8. string转换成color转
  9. Asp.net Vnext Routing
  10. [HTML]js实现页面跳转,页面A跳到另一个页面B.以及页面传值(中文)