当前位置 : 主页 > 编程语言 > java >

Jmeter JDBC请求常见问题解决方案

来源:互联网 收集:自由互联 发布时间:2021-05-10
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

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

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持易盾网络。

网友评论