spring+jpa+HiKariCP+P6spy SSH HiKariCP P6spy
阅读原文时间:2023年07月13日阅读:1

=============p6spy准备https://www.cnblogs.com/qgc88=====================

1.简单介绍p6spy,p6spy是一个开源项目,通常使用它来跟踪数据库操作,查看程序运行过程中执行的sql语句。
2.把p6spy-3.8.1 jar包都添加到lib目录,其它jar不需要(本人在下载:https://search.maven.org/remotecontent?filepath=p6spy/p6spy/3.8.1/p6spy-3.8.1.zip)
3.把spy.properties文件拷贝到资源文件复制到src目录下
4.修改spy.properties里面的属性
driverlist=com.mysql.jdbc.Driver
appender=com.p6spy.engine.spy.appender.StdoutLogger
5.修改驱动信息:
修改之前为:
#db.driverClass=com.mysql.jdbc.Driver
db.url=jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8
修改之后为:
db.driverClass=com.p6spy.engine.spy.P6SpyDriver
db.url=jdbc:p6spy:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8

=============HikariCP连接池准备https://www.cnblogs.com/qgc88=====================

1.把HikariCP jar包都添加到lib目录

=============Spring关键配置部分代码=====================


http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd" default-autowire="byName" default-lazy-init="true">
















**提示:本人经过对比,用_p6spy工具,感觉相对仅仅使用HiKariCP查询的效率会稍微慢些 ^ ^  https://www.cnblogs.com/qgc88_**

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章