当前位置:网站首页>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 .
边栏推荐
- Have you stepped on the nine common pits in the e-commerce system?
- R语言ggplot2可视化:可视化折线图、使用labs函数为折线图添加自定义的X轴标签信息
- 云呐|为什么要用固定资产管理系统,怎么启用固定资产管理系统
- Masa framework - DDD design (1)
- How to play when you travel to Bangkok for the first time? Please keep this money saving strategy
- Tutorial (5.0) 10 Troubleshooting * fortiedr * Fortinet network security expert NSE 5
- C file input operation
- 消息队列消息丢失和消息重复发送的处理策略
- Golang并发编程——goroutine、channel、sync
- 移动机器人路径规划:人工势场法[通俗易懂]
猜你喜欢

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

Tutorial (5.0) 09 Restful API * fortiedr * Fortinet network security expert NSE 5

Web2.0的巨头纷纷布局VC,Tiger DAO VC或成抵达Web3捷径

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

In pytorch function__ call__ And forward functions

Stm32g0 USB DFU upgrade verification error -2

教程篇(5.0) 09. RESTful API * FortiEDR * Fortinet 网络安全专家 NSE 5

论文导读 | 机器学习在数据库基数估计中的应用

全链路数字化转型下,零售企业如何打开第二增长曲线

Imitation Jingdong magnifying glass effect (pink teacher version)
随机推荐
metric_logger小解
Introduction to the paper | application of machine learning in database cardinality estimation
Codeworks 5 questions per day (1700 average) - day 4
MySQL advanced learning summary 7: MySQL data structure - Comparison of hash index, AVL tree, B tree and b+ tree
预处理和预处理宏
电脑使用哪个录制视频软件比较好
[100 cases of JVM tuning practice] 02 - five cases of virtual machine stack and local method stack tuning
Thread application instance
机器学习笔记 - 时间序列预测研究:法国香槟的月销量
R语言ggplot2可视化分面图(facet):gganimate包基于transition_time函数创建动态散点图动画(gif)
In pytorch function__ call__ And forward functions
Mysql高级篇学习总结6:索引的概念及理解、B+树产生过程详解、MyISAM与InnoDB的对比
Qpropertyanimation use and toast case list in QT
NPOI导出Excel2007
虚拟机初始化脚本, 虚拟机相互免秘钥
Crypto usage in nodejs
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
2022.7.1-----leetcode.241
R语言使用epiDisplay包的lsNoFunction函数列出当前空间中的所有对象、除了用户自定义的函数对象
Web2.0的巨头纷纷布局VC,Tiger DAO VC或成抵达Web3捷径