Pages

Monday, 30 January 2017

JMeter - Config Element - "JDBC Connection Configuration"

"JDBC Connection Configuration" is used to creates a database connection from the supplied JDBC Connection settings. The connection may be optionally pooled between threads. Otherwise, each thread gets its own connection. The connection configuration name is used by the JDBC Sampler to select the appropriate connection. 

How to add "JDBC Connection Configuration" element?
You can follow below steps to add JDBC Connection Configuration:
1. Select "Test Plan" node
2. Right click on "Test Plan" node
3. Mouse hovers "Add"
4. Mouse hovers "Config Element"
5. Click "JDBC Connection Configuration" 

How to remove "JDBC Connection Configuration" element?
You can follow the below steps:
1. Select "JDBC Connection Configuration" node
2. Right click on "JDBC Connection Configuration" node
3. Click "Remove" (Mouse) or "Delete" button from the keyboard
4. Click "Yes"  

JMeter creates a database connection pool with the configuration settings as specified in the Control Panel. The pool is referred to in JDBC Requests in the 'Variable Name' field. Several different JDBC Configuration elements can be used, but they must have unique names. Every JDBC Request must refer to a JDBC Configuration pool. More than one JDBC Request can refer to the same pool.


What are the attributes of "JDBC Connection Configuration" element?
"JDBC Connection Configuration" has below attributes:
  • Name: To provide element name
  • Comments: To provide arbitrary comments (if any)
  • Variable Name: The name of the variable the connection is tied to. Multiple connections can be used, each tied to a different variable, allowing JDBC Samplers to select the appropriate connection.
  • Max Number of ConnectionsMaximum number of connections allowed in the pool. In most cases, set this to zero (0) . This means that each thread will get its own pool with a single connection in it, i.e. the connections are not shared between threads. If you really want to use shared pooling, then set the max count to the same as the number of threads to ensure threads don't wait on each other.
  • Max Wait (ms)Pool throws an error if the timeout period is exceeded in the process of trying to retrieve a connection
  • Time Between Eviction Runs (ms)The number of milliseconds to sleep between runs of the idle object evictor thread. When non-positive, no idle object evictor thread will be run. (Defaults to " 60000 ", 1 minute). 
  • Auto CommitTurn auto-commit on or off for the connections.
  • Test While IdleTest idle connections of the pool.
  • Soft Min Evictable Idle Time(ms)Minimum amount of time a connection may sit idle in the pool before it is eligible for eviction by the idle object evictor, with the extra condition that at least minIdle connections remain in the pool.
  • Validation QueryA simple query used to determine if the database is still responding. This defaults to the ' isValid() ' method of the JDBC driver, which is suitable for many databases. However some may require a different query; for example, Oracle something like ' SELECT 1 FROM DUAL ' could be used.
  • Database URLJDBC Connection string for the database.
  • JDBC Driver classFully qualified name of driver class. 
  • UsernameName of the user to connect as.
  • PasswordPassword to connect with.
Next Topic:
Apache JMeter - "Keystore Configuration" Element

Previous Topic:
Apache JMeter - "Java Request Defaults" Element

Related Topics:

No comments:

Post a Comment