jmeter之JDBC请求遇到的问题

1、 时区设置问题

Cannot create PoolableConnectionFactory (The server time zone value '???��������??��??' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.)

解决方案:时区的问题,设置成全球标准时间。修改JDBC Connection Configuration配置中的Database URL,在其末尾加上?serverTimezone=UTC

2、Jmeter中使用JDBC向数据库插入中文数据乱码问题

解决方案:修改了JDBC的配置,在Database URL中增加了编码格式,具体为:jdbc:mysql://<server ip>:3306/student?characterEncoding=UTF-8

3、多行查询语句

修改了JDBC的配置,在Database URL中增加了编码格式,具体为:jdbc:mysql://<server ip>:3306/student ?allowMultiQueries=true

 

  

4、请求数据中的中文显示乱码

是因为插入数据的字符串格式的数据没有加引号,如图

 

 

 在SQL语句中给对应的字符串添加引号

5、执行jdbc请求时,报错:Zero data value prohioited

在配置中添加?zeroDateTimeBehavior=CONVERT_TO_NULL

如果是下图中的报错,则设置为 ?zeroDateTimeBehavior=convertToNull

原文地址:https://www.cnblogs.com/jane4321/p/11546797.html