9(九)Jmeter如何连接数据库

下载安装插件

mysql-connector-java-5.1.44

链接:https://pan.baidu.com/s/1aLO7R8nW_Q-1NCC1jp9gIA

提取码:v130

添加组件

添加组件JDBC Connection Configuration(用于连接数据库)

添加组件JDBC Request(用于填写sql和配置参数)

JDBC Connection Configuration相关配置

重要参数说明:

Variable Name for created pool 数据库连接池的名称,我们可以有多个jdbc connection configuration,每个可以起个不同的名称,在jdbc request中可以通过这个名称选择合适的连接池进行使用。

Max Number of Connections 该数据库连接池的最大连接数,一般可设置为0,意思是每个线程都使用单独的数据库连接,线程之间数据库连接不共享

中文:池中允许的最大连接数。在大多数情况下,将其设置为0,这意味着每个线程将得到它自己的池,其中只有一个连接,即线程之间不共享连接。如果您真的想要使用共享池(为什么?),那么将max count与线程数相同,以确保线程不会相互等待。

原文:aximum number of connections allowed in the pool. In most cases, set this to zero (0) . This means that each thread will get its own pool with a single connection in it, i.e. the connections are not shared between threads. If you really want to use shared pooling (why?), then set the max count to the same as the number of threads to ensure threads don't wait on each other.

Max Wait (ms) 在连接池中取回连接最大等待时间

中文:如果在试图检索连接过程中(取回连接)超过所设置期限,连接池抛出一个错误

原文:ool throws an error if the timeout period is exceeded in the process of trying to retrieve a connection

Time Between Eviction Runs (ms) 疏散时间

中文:在空闲对象驱逐线程运行期间,可以休眠的毫秒数。当非正值时,将运行无空闲对象驱逐器线程。(默认为"60000",1分钟)(如果当前连接池中某个连接在空闲了time Between Eviction Runs Millis时间后任然没有使用,则被物理性的关闭掉。)

原文:The number of milliseconds to sleep between runs of the idle object evictor thread. When non-positive, no idle object evictor thread will be run. (Defaults to " 60000 ", 1 minute)

Auto Commit 自动提交sql语句

中文:打开或关闭连接的自动提交。

原文:Turn auto commit on or off for the connections.

相关推荐
李兆龙的博客8 小时前
问津集 #26:Lakebase——Postgres 的版本化页面存储、数据库分支与计算弹性
数据库
倔强的石头_10 小时前
聊聊金仓KFS:一款把数据同步软件做扎实的产品
数据库
闲云野鹤在人间10 小时前
MySQL|从理论、安装、备份到主从复制、MHA高可用详解
linux·运维·数据库·mysql·云计算
禾小西10 小时前
Redis:从两大维度和三大主线建立知识体系
数据库·redis·缓存
禾小西11 小时前
Redis 数据结构:快速的 Redis 有哪些慢操作?
数据结构·数据库·redis
数据库小学妹11 小时前
数据共享交换平台选型:交换方式对比与避坑指南
数据库·信创·数据同步·数据交换平台·政务数据共享·数据共享交换平台·数据库底座
loong_XL13 小时前
决策模型做内容安全检测:从踩坑到上线
数据库·安全·jev·决策模型
这个DBA有点耶13 小时前
数据库双轨并行实战:全量并行策略、增量延迟控制、双向回切与一致性校验
数据库·架构·dba
adinnet202614 小时前
保单、赔付与渠道问数:保险经营数据如何实现按需查询
大数据·数据库·人工智能
云贝贝贝14 小时前
PostgreSQL 分区表:从设计到运维,大表不再卡
运维·数据库·postgresql