1
votes

I want tо refer to two different databases in one sql server in my Test Plan.

I have one Thread Group and 20 steps/samplers, and I want for the first 4 samplers all queries to database to be connect to 'database1' for example and others from step 5 to step 20 all queries are refered to 'database2'.

When I add JDBC connection configuration and try to change dynamically just DatabaseName JMeter accepts the first filled databaseName. For example: If I filled first 'database1' as a name all my connections to databases are to this 'database1' independently from that I change the value of DatabaseName adding new value of the variable 'database'.

I use something like:

jdbc:sqlserver://something.database.windows.net;DatabaseName=${database}
1

1 Answers

0
votes

JDBC connection configuration is loaded once before test executed, as other JMeter's configurations

So you must have 2 JDBC connection configurations for each database with 2 different variable names

In JDBC request you can use different variable name when using different database pool names