JMeter Testing the database (MySQL database)

Source: Internet
Author: User

    1. To establish a JDBC Link: Create a jdbc Connection Configuration.
    • Add--Configure components--JDBC Connection configuration:
    • Configure the JDBC Connection configuration:

Description

1) Variable Name: The name of the database connection pool, which is important, required, andis used in theJDBC Request .

2) Maxnumber of Connections: Max connections

3) Pool timeout: Maximum time for database connection pool timeout

4) Idle Cleanup Interval (ms): How long interval, clear idle (idle connection)

5) keep-alive: Pool activity exists

6) Max Connection Age (MS): Time of the most active connection pool

7) Validationquery: Dynamic queries

8) JDBC Driver class:jdbc driver, because I am using a MySQL database, so this is configured as Com.mysql.jdbc.Driver. If other, refer to other materials.

2. Test database: JDBC request test

    • Add--SAMPLER--JDBA Request:
    • Configure JDBA Request:

Description

1) Variable name: Same as Variable name in the JDBC Connection configuration above, this indicates that the JDBC Connection configuration establishes a connection pool named Oracle. This connection pool is then shared by other JDBC Request.

2) SQL Query:sql statement, cannot add ";".

3) Parameter values: parameter values, which can be used in SQL query statements with the "?" Instead , make a query.

Such as

4) Parameter types: Parameter type, refer to: Javadoc for Java.sql.Types

5) Variable names: Save the variable name of the SQL statement that returns the result (similar to the row, column, multi-column, multi-parameter) of the returned result table, you can create a debug sampler run to see the data.

As above with a A, a: query results are 1 columns of 3 rows of data,

6) Result variable name: Create an object variable, save all returned results, can create debug sampler run look at the data

As above with Titlenm_result:

7) Query timeout: Query time-out

8) Handle result set: Defines how to handle the results returned by the callable statements statement

3. Execution error Java.sql.SQLException:No suitable driver found for JDBC:

    • check that the database URL is correct.
    • Check that the JDBC Driver class input is correct.
    • Check to see if there are any corresponding jar packages under the Apache-jmeter-2.13\lib\ext path, for example, I use mysql-connector-java-5.1.38-bin.jar like this.

JMeter Testing the database (MySQL database)

Related Article

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.