Jmeter JDBC Connection

Source: Internet
Author: User

1.jmeter connect the database, first add the database corresponding connection driver under the test plan

2. After creating the thread group, create the JDBC Connection configuration under the new thread group

3. Configuring JDBC Connection configuration information

Configuration resolution for JDBC

1) ORACLE

  

URL Link:

Jdbc:oracle:thin:@host:p ort/Service

JDBC Driver Class

Oracle.jdbc.driver.OracleDriver

Oracle Query Database encoding

Select *  from where = ' Nls_characterset ';

Validation Query

2) MYSQL

URL Link:

Jdbc:mysql://host:port/service?characterencoding=utf8&allowmultiqueries=true
Jdbc:mysql://host:port/service?useunicode=true&characterencoding=utf8&allowmultiqueries=true
USEunicode=true&characterencoding=utf8 adds the function of specifying the encoding and decoding format of the character. 

For example: The MySQL database uses GBK encoding, and the project database uses UTF-8 encoding. If Useunicode=true&characterencoding=utf-8 is added at this time, then there are two aspects of the function:

1. When the data is stored: When the database is holding the project data, the data will be decoded into bytecode using UTF-8 format, and then the decoded bytecode will be re-used GBK encoded into the database.

2. When fetching data: when fetching data from the database, the database will first decode the data in the database into bytecode according to GBK format, then encode the decoded bytecode again in UTF-8 format, and then return the data to the client.

Allowmultiqueries=true Additions are: Allow batch Updates

JDBC Driver Class

Com.mysql.jdbc.Driver

3) MSSQL

JDBC Connection

Jdbc:sqlserver://IP:port;d atabasename=DBname (semicolon separated, MySQL is/); or Jdbc:jtds: SQL Server://localhost:port/"+" library "

Driven

Com.microsoft.sqlserver.jdbc.SQLServerDriver or Net.sourceforge.jtds.jdbc.Driver

4) PostgreSQL

JDBC Connection

Jbdc:postgresql://ip:port/database_name

Driven

  Org.postgresql.Driver

3. Create a JDBC Request

Variable name: Names of the corresponding database configurations

Query type: Set the types of queries, allow query, update, all, bring in parameters, etc.

Query: Where to write SQL

Note: "--" or "--"

Note You cannot add ";" after the SQL statement of Oracle during execution.

Jmeter JDBC Connection

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.