文章分类 -  Hibernate

摘要:1、 导入jar包 1) struts2 的 jar 2) hibernate 的 jar 3) spring 的 jar 4) 数据库的 jar 5)strust2 和 spring 整合的 jar 整合ssh项目所需jar:共39个 注意:查看有没有重复的jar,如有,删除低版本,留高版本 3) 阅读全文
posted @ 2018-07-07 22:39 莯汐 阅读(69) 评论(0) 推荐(0)
摘要:1、 直接使用SessionFactory 1.1、 导入相关jar包 1.2、 编写配置文件 1.3、 dao实现 2、使用HibernateTemplate 2.1、编写配置文件 2.2、dao实现 3、 使用HibernateDaoSupport 3.1、编写配置文件 3.2、dao实现 阅读全文
posted @ 2018-07-01 22:24 莯汐 阅读(64) 评论(0) 推荐(0)
摘要:ibernate_log&配置文件详解 1、 log 确定要使用日志的实现——log4j 编写log4j.propertiesa 2、 hibernate.cfg.xml讲解 <hibernate-configuration> <session-factory> <!-- 配置数据库连接信息 --> 阅读全文
posted @ 2018-06-29 22:13 莯汐 阅读(203) 评论(0) 推荐(0)
摘要:Hibernate详解 1、 Configuration管理读取配置文件 // 1、新建Configuration对象 Configuration cfg = new Configuration().configure(); // 读取src下hibernate.properties,不推荐使用 / 阅读全文
posted @ 2018-06-29 21:55 莯汐 阅读(108) 评论(0) 推荐(0)
摘要:搭建hibernate环境 1、新建java项目 2、导入相关jar包 2.1路径 2.1路径 2.2添加进项目 2.2添加进项目 3、编写配置文件hibernate.cfg.xml 3.1 复制hibernate资源中的hibernate.cfg.xml,路径为 3.1 复制hibernate资源 阅读全文
posted @ 2018-06-29 21:44 莯汐 阅读(69) 评论(0) 推荐(0)