Article From:https://www.cnblogs.com/hao2018/p/9883554.html

Configuration of SQL Server

1、Download the SQL driver and place sqljdbc4.jar under the JMeter installation directory / lib.

2、Start JMeter, right-click add – & gt; configuration file – & gt; JDBC Connection Configuration.

3、Setting the JDBC Connection Configuration property

  (1)Variable Name:cnn,This value will be used in subsequent JDBC Request.

  (2)Database URL:jdbc:sqlserver://Database address: 1433; instanceName = instance name; databaseName = database name;

  (3)JDBC Driver class:com.microsoft.sqlserver.jdbc.SQLServerDriver  (SqlServerFixed writing method;

  (4)Username/Password:User name and password of database;

JDBC Connection ConfigurationThe configuration is as follows:

 

JDBC Request The configuration is as follows:

 Note: Variable Name in JDBC Request… should be consistent with Variable Name in DBC Connection Configuration….

Error checking:

1.Then the database name is wrong:

Response message: java.sql.SQLException: Cannot create PoolableConnectionFactory (Cannot open the database “T_Base_SU_Menu” requested for login. Login failed. Client Connection Id: 97692106-8056-40c9-a56d-eb572cd6da52)

2.Note that no JDBC driver was downloaded

 jmeter Cannot load JDBC driver class ‘com.microsoft.sqlserver.jdbc.SQLServer

3.Then it is necessary to enable TCP/IP&gt in SQL Server Configuration Manager SQL Server Network Configuration; Right-click Properties to select the corresponding IP address and fill in the TCP port of IPALL.1433 (sql default), restart service

Response message: java.sql.SQLException: Cannot create PoolableConnectionFactory (The TCP/IP connection to the host 127.0.0.1, port 1433 has failed. Error: “Connection refused: connect. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.”.)

Two.Configure My SQL

1、Download MySQL driver and place mysql-connector-java-5.1.35.jar under JMeter installation directory/lib.

2、Start JMeter, right-click add – & gt; configuration file – & gt; JDBC Connection Configuration.

3、Setting the JDBC Connection Configuration property

  (1)Variable Name:cnn,This value will be used in subsequent JDBC Request.

  (2)Database URL:jdbc:mysql://Database address: port/database name;

  (3)JDBC Driver class:com.mysql.jdbc.Driver  (mysqlFixed writing method;

  (4)Username/Password:User name and password of database;

JDBC Connection ConfigurationThe configuration is as follows:

 

JDBC Request The configuration is as follows:

 Note: Variable Name in JDBC Request… should be consistent with Variable Name in DBC Connection Configuration….

 

Three.Configure ORACLE (reference address https://blog.csdn.net/scorpio_tester/article/details/42167919)

1、Download the Oracle driver and put ojdbc6.jar under the JMeter installation directory / lib.

2、Start JMeter, right-click add – & gt; configuration file – & gt; JDBC Connection Configuration.

3、Setting the JDBC Connection Configuration property

  (1)Variable Name:cnn,This value will be used in subsequent JDBC Request.

  (2)Database URL:jdbc:oracle:thin:@Database IP: 1521: database ID;

  (3)JDBC Driver class:oracle.jdbc.OracleDriver;

  (4)Username/Password:User name and password of database;

JDBC Connection ConfigurationThe configuration is as follows:

JDBC Request The configuration is as follows:

 

 Note: Variable Name in JDBC Request… should be consistent with Variable Name in DBC Connection Configuration….

If you need to insert data, and then after inserting data, the database has scrambled code, then you need to re-database URL: address? UseUnicode = true & amp; characterEncoding = utf8 & amp; allow;MultiQueries=true

 

Leave a Reply

Your email address will not be published. Required fields are marked *