当前位置:网站首页>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 .
边栏推荐
- Machine learning notes - time series prediction research: monthly sales of French champagne
- [论文阅读] CA-Net: Leveraging Contextual Features for Lung Cancer Prediction
- 【测试开发】软件测试—概念篇
- 虚拟机初始化脚本, 虚拟机相互免秘钥
- Compile oglpg-9th-edition source code with clion
- Tutoriel (5.0) 10. Dépannage * fortiedr * fortinet Network Security expert NSE 5
- Tutorial (5.0) 10 Troubleshooting * fortiedr * Fortinet network security expert NSE 5
- Talk about the design of red envelope activities in e-commerce system
- Masa framework - DDD design (1)
- [daily question] first day
猜你喜欢
全志A33使用主线U-Boot
Yunna | why use the fixed asset management system and how to enable it
[0701] [论文阅读] Alleviating Data Imbalance Issue with Perturbed Input During Inference
消息队列消息丢失和消息重复发送的处理策略
Excel如何进行隔行复制粘贴
[100 cases of JVM tuning practice] 02 - five cases of virtual machine stack and local method stack tuning
STM32G0 USB DFU 升级校验出错-2
MySQL advanced learning summary 8: overview of InnoDB data storage structure page, internal structure of page, row format
Obligatoire pour les débutants, cliquez sur deux boutons pour passer à un contenu différent
电商系统中常见的 9 大坑,你踩过没?
随机推荐
Yolov3 trains its own data set to generate train txt
Crypto usage in nodejs
Golang concurrent programming goroutine, channel, sync
线程应用实例
R language uses Cox of epidisplay package Display function obtains the summary statistical information of Cox regression model (risk rate HR, adjusted risk rate and its confidence interval, P value of
Excel查找一列中的相同值,删除该行或替换为空值
消息队列消息丢失和消息重复发送的处理策略
Markdown基础语法
使用 Cheat Engine 修改 Kingdom Rush 中的金钱、生命、星
R language dplyr package filter function filters dataframe data. If the name of the data column (variable) to be filtered contains quotation marks, you need to use!! SYM syntax processing, otherwise n
Processing strategy of message queue message loss and repeated message sending
聊聊电商系统中红包活动设计
ICDE 2023|TKDE Poster Session(CFP)
MySQL advanced learning summary 8: overview of InnoDB data storage structure page, internal structure of page, row format
Excel finds the same value in a column, deletes the row or replaces it with a blank value
M2dgr: slam data set of multi-source and multi scene ground robot (ICRA 2022)
移动机器人路径规划:人工势场法[通俗易懂]
STM32G0 USB DFU 升级校验出错-2
How to copy and paste interlaced in Excel
"Patient's family, please come here" reading notes