当前位置:网站首页>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 .
边栏推荐
- Fastdfs installation
- When converting from list to map, if a certain attribute may cause key duplication and exceptions, you can set the way to deal with this duplication
- Memory management of C
- 9D电影是怎样的?(+维度空间常识)
- R语言ggplot2可视化分面图(facet):gganimate包基于transition_time函数创建动态散点图动画(gif)
- [paper reading] Ca net: leveraging contextual features for lung cancer prediction
- Progress-进度条
- Excel如何进行隔行复制粘贴
- Introduction to the paper | application of machine learning in database cardinality estimation
- Crypto usage in nodejs
猜你喜欢

电商系统中常见的 9 大坑,你踩过没?

Juypter notebook modify the default open folder and default browser

为什么要做企业固定资产管理系统,企业如何加强固定资产管理

PHP-Parser羽毛球预约小程序开发require线上系统

Kubernetes three open interfaces first sight

Yolov3 trains its own data set to generate train txt

开发固定资产管理系统,开发固定资产管理系统用什么语音

数据降维——主成分分析

全志A33使用主线U-Boot

Excel查找一列中的相同值,删除该行或替换为空值
随机推荐
新手必看,点击两个按钮切换至不同的内容
What is 9D movie like? (+ common sense of dimension space)
Excel finds the same value in a column, deletes the row or replaces it with a blank value
聊聊电商系统中红包活动设计
Learn the knowledge points of eight part essay ~ ~ 1
Markdown基础语法
Crypto usage in nodejs
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
【ERP软件】ERP体系二次开发有哪些危险?
R language ggplot2 visualization: visualize the line chart and add customized X-axis label information to the line chart using labs function
Use cheat engine to modify money, life and stars in Kingdom rush
PHP-Parser羽毛球预约小程序开发require线上系统
Novice must see, click two buttons to switch to different content
UML class diagram
How performance testing creates business value
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
R语言ggplot2可视化:gganimate包创建动态柱状图动画(gif)、使用transition_states函数在动画中沿给定维度逐步显示柱状图
Introduction to the paper | analysis and criticism of using the pre training language model as a knowledge base
R语言dplyr包rowwise函数、mutate函数计算dataframe数据中多个数据列在每行的最大值、并生成行最大值对应的数据列(row maximum)
使用CLion编译OGLPG-9th-Edition源码