{"id":5037,"date":"2018-07-25T11:53:05","date_gmt":"2018-07-25T15:53:05","guid":{"rendered":"https:\/\/www.redline13.com\/blog\/?p=5037"},"modified":"2018-07-25T11:53:05","modified_gmt":"2018-07-25T15:53:05","slug":"jmeter-database-testing","status":"publish","type":"post","link":"https:\/\/www.redline13.com\/blog\/2018\/07\/jmeter-database-testing\/","title":{"rendered":"JMeter Database Testing"},"content":{"rendered":"<p>Database load testing is used to test database applications for performance, reliability, and scalability. We will use varying user loads to identify performance issues. Load testing simulates real-life user load for the target database applications and is used to determine the behavior of the database applications when multiple users hit the applications simultaneously. This article will guide you how to configure and run JMeter Database Testing. We will create a simple test plan to test a MySQL database server, but you can use any database.<\/p>\n<h3><strong>Prerequisites for JMeter Database Testing:<\/strong><\/h3>\n<p>Before you start working with a database by using <a href=\"http:\/\/www.blazemeter.com\/jmeter-load-testing?utm_source=blog&amp;utm_medium=BM_blog&amp;utm_campaign=mysql-database-and-jmeter-how-to-test-your-connection\">JMeter<\/a>, you need to do the following:<\/p>\n<ul>\n<li>Create a user who has permission to connect and perform common actions in the database.<\/li>\n<li>Make sure the database is available for remote or local access.<\/li>\n<\/ul>\n<h3><strong>Configuring JMeter:<\/strong><\/h3>\n<ul>\n<li>The JDBC driver is needed for JMeter to connect with MySQL database. You can download the latest version of the JDBC driver <a href=\"https:\/\/dev.mysql.com\/downloads\/connector\/j\/\">here.<\/a><\/li>\n<li>Open the downloaded archive and find the file named \u201cmysql-connector-java-X.X.XX.jar\u201d. Copy the jar to the lib directory of JMeter.<\/li>\n<li>Restart JMeter to pick up the changes if it is already open.<\/li>\n<\/ul>\n<p>Now the setup is complete and JMeter is ready to connect to MySQL.<\/p>\n<p>For our test purposes, we will:<\/p>\n<ul>\n<li>Create a database with name &#8220;demo&#8221;.<\/li>\n<li>Create a table of usernames.<\/li>\n<li>Insert records into usernames as shown below.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"758\" height=\"392\" class=\"wp-image-5038\" src=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/07\/word-image-21.png\" alt=\"Database table setup.\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/07\/word-image-21.png 758w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/07\/word-image-21-300x155.png 300w\" sizes=\"auto, (max-width: 758px) 100vw, 758px\" \/><\/p>\n<h3><strong>Creating a test plan<\/strong><\/h3>\n<ul>\n<li>Launch JMeter<\/li>\n<li>Add a JDBC Connection configuration to the test plan.  Right click on Test Plan \u2192 Add \u2192 ConfigElement \u2192 JDBC Connection Configuration<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"864\" height=\"478\" class=\"wp-image-5039\" src=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/07\/word-image-22.png\" alt=\"JMeter Setup\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/07\/word-image-22.png 864w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/07\/word-image-22-300x166.png 300w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/07\/word-image-22-768x425.png 768w\" sizes=\"auto, (max-width: 864px) 100vw, 864px\" \/><\/p>\n<ul>\n<li>Now we have to specify the database connection properties In the JDBC Connection Configuration element.<\/li>\n<li>The database URL is \u201c<strong>jdbc:mysql:\/\/&lt;DatabaseServer&gt;:&lt;Port&gt;\/&lt;DatabaseName&gt;<\/strong>\u201d<\/li>\n<\/ul>\n<p>For the JDBC driver class, select <code>com.mysql.jdbc.Driver<\/code>.  Also, enter the database username and password.<\/p>\n<p><img decoding=\"async\" class=\"wp-image-5040\" src=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/07\/word-image-23.png\" alt=\"Database configuration\" \/><\/p>\n<ul>\n<li>Add a thread group to Test Plan<\/li>\n<li>Next, add a JDBC sampler to the test plan. Right click on thread group \u2192 add \u2192 sampler \u2192 JDBC Request.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"857\" height=\"482\" class=\"wp-image-5041\" src=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/07\/word-image-24.png\" alt=\"JDBC Sampler setup\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/07\/word-image-24.png 857w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/07\/word-image-24-300x169.png 300w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/07\/word-image-24-768x432.png 768w\" sizes=\"auto, (max-width: 857px) 100vw, 857px\" \/><\/p>\n<ul>\n<li>Add a listener to the test plan. Right Click on Test plan \u2192 Listeners \u2192 View Results Tree.<\/li>\n<li>Now you can run your queries using the JDBC request sampler.<br \/>\nSelect your query type from the drop down menu and enter your query in the JDBC request sampler.  Then, run the test.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1357\" height=\"653\" class=\"wp-image-5042\" src=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/07\/word-image-25.png\" alt=\"Query setup\" srcset=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/07\/word-image-25.png 1357w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/07\/word-image-25-300x144.png 300w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/07\/word-image-25-1024x493.png 1024w, https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/07\/word-image-25-768x370.png 768w\" sizes=\"auto, (max-width: 1357px) 100vw, 1357px\" \/><\/p>\n<p><img decoding=\"async\" class=\"wp-image-5043\" src=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/07\/word-image-26.png\" alt=\"Query results.\" \/><\/p>\n<p>You can upload this JMX file to <a href=\"http:\/\/www.redline13.com\">RedLine13<\/a> to scale up your JMeter Database test.<\/p>\n<p>For more information about running a JMeter test on RedLine13 follow this article <a href=\"https:\/\/www.redline13.com\/blog\/2017\/02\/jmeter\/\">Run a JMeter test with Redline13<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Database load testing is used to test database applications for performance, reliability, and scalability. We will use varying user loads to identify performance issues. Load testing simulates real-life user load for the target database applications and is used to determine the behavior of the database applications when multiple users hit the applications simultaneously. This article will guide you how to configure and run JMeter Database Testing. We will create a simple test plan to test a<a class=\"more-link\" href=\"https:\/\/www.redline13.com\/blog\/2018\/07\/jmeter-database-testing\/\">Read More &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":5044,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,29,7],"tags":[],"class_list":{"0":"entry","1":"post","2":"publish","3":"author-user","4":"post-5037","6":"format-standard","7":"has-post-thumbnail","8":"category-blog","9":"category-database","10":"category-jmeter"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.12 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JMeter Database Testing - RedLine13 JMeter Database Testing<\/title>\n<meta name=\"description\" content=\"JMeter Database Testing - Database load testing is used to test database applications for performance, reliability, and scalability.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.redline13.com\/blog\/2018\/07\/jmeter-database-testing\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JMeter Database Testing - RedLine13 JMeter Database Testing\" \/>\n<meta property=\"og:description\" content=\"JMeter Database Testing - Database load testing is used to test database applications for performance, reliability, and scalability.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.redline13.com\/blog\/2018\/07\/jmeter-database-testing\/\" \/>\n<meta property=\"og:site_name\" content=\"RedLine13\" \/>\n<meta property=\"article:published_time\" content=\"2018-07-25T15:53:05+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/07\/Database.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"612\" \/>\n\t<meta property=\"og:image:height\" content=\"415\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"RedLine13\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"RedLine13\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2018\/07\/jmeter-database-testing\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2018\/07\/jmeter-database-testing\/\"},\"author\":{\"name\":\"RedLine13\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/4acbcdcb8a9c72ec5a274e69c0ebea28\"},\"headline\":\"JMeter Database Testing\",\"datePublished\":\"2018-07-25T15:53:05+00:00\",\"dateModified\":\"2018-07-25T15:53:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2018\/07\/jmeter-database-testing\/\"},\"wordCount\":407,\"publisher\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\"},\"articleSection\":[\"Blog\",\"Database\",\"JMeter\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2018\/07\/jmeter-database-testing\/\",\"url\":\"https:\/\/www.redline13.com\/blog\/2018\/07\/jmeter-database-testing\/\",\"name\":\"JMeter Database Testing - RedLine13 JMeter Database Testing\",\"isPartOf\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#website\"},\"datePublished\":\"2018-07-25T15:53:05+00:00\",\"dateModified\":\"2018-07-25T15:53:05+00:00\",\"description\":\"JMeter Database Testing - Database load testing is used to test database applications for performance, reliability, and scalability.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/2018\/07\/jmeter-database-testing\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.redline13.com\/blog\/2018\/07\/jmeter-database-testing\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.redline13.com\/blog\/2018\/07\/jmeter-database-testing\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.redline13.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JMeter Database Testing\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#website\",\"url\":\"https:\/\/www.redline13.com\/blog\/\",\"name\":\"RedLine13\",\"description\":\"(Almost) Free Load Testing in the Cloud\",\"publisher\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.redline13.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#organization\",\"name\":\"RedLine13\",\"url\":\"https:\/\/www.redline13.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg\",\"contentUrl\":\"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg\",\"width\":300,\"height\":68,\"caption\":\"RedLine13\"},\"image\":{\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/4acbcdcb8a9c72ec5a274e69c0ebea28\",\"name\":\"RedLine13\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514?s=96&d=mm&r=g\",\"caption\":\"RedLine13\"},\"sameAs\":[\"http:\/\/127.0.0.1\"],\"url\":\"https:\/\/www.redline13.com\/blog\/author\/user\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JMeter Database Testing - RedLine13 JMeter Database Testing","description":"JMeter Database Testing - Database load testing is used to test database applications for performance, reliability, and scalability.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.redline13.com\/blog\/2018\/07\/jmeter-database-testing\/","og_locale":"en_US","og_type":"article","og_title":"JMeter Database Testing - RedLine13 JMeter Database Testing","og_description":"JMeter Database Testing - Database load testing is used to test database applications for performance, reliability, and scalability.","og_url":"https:\/\/www.redline13.com\/blog\/2018\/07\/jmeter-database-testing\/","og_site_name":"RedLine13","article_published_time":"2018-07-25T15:53:05+00:00","og_image":[{"width":612,"height":415,"url":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2018\/07\/Database.jpg","type":"image\/jpeg"}],"author":"RedLine13","twitter_card":"summary_large_image","twitter_misc":{"Written by":"RedLine13","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.redline13.com\/blog\/2018\/07\/jmeter-database-testing\/#article","isPartOf":{"@id":"https:\/\/www.redline13.com\/blog\/2018\/07\/jmeter-database-testing\/"},"author":{"name":"RedLine13","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/4acbcdcb8a9c72ec5a274e69c0ebea28"},"headline":"JMeter Database Testing","datePublished":"2018-07-25T15:53:05+00:00","dateModified":"2018-07-25T15:53:05+00:00","mainEntityOfPage":{"@id":"https:\/\/www.redline13.com\/blog\/2018\/07\/jmeter-database-testing\/"},"wordCount":407,"publisher":{"@id":"https:\/\/www.redline13.com\/blog\/#organization"},"articleSection":["Blog","Database","JMeter"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.redline13.com\/blog\/2018\/07\/jmeter-database-testing\/","url":"https:\/\/www.redline13.com\/blog\/2018\/07\/jmeter-database-testing\/","name":"JMeter Database Testing - RedLine13 JMeter Database Testing","isPartOf":{"@id":"https:\/\/www.redline13.com\/blog\/#website"},"datePublished":"2018-07-25T15:53:05+00:00","dateModified":"2018-07-25T15:53:05+00:00","description":"JMeter Database Testing - Database load testing is used to test database applications for performance, reliability, and scalability.","breadcrumb":{"@id":"https:\/\/www.redline13.com\/blog\/2018\/07\/jmeter-database-testing\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.redline13.com\/blog\/2018\/07\/jmeter-database-testing\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.redline13.com\/blog\/2018\/07\/jmeter-database-testing\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.redline13.com\/blog\/"},{"@type":"ListItem","position":2,"name":"JMeter Database Testing"}]},{"@type":"WebSite","@id":"https:\/\/www.redline13.com\/blog\/#website","url":"https:\/\/www.redline13.com\/blog\/","name":"RedLine13","description":"(Almost) Free Load Testing in the Cloud","publisher":{"@id":"https:\/\/www.redline13.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.redline13.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.redline13.com\/blog\/#organization","name":"RedLine13","url":"https:\/\/www.redline13.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg","contentUrl":"https:\/\/www.redline13.com\/blog\/wp-content\/uploads\/2013\/06\/cropped-rl13-header-logo.jpg","width":300,"height":68,"caption":"RedLine13"},"image":{"@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/4acbcdcb8a9c72ec5a274e69c0ebea28","name":"RedLine13","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.redline13.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b4c9a289323b21a01c3e940f150eb9b8c542587f1abfd8f0e1cc1ffc5e475514?s=96&d=mm&r=g","caption":"RedLine13"},"sameAs":["http:\/\/127.0.0.1"],"url":"https:\/\/www.redline13.com\/blog\/author\/user\/"}]}},"_links":{"self":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/5037","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/comments?post=5037"}],"version-history":[{"count":0,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/posts\/5037\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/media\/5044"}],"wp:attachment":[{"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/media?parent=5037"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/categories?post=5037"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.redline13.com\/blog\/wp-json\/wp\/v2\/tags?post=5037"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}