JMeter JDBC Request for common script development

Source: Internet
Author: User

Simple explanation: The JDBC request is to use JMeter to connect to the database, execute the SQL statement, and return the corresponding response result

Steps:

1, the introduction of the use of the database drive jar package, using a different database, we need to introduce a different jar package. This article uses the MySQL, introduced Mysql-connector-java-3.0.17-ga-bin.jar

Introduction method: Directly copy the jar package to JMeter's Lib\ext directory

2. Create a test plan, add a database configuration component, configure database connection information,

JDBC Driver class, different database filling methods, you can refer to the following table

Datebase

Driver class

Database URL

Mysql

Com.mysql.jdbc.Driver

Jdbc:mysql://host:port/{dbname}

PostgreSQL

Org.postgresql.Driver

Jdbc:postgresql:{dbname}

Oracle

Oracle.jdbc.driver.OracleDriver

Jdbc:oracle:thin:user/[email Protected]//host:port/service

Ingres (2006)

Ingres.jdbc.IngresDriver

Jdbc:ingres://host:port/db[;attr=value]

MSSQL

Com.microsoft.sqlserver.jdbc.SQLServerDriver

Or

Net.sourceforge.jtds.jdbc.Driver

Jdbc:sqlserver://ip:1433;databasename=dbname

Or

jdbc:jtds:sqlserver://localhost:1433/"+" library "

3. Then add the JDBC request, write the SQL statement to query

Execution results

Extensions: Query parameters can use placeholders and parameterization

JMeter JDBC Request for common script development

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.