当前位置:网站首页>Advanced performance test series "24. Execute SQL script through JDBC"
Advanced performance test series "24. Execute SQL script through JDBC"
2022-07-02 19:17:00 【Game programming】
Catalog
- One 、
JDBC(JavaDataBaseConnectivity)1.jdbc:java Call the database's .2. How to find jar package ?3.mysql edition 8 And mysql edition 5.7 Of jar Is there any difference in the package ? Two 、 Write the script 1. Add configuration components --
JDBC Connection Configuration.2.jdbc request3、 ... and 、 Be careful
One 、 JDBC(JavaDataBaseConnectivity) :
It's one for execution SQL Of the statement
JAVA API.Through this api Can be executed directly sql Script .
1.jdbc:java Call the database's .
When calling the database , Need to use jar package (jar Bag is java The low-level call class that the language has written ), Fill in the information of the database .
jmeter Yes, it is java Developed , Can be executed directly java Code .
2. How to find jar package ?
The database version of a project is mysql5.7, So choose a version number greater than 5.7 Of jar A bag will do .
Access the service maven Warehouse address : https://mvnrepository.com/ , Then search the database .
Find the version you need , Click on the version . Files--jar , Download this jar package .

here , Download it locally .
Download the jar package , Put it in jmeter Of lib In the folder .

restart jmeter, here , You can write jdbc Request the .
To have this jar After the package ,jmeter Can initiate jdbc request , Without this jar package , There's this one, too jdbc Sampler , however , Cannot initiate request .
jar Bao is a third party library .
3.mysql edition 8 And mysql edition 5.7 Of jar Is there any difference in the package ?
Now in the enterprise , With mysql database , It's usually mysql5.7 The above version and mysql8.
mysql5.7 Version and mysql5.7 The performance of previous versions is different .
mysql5 Version of : You can choose a database version greater than or equal to yours Arbitrarily jar package .
mysql8 edition : Choose a database version number that is greater than or equal to yours , General situation , Select the same version number jar package .
mysql8 And mysql5 The driver class Dissimilarity .
Two 、 Write the script
1. Add configuration components -- JDBC Connection Configuration .
Fill in the database : ip 、 port 、 dbname 、 user 、 password 、 pool 、 Character set 、 Drive class ......variable name for created pool : Customize a thread pool variable name .
Variable name naming rules : Letter 、 Numbers 、 Underline . Cannot start with a number .database Connection Configuration Database connection configuration .database URL : Fill in the database ip、 port 、dbname. however , Different databases URL The address is written differently .
mysql Of url Address :jdbc:mysql://serverip:port/dbname .

mysql Database default port :3306, The database port of a project is :3337.jdbc driver class : Different databases , This drive class Dissimilarity .
mysql5 The driver class( It's optional ): com.mysql.jdbc.Driver . Only applicable to mysql5 edition .
mysql8 The driver class( It's handwritten ): com.mysql.cj.jdbc.Driver . compatible mysql5 edition .

2.jdbc request
Connection pool : Be sure to make contact with JDBC Connection Configuration The connection pool names configured in should be consistent .

sql query:
select \* from cb_account limit 10


Running results View the result tree in the process of receiving data , Is to consume resources , Rendering also consumes resources . Large amount of data , It will take longer .
When you really do performance testing , You can do without a monitor .
Script link :
link :https://pan.baidu.com/s/1yb1Y-HeVG7QQboL5eeQkRQ?pwd=1234 Extraction code :1234
3、 ... and 、 Be careful

One by one s It's a variable , count() It can follow the value , Not with variables . therefore , count() You can write any value .

chart 1:count("A"), The successful running .

chart 2:count(99), The successful running .

chart 3:count(s)

chart 3: Run failed .
In the article, except for “ Picture from the Internet ” Pictures of the , All are screenshots drawn by Xiaobian himself , Computer knowledge is the same , any similarity , Purely coincidental . The article was written by Qing Han , If reproduced , Please indicate the source !
Welcome to your attention “ QingHan software testing ”, Group addition v:qhtester, remarks : School ( Company name )+ full name ( nickname ), Otherwise, it will not pass , Thanks for liking and sharing !
author : QingHan software testing
Game programming , A game development favorite ~
If the picture is not displayed for a long time , Please use Chrome Kernel browser .
边栏推荐
- SIFT特征点提取「建议收藏」
- How to play when you travel to Bangkok for the first time? Please keep this money saving strategy
- 2022 compilation principle final examination recall Edition
- [fluent] dart data type (VaR data type | object data type)
- Golang并发编程——goroutine、channel、sync
- In pytorch function__ call__ And forward functions
- 使用 Cheat Engine 修改 Kingdom Rush 中的金钱、生命、星
- [100 cases of JVM tuning practice] 02 - five cases of virtual machine stack and local method stack tuning
- R language dplyr package Na_ The if function converts the control in the vector value into the missing value Na, and converts the specified content into the missing value Na according to the mapping r
- [100 cases of JVM tuning practice] 01 - introduction of JVM and program counter
猜你喜欢
![[daily question] first day](/img/8c/f25cddb6ca86d44538c976fae13c6e.png)
[daily question] first day

【JVM调优实战100例】03——JVM堆调优四例

思维意识转变是施工企业数字化转型成败的关键
![[test development] software testing - concept](/img/24/9ee885d46f7200ae7449957ca96b9d.png)
[test development] software testing - concept

潇洒郎:彻底解决Markdown图片问题——无需上传图片——无需网络——转发给他人图片无缺失
![[100 cases of JVM tuning practice] 02 - five cases of virtual machine stack and local method stack tuning](/img/59/6c776e0607a52962b72fbea2e64c8e.png)
[100 cases of JVM tuning practice] 02 - five cases of virtual machine stack and local method stack tuning

UML class diagram

教程篇(5.0) 10. 故障排除 * FortiEDR * Fortinet 网络安全专家 NSE 5

According to the atlas of data security products and services issued by the China Academy of information technology, meichuang technology has achieved full coverage of four major sectors

STM32G0 USB DFU 升级校验出错-2
随机推荐
使用xml文件打印mybaties-log插件的方式
What is 9D movie like? (+ common sense of dimension space)
教程篇(5.0) 10. 故障排除 * FortiEDR * Fortinet 網絡安全專家 NSE 5
Yolov3 trains its own data set to generate train txt
Web2.0的巨头纷纷布局VC,Tiger DAO VC或成抵达Web3捷径
LightGroupButton* sender = static_ cast<LightGroupButton*>(QObject::sender());
Mysql高级篇学习总结7:Mysql数据结构-Hash索引、AVL树、B树、B+树的对比
Reduce -- traverse element calculation. The specific calculation formula needs to be passed in and combined with BigDecimal
C的内存管理
R language uses the lsnofunction function function of epidisplay package to list all objects in the current space, except user-defined function objects
新手必看,點擊兩個按鈕切換至不同的內容
从list转化成map的时候,如果根据某一属性可能会导致key重复而异常,可以设置处理这种重复的方式
FastDFS安装
According to the atlas of data security products and services issued by the China Academy of information technology, meichuang technology has achieved full coverage of four major sectors
教程篇(5.0) 10. 故障排除 * FortiEDR * Fortinet 网络安全专家 NSE 5
Web2.0的巨头纷纷布局VC,Tiger DAO VC或成抵达Web3捷径
Markdown基础语法
How to play when you travel to Bangkok for the first time? Please keep this money saving strategy
[100 cases of JVM tuning practice] 01 - introduction of JVM and program counter
【测试开发】一文带你了解什么是软件测试