Jmeter工具学习(五)--JDBC Request执行多条SQL语句

 最近在工作中使用Jmeter工具运行多条sql语句,运行失败,sql报错。作者事后整理记录下来,方便以后查看。

报错信息如下:

 

 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select * from table;'

1、添加JDBC Connection Configuration并配置

Database URL为MySQL的连接串,如果要执行多条SQL语句,后面还要添加“?allowMultiQueries=true

JDBC Driver Class是本机的jdbc驱动路径。Mysql数据库,默认com.mysql.jdbc.Driver,不同数据库有不同默认值

 

2、添加一个JDBC Request并配置

如果要执行多条SQL语句,Quer Type一定要选择 Callable statement,使用Callable statement时,一次可以包含多个SQL,每条SQL语句用“隔开

 

 

3、运行jmeter,查看结果(如下图)

 

 ——————————————————————————————————————————-

参考地址:https://blog.csdn.net/qq_36502272/article/details/105457235

 

 

 

posted @ 2020-06-08 20:55  菖蒲依依  阅读(1851)  评论(2编辑  收藏  举报