• 大小: 6.51M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-27
  • 语言: Java
  • 标签: 数据库  Hibernate  

资源简介

hibernate连接数据库代码,精简,高效。

资源截图

代码片段和文件信息

package com.niu.sample.hibernate.dao;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.service.ServiceRegistryBuilder;


public class baseDao {
private static Log log = LogFactory.getLog(baseDao.class);
private static SessionFactory sessionFactory;
static{
try{
        Configuration cfg = new Configuration();  
        cfg.configure();  
          
ServiceRegistry sr = new ServiceRegistryBuilder().applySettings(
cfg.getProperties()).buildServiceRegistry();    
        s

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-11-13 08:49  hibernate4-anno-20150102\
     文件         558  2015-01-02 20:41  hibernate4-anno-20150102\.classpath
     文件        1076  2015-01-02 20:41  hibernate4-anno-20150102\.project
     目录           0  2015-11-13 08:49  hibernate4-anno-20150102\.settings\
     文件          57  2015-01-02 20:41  hibernate4-anno-20150102\.settings\org.eclipse.core.resources.prefs
     文件         330  2015-01-02 20:41  hibernate4-anno-20150102\.settings\org.eclipse.jdt.core.prefs
     文件         364  2015-01-02 20:41  hibernate4-anno-20150102\.settings\org.eclipse.jst.common.project.facet.core.prefs
     文件         602  2015-01-02 20:41  hibernate4-anno-20150102\.settings\org.eclipse.wst.common.component
     文件         269  2015-01-02 20:41  hibernate4-anno-20150102\.settings\org.eclipse.wst.common.project.facet.core.xml
     目录           0  2015-11-13 08:49  hibernate4-anno-20150102\WebContent\
     目录           0  2015-11-13 08:49  hibernate4-anno-20150102\WebContent\meta-INF\
     文件          39  2015-01-02 20:41  hibernate4-anno-20150102\WebContent\meta-INF\MANIFEST.MF
     目录           0  2015-11-13 08:49  hibernate4-anno-20150102\WebContent\WEB-INF\
     目录           0  2015-11-13 08:49  hibernate4-anno-20150102\WebContent\WEB-INF\lib\
     文件      445288  2015-01-02 20:41  hibernate4-anno-20150102\WebContent\WEB-INF\lib\antlr-2.7.7.jar
     文件       60686  2015-01-02 20:41  hibernate4-anno-20150102\WebContent\WEB-INF\lib\commons-logging-1.1.1.jar
     文件      313898  2015-01-02 20:41  hibernate4-anno-20150102\WebContent\WEB-INF\lib\dom4j-1.6.1.jar
     文件       81271  2015-01-02 20:41  hibernate4-anno-20150102\WebContent\WEB-INF\lib\hibernate-commons-annotations-4.0.1.Final.jar
     文件     4414476  2015-01-02 20:41  hibernate4-anno-20150102\WebContent\WEB-INF\lib\hibernate-core-4.1.4.Final.jar
     文件      477528  2015-01-02 20:41  hibernate4-anno-20150102\WebContent\WEB-INF\lib\hibernate-entitymanager-4.1.4.Final.jar
     文件      102661  2015-01-02 20:41  hibernate4-anno-20150102\WebContent\WEB-INF\lib\hibernate-jpa-2.0-api-1.0.1.Final.jar
     文件      714195  2015-01-02 20:41  hibernate4-anno-20150102\WebContent\WEB-INF\lib\javassist-3.18.1-GA.jar
     文件       57193  2015-01-02 20:41  hibernate4-anno-20150102\WebContent\WEB-INF\lib\jboss-logging-3.1.4.GA.jar
     文件       15071  2015-01-02 20:41  hibernate4-anno-20150102\WebContent\WEB-INF\lib\jta-1.1.jar
     文件      703265  2015-01-02 20:41  hibernate4-anno-20150102\WebContent\WEB-INF\lib\mysql-connector-java-5.1.6.jar
     文件       25496  2015-01-02 20:41  hibernate4-anno-20150102\WebContent\WEB-INF\lib\slf4j-api-1.6.1.jar
     文件        8869  2015-01-02 20:41  hibernate4-anno-20150102\WebContent\WEB-INF\lib\slf4j-log4j12-1.7.5.jar
     文件         287  2015-01-02 20:41  hibernate4-anno-20150102\WebContent\WEB-INF\web.xml
     目录           0  2015-11-13 08:49  hibernate4-anno-20150102\build\
     目录           0  2015-11-13 08:49  hibernate4-anno-20150102\build\classes\
     目录           0  2015-11-13 08:49  hibernate4-anno-20150102\build\classes\com\
............此处省略49个文件信息

评论

共有 条评论