黑马程序员:采用p6spy完整显示hibernate的SQL语句

本文详细介绍如何配置和使用P6Spy工具来监控MySQL数据库的日志记录。通过具体步骤指导如何将P6Spy集成到项目中,并调整相关设置以实现数据库操作的跟踪。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

[align=center]------- [url=http://edu.youkuaiyun.com/heima]android培训 [/url]、[url=http://edu.youkuaiyun.com/heima]java培训[/url]、期待与您交流!------- [/align]

一、下载 p6spy-install包 官网:[url]http://www.p6spy.com/[/url]
拷贝 p6spy.jar 到 WEB-INF\lib\
spy.properties 到 WEB-INF\classes\

二、修改 spy.properties 文件 (我用mysql驱动):
指定 数据库驱动:realdriver=com.mysql.jdbc.Driver
指定 日志记录文件位置:logfile=c:/spy.log

三、修改 hibernate.xml 文件:
修改connection.driver_class 为 com.p6spy.engine.spy.P6SpyDriver

四、完成


http://blog.youkuaiyun.com/alphahinex/article/details/5357716
http://hooabc.i.sohu.com/blog/view/166099303.htm
[align=center]------- [url=http://edu.youkuaiyun.com/heima]android培训 [/url]、[url=http://edu.youkuaiyun.com/heima]java培训[/url]、期待与您交流!------- [/align]

[align=center]详细请查看:[url=http://edu.youkuaiyun.com/heima]http://edu.youkuaiyun.com/heima [/url]------- [/align]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值