All Products
Search
Document Center

Performance Testing:Configure JDBC request parameters

Last Updated:Mar 10, 2026

When you need to performance-test database operations such as queries, inserts, updates, or deletes, use a JDBC API in Performance Testing (PTS) to send SQL statements directly to your database under simulated load. This topic describes how to set up the database connection, credentials, and SQL configuration for a JDBC test scenario.

PTS supports the following database types: MySQL, PostgreSQL, MariaDB, and SQL Server.

Prerequisites

Before you begin, make sure that you have:

  • Access to the PTS console

  • The endpoint, port, and database name for your target database instance

  • A database account with the permissions required by your SQL statements

Create a JDBC test scenario

  1. Log in to the PTS console.

  2. In the left-side navigation pane, choose Performance Test > Create Scenario, and then click PTS.

  3. Delete the default HTTP API and add a JDBC API.

  4. Configure the basic request parameters. For parameter descriptions, see the parameter table below.

    JDBC basic request configuration

    The following table describes the parameters.

    Parameter

    Description

    Example

    API Name

    A name that identifies the service definition of the API. Maximum length: 20 characters.

    API-1

    Database Type

    The type of database to connect to. Valid values: MySQL, PostgreSQL, MariaDB, and SQL Server.

    MySQL

    Database URL

    The database connection string in the format <host>:<port>/<database_name>. See Database URL format below.

    rm-bp1xxxxxxx.mysql.rds.aliyuncs.com:3306/mydb

    Username

    The username for database authentication.

    test_user

    Password

    The password for database authentication.

    your_password

    SQL

    The SQL statement to run. Must start with SELECT, UPDATE, INSERT, or DELETE (case-insensitive). See SQL statement guidelines below.

    select * from test_users;

    Timeout Duration

    The maximum time, in milliseconds, that PTS waits for a response from the database server.

    5000

    limit

    The maximum number of rows to read from the result set. Applies only to SELECT statements. Maximum value: 1,000,000.

    1000

Database URL format

The Database URL combines the host address, port number, and database name into a single connection string. Use the format for your database type:

Database typeDefault portExample URL
MySQL3306rm-bp1xxxxxxx.mysql.rds.aliyuncs.com:3306/mydb
PostgreSQL5432pgm-bp1xxxxxxx.pg.rds.aliyuncs.com:5432/mydb
MariaDB3306rm-bp1xxxxxxx.mariadb.rds.aliyuncs.com:3306/mydb
SQL Server1433rm-bp1xxxxxxx.sqlserver.rds.aliyuncs.com:1433/mydb

Replace the placeholders with your actual values:

PlaceholderDescriptionExample
<host>The endpoint or IP address of your database instancerm-bp1xxxxxxx.mysql.rds.aliyuncs.com
<port>The port number (use the default port or a custom port if configured)3306
<database_name>The name of the target databasemydb

Note: The port numbers shown above are defaults. If your database uses a custom port, replace the port number accordingly.

SQL statement guidelines

The SQL field accepts statements that begin with one of the following keywords (case-insensitive):

KeywordOperationExample
SELECTQuery dataselect * from test_users where status = 'active';
INSERTAdd recordsinsert into test_users (name, email) values ('test', 'test@example.com');
UPDATEModify recordsupdate test_users set email = 'new@example.com' where id = 1;
DELETERemove recordsdelete from test_users where id = 1;

Load testing considerations

  • Set the limit parameter for SELECT statements. Large result sets during load testing consume memory and can skew performance metrics. Set limit to a value appropriate for your test scenario.

  • Use realistic SQL statements. Write statements that reflect actual production queries, including WHERE clauses and joins, to get meaningful performance data.

  • Monitor timeout values. If your SQL statements involve large tables or heavy joins, increase the Timeout Duration to avoid false failures during load tests.