public class JdbcJmeterDsl extends Object
| Modifier and Type | Method and Description |
|---|---|
static DslJdbcConnectionPool |
jdbcConnectionPool(String name,
Class<? extends Driver> driverClass,
String url)
Builds a JDBC connection pool which is used by other test elements to interact with a
database.
|
static DslJdbcSampler |
jdbcSampler(String poolName,
String query)
Builds a JDBC sampler which allows interacting with a database (sending queries) through JDBC.
|
static DslJdbcSampler |
jdbcSampler(String name,
String poolName,
String query)
Is the same as
jdbcSampler(String, String) but allowing to set a name to the sampler
for easy identification in collected statistics and metrics. |
public static DslJdbcConnectionPool jdbcConnectionPool(String name, Class<? extends Driver> driverClass, String url)
name - is the name assigned to the pool, and used by other test elements to use the
configured pool. This name should be unique for the pool, and is directly
tied to a JMeter thread variabledriverClass - specifies the JDBC Driver class, specific for the particular database to
connect to. To specify a proper value, you will need to add the JDBC
implementation jar library for the specific database in the classpath (as
project test dependency).url - the connection string used to connect to the database through the JDBC
driver. This URL could include additional connection properties that may be
required for the database (for example, specifying a default encoding).DslJdbcConnectionPoolpublic static DslJdbcSampler jdbcSampler(String poolName, String query)
poolName - is a name of a previously defined jdbcConnectionPool(String, Class,
String), and specifies which connection pool to use to interact with the
database.query - specifies the query string (it might be a prepared statement string) to send to
the database. You can pass null value when using DslJdbcSampler.autoCommit(boolean), DslJdbcSampler.commit() and DslJdbcSampler.rollback() methods.jdbcConnectionPool(String, Class, String),
DslJdbcSamplerpublic static DslJdbcSampler jdbcSampler(String name, String poolName, String query)
jdbcSampler(String, String) but allowing to set a name to the sampler
for easy identification in collected statistics and metrics.name - specifies the name to assign to the sampler.poolName - is a name of a previously defined jdbcConnectionPool(String, Class,
String), and specifies which connection pool to use to interact with the
database.query - specifies the query string (it might be a prepared statement string) to send to
the database. You can pass null value when using DslJdbcSampler.autoCommit(boolean), DslJdbcSampler.commit() and DslJdbcSampler.rollback() methods.Copyright © 2022. All rights reserved.