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
Log in to the PTS console.
In the left-side navigation pane, choose Performance Test > Create Scenario, and then click PTS.
Delete the default HTTP API and add a JDBC API.
Configure the basic request parameters. For parameter descriptions, see the parameter table below.

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-1Database 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/mydbUsername
The username for database authentication.
test_userPassword
The password for database authentication.
your_passwordSQL
The SQL statement to run. Must start with
SELECT,UPDATE,INSERT, orDELETE(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.
5000limit
The maximum number of rows to read from the result set. Applies only to
SELECTstatements. 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 type | Default port | Example URL |
|---|---|---|
| MySQL | 3306 | rm-bp1xxxxxxx.mysql.rds.aliyuncs.com:3306/mydb |
| PostgreSQL | 5432 | pgm-bp1xxxxxxx.pg.rds.aliyuncs.com:5432/mydb |
| MariaDB | 3306 | rm-bp1xxxxxxx.mariadb.rds.aliyuncs.com:3306/mydb |
| SQL Server | 1433 | rm-bp1xxxxxxx.sqlserver.rds.aliyuncs.com:1433/mydb |
Replace the placeholders with your actual values:
| Placeholder | Description | Example |
|---|---|---|
<host> | The endpoint or IP address of your database instance | rm-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 database | mydb |
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):
| Keyword | Operation | Example |
|---|---|---|
SELECT | Query data | select * from test_users where status = 'active'; |
INSERT | Add records | insert into test_users (name, email) values ('test', 'test@example.com'); |
UPDATE | Modify records | update test_users set email = 'new@example.com' where id = 1; |
DELETE | Remove records | delete 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
WHEREclauses 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.