网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 生活知识 知识问答

hibernate 配置log4j

时间:2026-02-26 16:56:10

1、在已经下载好hibernate-distribution-3.3.2.GA.jar,slf4j-1.5.8.jar两个jar包的前提下,下载apache-log4j-1.2.17.jar

hibernate 配置log4j

hibernate 配置log4j

hibernate 配置log4j

2、打开myEcpllise/ecplise,新建一个java project,命名为AProjectForHibernate

hibernate 配置log4j

3、选中项目,点击右键,选择build path,点击add libernary

hibernate 配置log4j

4、增加hibernate需要的jar包(此处加载的是annotation注解方式所需要的)

hibernate 配置log4j

hibernate 配置log4j

hibernate 配置log4j

hibernate 配置log4j

5、增加【log4j-1.2.17.jar】,【slf4j-log4j12-1.5.8.jar】

hibernate 配置log4j

hibernate 配置log4j

6、在程序根目录中增加log4j.properties,可从【hibernate-distribution-3.3.2.GA\project\etc】中拷贝

hibernate 配置log4j

7、将log4j.properties中一些暂时不需要的注释掉

hibernate 配置log4j

8、总共的jar包需要12个(不包括数据库连接所使用的)

hibernate 配置log4j

© 2026 智德知识库
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com