2008-05-28 02:05:49 +08:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
2013-10-16 21:57:02 +08:00
2008-05-28 02:05:49 +08:00
http://www.apache.org/licenses/LICENSE-2.0
2013-10-16 21:57:02 +08:00
2008-05-28 02:05:49 +08:00
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Content Stylesheet for Site -->
2009-05-10 06:57:45 +08:00
2008-05-28 02:05:49 +08:00
<!-- start the processing -->
2009-05-10 06:57:45 +08:00
< html >
< head >
2009-06-14 00:59:15 +08:00
< link rel = "stylesheet" type = "text/css" href = "../css/style.css" / >
2009-05-10 06:57:45 +08:00
< meta http-equiv = "Content-Type" content = "text/html; charset=iso-8859-1" / >
2013-10-16 21:57:02 +08:00
< title > Apache JMeter - User's Manual: Building a Simple Database Test Plan< / title >
2009-05-10 06:57:45 +08:00
< / head >
< body bgcolor = "#ffffff" text = "#000000" link = "#525D76" >
2013-10-31 00:38:42 +08:00
< table width = "100%" cellspacing = "0" border = "0" >
< tr >
< td width = "90%" align = "left" >
2009-05-10 06:57:45 +08:00
< table border = "0" cellspacing = "0" >
< tr >
2013-10-31 00:38:42 +08:00
< td width = "10%" >
< a href = "http://www.apache.org" > < img title = "Apache Software Foundation" width = "290" height = "75" src = "../images/asf-logo.png" border = "0" / > < / a >
< / td >
< td align = "left" width = "40%" >
< a href = "http://jmeter.apache.org/" > < img width = "182" height = "88" src = "../images/logo.jpg" alt = "Apache JMeter" title = "Apache JMeter" border = "0" / > < / a >
< / td >
< / tr >
< / table >
2008-05-28 02:05:49 +08:00
< / td >
2013-10-31 00:38:42 +08:00
< td align = "left" width = "50%" >
< table cellspacing = "0" align = "right" border = "0" >
< tr >
< td align = "left" > < a href = "https://twitter.com/share"
class="twitter-share-button"
data-text="Powerful Load Testing with
Apache #JMeter" data-via="ApacheJMeter"
data-lang="en-gb" data-size="large">Tweet< / a >
< script > ! function ( d , s , id ) { var js , fjs = d . getElementsByTagName ( s ) [ 0 ] , p = /^http:/ . test ( d . location ) ? 'http' : 'https' ; if ( ! d . getElementById ( id ) ) { js = d . createElement ( s ) ; js . id = id ; js . src = p + '://platform.twitter.com/widgets.js' ; fjs . parentNode . insertBefore ( js , fjs ) ; } } ( document , 'script' , 'twitter-wjs' ) ; < / script >
2008-05-28 02:05:49 +08:00
< / td >
2013-10-31 00:38:42 +08:00
< td align = "right" > < a
href="https://twitter.com/ApacheJMeter"
class="twitter-follow-button"
data-show-count="false" data-lang="en-gb"
data-size="large">Follow< / a >
< script > ! function ( d , s , id ) { var js , fjs = d . getElementsByTagName ( s ) [ 0 ] , p = /^http:/ . test ( d . location ) ? 'http' : 'https' ; if ( ! d . getElementById ( id ) ) { js = d . createElement ( s ) ; js . id = id ; js . src = p + '://platform.twitter.com/widgets.js' ; fjs . parentNode . insertBefore ( js , fjs ) ; } } ( document , 'script' , 'twitter-wjs' ) ; < / script >
2008-05-28 02:05:49 +08:00
< / td >
2009-05-10 06:57:45 +08:00
< / tr >
< / table >
2013-10-31 00:38:42 +08:00
< / td > < / tr >
< / table >
2009-05-10 06:57:45 +08:00
< table border = "0" width = "100%" cellspacing = "4" >
< tr > < td colspan = "2" >
< hr noshade size = "1" / >
< / td > < / tr >
< tr >
<!-- LEFT SIDE NAVIGATION -->
< td width = "20%" valign = "top" nowrap = "true" >
2013-10-31 00:38:42 +08:00
< table border = "0" width = "100%" cellspacing = "0" >
< tr > < td >
2009-05-10 06:57:45 +08:00
< p > < strong > About< / strong > < / p >
< ul >
< li > < a href = "../index.html" > Overview< / a >
2008-05-28 02:05:49 +08:00
< / li >
2009-05-10 06:57:45 +08:00
< li > < a href = "../changes.html" > Changes< / a >
2008-05-28 02:05:49 +08:00
< / li >
2012-05-19 23:32:55 +08:00
< li > < a href = "http://projects.apache.org/feeds/rss/jmeter.xml" > Subscribe to What's New< / a >
< / li >
2013-10-31 00:38:42 +08:00
< li > < a href = "http://twitter.com/ApacheJMeter" > JMeter on Twitter< / a >
< img src = "../images/twitter.png" align = "top" / > < / li >
2013-10-16 21:57:02 +08:00
< li > < a href = "../issues.html" > Issue Tracking< / a >
2008-05-28 02:05:49 +08:00
< / li >
2011-08-01 03:18:54 +08:00
< li > < a href = "http://www.apache.org/licenses/" > License< / a >
2008-05-28 02:05:49 +08:00
< / li >
2012-01-29 01:12:54 +08:00
< li > < a href = "http://wiki.apache.org/jmeter/JMeterCommitters" > Contributors< / a >
2008-05-28 02:05:49 +08:00
< / li >
2009-05-10 06:57:45 +08:00
< / ul >
< p > < strong > Download< / strong > < / p >
< ul >
2012-01-29 01:12:54 +08:00
< li > < a href = "../download_jmeter.cgi" > Download Releases< / a >
2008-05-28 02:05:49 +08:00
< / li >
2009-05-10 06:57:45 +08:00
< li > < a href = "../nightly.html" > Developer (Nightly) Builds< / a >
2008-05-28 02:05:49 +08:00
< / li >
2009-05-10 06:57:45 +08:00
< / ul >
< p > < strong > Documentation< / strong > < / p >
< ul >
< li > < a href = "../usermanual/index.html" > User Manual< / a >
2008-05-28 02:05:49 +08:00
< / li >
2012-09-30 17:16:08 +08:00
< li > < a href = "../usermanual/best-practices.html" > Best Practices< / a >
< / li >
2012-01-29 01:12:54 +08:00
< li > < a href = "../usermanual/component_reference.html" > Component Reference< / a >
< / li >
< li > < a href = "../usermanual/functions.html" > Functions Reference< / a >
< / li >
2009-05-10 06:57:45 +08:00
< li > < a href = "../api/index.html" > Javadocs< / a >
2008-05-28 02:05:49 +08:00
< / li >
2009-05-10 06:57:45 +08:00
< li > < a href = "../localising/index.html" > Localisation (Translator's Guide)< / a >
2008-05-28 02:05:49 +08:00
< / li >
2009-05-10 06:57:45 +08:00
< li > < a href = "../building.html" > Building JMeter and Add-Ons< / a >
2008-05-28 02:05:49 +08:00
< / li >
2012-01-29 01:12:54 +08:00
< li > < a href = "http://wiki.apache.org/jmeter" > JMeter Wiki< / a >
2008-05-28 02:05:49 +08:00
< / li >
2012-01-29 01:12:54 +08:00
< li > < a href = "http://wiki.apache.org/jmeter/JMeterFAQ" > FAQ (Wiki)< / a >
2008-05-28 02:05:49 +08:00
< / li >
2009-05-10 06:57:45 +08:00
< / ul >
< p > < strong > Tutorials (PDF format)< / strong > < / p >
< ul >
< li > < a href = "../usermanual/jmeter_distributed_testing_step_by_step.pdf" > Distributed Testing< / a >
2008-05-28 02:05:49 +08:00
< / li >
2009-05-10 06:57:45 +08:00
< li > < a href = "../usermanual/jmeter_proxy_step_by_step.pdf" > Recording Tests< / a >
2008-05-28 02:05:49 +08:00
< / li >
2009-05-10 06:57:45 +08:00
< li > < a href = "../usermanual/junitsampler_tutorial.pdf" > JUnit Sampler< / a >
2008-05-28 02:05:49 +08:00
< / li >
2009-05-10 06:57:45 +08:00
< li > < a href = "../usermanual/jmeter_accesslog_sampler_step_by_step.pdf" > Access Log Sampler< / a >
2008-05-28 02:05:49 +08:00
< / li >
2009-05-10 06:57:45 +08:00
< li > < a href = "../extending/jmeter_tutorial.pdf" > Extending JMeter< / a >
2008-05-28 02:05:49 +08:00
< / li >
2009-05-10 06:57:45 +08:00
< / ul >
< p > < strong > Community< / strong > < / p >
< ul >
2012-01-29 01:12:54 +08:00
< li > < a href = "../mail.html" > Mailing Lists< / a >
2008-05-28 02:05:49 +08:00
< / li >
2012-01-29 01:12:54 +08:00
< li > < a href = "../svnindex.html" > SVN Repositories< / a >
2008-05-28 02:05:49 +08:00
< / li >
2009-05-10 06:57:45 +08:00
< / ul >
2010-07-08 18:39:18 +08:00
< p > < strong > Foundation< / strong > < / p >
< ul >
< li > < a href = "http://www.apache.org/" > ASF< / a >
< / li >
2013-10-16 21:57:02 +08:00
< li > < a href = "http://www.apache.org/foundation/getinvolved.html" > Get Involved in the ASF< / a >
< / li >
2010-07-08 18:39:18 +08:00
< li > < a href = "http://www.apache.org/foundation/sponsorship.html" > Sponsorship< / a >
< / li >
< li > < a href = "http://www.apache.org/foundation/thanks.html" > Thanks< / a >
< / li >
< / ul >
2013-10-31 00:38:42 +08:00
< / td > < / tr >
< tr > < td >
< iframe src = "http://www.apache.org/ads/button.html" style = "border-width:0; float: left;" frameborder = "0" scrolling = "no" > < / iframe >
< / td > < / tr >
< / table >
2009-05-10 06:57:45 +08:00
< / td >
< td width = "80%" align = "left" valign = "top" >
< table >
< tr >
< td bgcolor = "#525D76" >
< div align = "right" > < a href = "index.html" > < font size = -1 color = "#ffffff" face = "arial,helvetica,sanserif" > Index< / font > < / a > < / div >
< / td >
< td bgcolor = "#525D76" >
< div align = "right" > < a href = "build-ftp-test-plan.html" > < font size = -1 color = "#ffffff" face = "arial,helvetica,sanserif" > Next< / font > < / a > < / div >
< / td >
< td bgcolor = "#525D76" >
< div align = "right" > < a href = "build-adv-web-test-plan.html" > < font size = -1 color = "#ffffff" face = "arial,helvetica,sanserif" > Prev< / font > < / a > < / div >
< / td >
< / tr >
< / table >
< br >
< table border = "0" cellspacing = "0" cellpadding = "2" width = "100%" >
< tr > < td bgcolor = "#525D76" >
< font color = "#ffffff" face = "arial,helvetica,sanserif" >
2011-08-01 03:18:54 +08:00
< a name = "building" > < strong > 7. Building a Database Test Plan< / strong > < / a > < a class = "sectionlink" href = "#building" title = "Link to here" > ¶ < / a > < / font >
2009-05-10 06:57:45 +08:00
< / td > < / tr >
< tr > < td >
< blockquote >
< p >
In this section, you will learn how to create a basic
< a href = "build-test-plan.html" >
Test Plan
< / a >
to test a database server.
2013-12-31 23:05:05 +08:00
You will create fifty users that send 2 SQL requests to the database server.
Also, you will tell the users to run their tests 100 times. So, the total number
2013-10-16 21:57:02 +08:00
of requests is (50 users) x (2 requests) x (repeat 100 times) = 10'000 JDBC requests.
2007-07-04 07:23:51 +08:00
To construct the Test Plan, you will use the following elements:
2008-05-28 02:05:49 +08:00
2009-05-10 06:57:45 +08:00
< a href = "test_plan.html#thread_group" >
Thread Group
< / a >
,
< a href = "../usermanual/component_reference.html#JDBC_Request" > JDBC Request< / a >
,
2013-10-16 21:57:02 +08:00
< a href = "../usermanual/component_reference.html#Summary_Report" > Summary Report< / a >
2009-05-10 06:57:45 +08:00
.
< / p >
< p >
< table border = "1" bgcolor = "#bbbb00" width = "50%" cellspacing = "0" cellpadding = "2" >
< tr > < td > This example uses the MySQL database driver.
2013-10-16 21:57:02 +08:00
To use this driver, its containing .jar file (ex. mysql-connector-java-X.X.X-bin.jar) must be copied to the JMeter
2008-05-28 02:05:49 +08:00
2009-05-10 06:57:45 +08:00
< b >
2013-10-16 21:57:02 +08:00
./lib
2009-05-10 06:57:45 +08:00
< / b >
directory (see
< a href = "get-started.html#classpath" >
JMeter's Classpath
< / a >
2008-05-28 02:05:49 +08:00
for more details).
2009-05-10 06:57:45 +08:00
< / td > < / tr >
< / table >
< / p >
< / blockquote >
< / p >
< / td > < / tr >
< tr > < td > < br > < / td > < / tr >
< / table >
< table border = "0" cellspacing = "0" cellpadding = "2" width = "100%" >
< tr > < td bgcolor = "#525D76" >
< font color = "#ffffff" face = "arial,helvetica,sanserif" >
2011-08-01 03:18:54 +08:00
< a name = "adding_users" > < strong > 7.1 Adding Users< / strong > < / a > < a class = "sectionlink" href = "#adding_users" title = "Link to here" > ¶ < / a > < / font >
2009-05-10 06:57:45 +08:00
< / td > < / tr >
< tr > < td >
< blockquote >
< p >
The first step you want to do with every JMeter Test Plan is to add a
< a href = "test_plan.html#thread_group" >
Thread Group
< / a >
element. The Thread Group
2007-07-04 07:23:51 +08:00
tells JMeter the number of users you want to simulate, how often the users should
2008-05-28 02:05:49 +08:00
send requests, and the how many requests they should send.
2009-05-10 06:57:45 +08:00
< / p >
< p >
Go ahead and add the ThreadGroup element by first selecting the Test Plan,
2007-07-04 07:23:51 +08:00
clicking your right mouse button to get the Add menu, and then select
2013-10-16 21:57:02 +08:00
< b >
Add
< / b >
-->
< b >
ThreadGroup
< / b >
.
2009-05-10 06:57:45 +08:00
< / p >
< p >
You should now see the Thread Group element under Test Plan. If you do not
2007-07-04 07:23:51 +08:00
see the element, then "expand" the Test Plan tree by clicking on the
2008-05-28 02:05:49 +08:00
Test Plan element.
2009-05-10 06:57:45 +08:00
< / p >
< p >
Next, you need to modify the default properties. Select the Thread Group element
2007-07-04 07:23:51 +08:00
in the tree, if you have not already selected it. You should now see the Thread
Group Control Panel in the right section of the JMeter window (see Figure 7.1
2008-05-28 02:05:49 +08:00
below)
2009-05-10 06:57:45 +08:00
< / p >
2013-10-16 21:57:02 +08:00
< p > < table border = "0" cellspacing = "0" cellpadding = "0" > < tr > < td > < img src = "../images/screenshots/jdbctest/threadgroup1.png" / > < br >
2009-05-10 06:57:45 +08:00
< font size = "-1" >
2008-05-28 02:05:49 +08:00
Figure 7.1. Thread Group with Default Values
2009-05-10 06:57:45 +08:00
< / font > < / td > < / tr > < / table > < / p >
< p >
Start by providing a more descriptive name for our Thread Group. In the name
2008-05-28 02:05:49 +08:00
field, enter JDBC Users.
2009-05-10 06:57:45 +08:00
< / p >
< p >
< table border = "1" bgcolor = "#bbbb00" width = "50%" cellspacing = "0" cellpadding = "2" >
< tr > < td > You will need a valid database, database table, and user-level access to that
2013-10-16 21:57:02 +08:00
table. In the example shown here, the database is 'cloud' and the table name is
'vm_instance'.
2009-05-10 06:57:45 +08:00
< / td > < / tr >
< / table >
< / p >
< p >
2013-10-16 21:57:02 +08:00
Next, increase the number of users to 50.
2009-05-10 06:57:45 +08:00
< / p >
< p >
2013-10-16 21:57:02 +08:00
In the next field, the Ramp-Up Period, leave the the value of 10
2007-07-04 07:23:51 +08:00
seconds. This property tells JMeter how long to delay between starting each
2013-10-16 21:57:02 +08:00
user. For example, if you enter a Ramp-Up Period of 10 seconds, JMeter will
finish starting all of your users by the end of the 10 seconds. So, if we have
50 users and a 10 second Ramp-Up Period, then the delay between starting users
would be 200 milliseconds (10 seconds / 50 users = 0.2 user per second). If you set the
2008-05-28 02:05:49 +08:00
value to 0, then JMeter will immediately start all of your users.
2009-05-10 06:57:45 +08:00
< / p >
< p >
2013-10-16 21:57:02 +08:00
Finally, enter a value of 100 in
2007-07-04 07:23:51 +08:00
the Loop Count field. This property tells JMeter how many times to repeat your
test. To have JMeter repeatedly run your Test Plan, select the Forever
2008-05-28 02:05:49 +08:00
checkbox.
2009-05-10 06:57:45 +08:00
< / p >
< p >
< table border = "1" bgcolor = "#bbbb00" width = "50%" cellspacing = "0" cellpadding = "2" >
< tr > < td > In most applications, you have to manually accept
2007-07-04 07:23:51 +08:00
changes you make in a Control Panel. However, in JMeter, the Control Panel
automatically accepts your changes as you make them. If you change the
name of an element, the tree will be updated with the new text after you
2008-05-28 02:05:49 +08:00
leave the Control Panel (for example, when selecting another tree element).
2009-05-10 06:57:45 +08:00
< / td > < / tr >
< / table >
< / p >
< p >
See Figure 7.2 for the completed JDBC Users Thread Group.
< / p >
2013-10-16 21:57:02 +08:00
< p > < table border = "0" cellspacing = "0" cellpadding = "0" > < tr > < td > < img src = "../images/screenshots/jdbctest/threadgroup2.png" / > < br >
2009-05-10 06:57:45 +08:00
< font size = "-1" >
2008-05-28 02:05:49 +08:00
Figure 7.2. JDBC Users Thread Group
2009-05-10 06:57:45 +08:00
< / font > < / td > < / tr > < / table > < / p >
< / blockquote >
< / p >
< / td > < / tr >
< tr > < td > < br > < / td > < / tr >
< / table >
< table border = "0" cellspacing = "0" cellpadding = "2" width = "100%" >
< tr > < td bgcolor = "#525D76" >
< font color = "#ffffff" face = "arial,helvetica,sanserif" >
2011-08-01 03:18:54 +08:00
< a name = "adding_requests" > < strong > 7.2 Adding JDBC Requests< / strong > < / a > < a class = "sectionlink" href = "#adding_requests" title = "Link to here" > ¶ < / a > < / font >
2009-05-10 06:57:45 +08:00
< / td > < / tr >
< tr > < td >
< blockquote >
< p >
Now that we have defined our users, it is time to define the tasks that they
2007-07-04 07:23:51 +08:00
will be performing. In this section, you will specify the JDBC requests to
2008-05-28 02:05:49 +08:00
perform.
2009-05-10 06:57:45 +08:00
< / p >
< p >
Begin by selecting the JDBC Users element. Click your right mouse button
2013-10-16 21:57:02 +08:00
to get the w
< b >
Add
< / b >
menu, and then select
< b >
Add
< / b >
-->
< b >
Config Element
< / b >
-->
< b >
JDBC Connection Configuration
< / b >
.
2008-05-28 02:05:49 +08:00
Then, select this new element to view its Control Panel (see Figure 7.3).
2009-05-10 06:57:45 +08:00
< / p >
< p >
2013-10-16 21:57:02 +08:00
Set up the following fields (these assume we will be using a MySQL database called 'cloud'):
2009-05-10 06:57:45 +08:00
< / p >
< ul >
< li >
2013-10-16 21:57:02 +08:00
Variable name (here: myDatabase) bound to pool. This needs to uniquely identify the configuration. It is used by the JDBC Sampler to identify the configuration to be used.
2009-05-10 06:57:45 +08:00
< / li >
< li >
2013-10-16 21:57:02 +08:00
Database URL: jdbc:mysql://ipOfTheServer:3306/cloud
2009-05-10 06:57:45 +08:00
< / li >
< li >
JDBC Driver class: com.mysql.jdbc.Driver
< / li >
< li >
2013-10-16 21:57:02 +08:00
Username: the username of database
2009-05-10 06:57:45 +08:00
< / li >
< li >
2013-10-16 21:57:02 +08:00
Password: password for the username
2009-05-10 06:57:45 +08:00
< / li >
< / ul >
< p >
The other fields on the screen can be left as the defaults.
< / p >
< p >
JMeter creates a database connection pool with the configuration settings as specified in the Control Panel.
2007-07-04 07:23:51 +08:00
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.
2008-05-28 02:05:49 +08:00
2009-05-10 06:57:45 +08:00
< / p >
2013-10-16 21:57:02 +08:00
< p > < table border = "0" cellspacing = "0" cellpadding = "0" > < tr > < td > < img src = "../images/screenshots/jdbctest/jdbc-config.png" / > < br >
2009-05-10 06:57:45 +08:00
< font size = "-1" >
2008-05-28 02:05:49 +08:00
Figure 7.3. JDBC Configuration
2009-05-10 06:57:45 +08:00
< / font > < / td > < / tr > < / table > < / p >
< p >
Selecting the JDBC Users element again. Click your right mouse button
2013-10-16 21:57:02 +08:00
to get the
< b >
Add
< / b >
menu, and then select
< b >
Add
< / b >
-->
< b >
Sampler
< / b >
-->
< b >
JDBC Request
< / b >
.
2008-05-28 02:05:49 +08:00
Then, select this new element to view its Control Panel (see Figure 7.4).
2009-05-10 06:57:45 +08:00
< / p >
2013-10-16 21:57:02 +08:00
< p > < table border = "0" cellspacing = "0" cellpadding = "0" > < tr > < td > < img src = "../images/screenshots/jdbctest/JDBCRequest.png" / > < br >
2009-05-10 06:57:45 +08:00
< font size = "-1" >
2008-05-28 02:05:49 +08:00
Figure 7.4. JDBC Request
2009-05-10 06:57:45 +08:00
< / font > < / td > < / tr > < / table > < / p >
< p >
In our Test Plan, we will make two JDBC requests. The first one is for
2013-10-16 21:57:02 +08:00
select all 'Running' VM instances, and the second is to select 'Expunging' VM instance (obviously you should
2007-07-04 07:23:51 +08:00
change these to examples appropriate for your particular database). These
2008-05-28 02:05:49 +08:00
are illustrated below.
2009-05-10 06:57:45 +08:00
< / p >
< p >
< table border = "1" bgcolor = "#bbbb00" width = "50%" cellspacing = "0" cellpadding = "2" >
< tr > < td > JMeter sends requests in the order that you add them to the tree.
< / td > < / tr >
< / table >
< / p >
< p >
Start by editing the following properties (see Figure 7.5):
< ul >
< li >
2013-10-16 21:57:02 +08:00
Change the Name to 'VM Running'.
2009-05-10 06:57:45 +08:00
< / li >
< li >
2013-10-16 21:57:02 +08:00
Enter the Pool Name: 'myDatabase' (same as in the configuration element)
2009-05-10 06:57:45 +08:00
< / li >
< li >
Enter the SQL Query String field.
< / li >
2013-10-16 21:57:02 +08:00
< li >
Enter the Parameter values field with 'Running' value.
< / li >
< li >
Enter the Parameter types with 'VARCHAR'.
< / li >
2009-05-10 06:57:45 +08:00
< / ul >
< / p >
2013-10-16 21:57:02 +08:00
< p > < table border = "0" cellspacing = "0" cellpadding = "0" > < tr > < td > < img src = "../images/screenshots/jdbctest/JDBCRequest2.png" / > < br >
2009-05-10 06:57:45 +08:00
< font size = "-1" >
2013-10-16 21:57:02 +08:00
Figure 7.5. JDBC Request for the first SQL request
2009-05-10 06:57:45 +08:00
< / font > < / td > < / tr > < / table > < / p >
< p >
Next, add the second JDBC Request and edit the following properties (see
2007-07-04 07:23:51 +08:00
Figure 7.6):
2008-05-28 02:05:49 +08:00
2009-05-10 06:57:45 +08:00
< ul >
2008-05-28 02:05:49 +08:00
2009-05-10 06:57:45 +08:00
< li >
2013-10-16 21:57:02 +08:00
Change the Name to 'VM Expunging'.
2009-05-10 06:57:45 +08:00
< / li >
< li >
2013-10-16 21:57:02 +08:00
Change the value of Parameter values to 'Expunging'.
2009-05-10 06:57:45 +08:00
< / li >
2008-05-28 02:05:49 +08:00
2009-05-10 06:57:45 +08:00
< / ul >
2008-05-28 02:05:49 +08:00
2009-05-10 06:57:45 +08:00
< / p >
2013-10-16 21:57:02 +08:00
< p > < table border = "0" cellspacing = "0" cellpadding = "0" > < tr > < td > < img src = "../images/screenshots/jdbctest/JDBCRequest3.png" / > < br >
2009-05-10 06:57:45 +08:00
< font size = "-1" >
2013-10-16 21:57:02 +08:00
Figure 7.6. JDBC Request for the second request
2009-05-10 06:57:45 +08:00
< / font > < / td > < / tr > < / table > < / p >
< / blockquote >
< / p >
< / td > < / tr >
< tr > < td > < br > < / td > < / tr >
< / table >
< table border = "0" cellspacing = "0" cellpadding = "2" width = "100%" >
< tr > < td bgcolor = "#525D76" >
< font color = "#ffffff" face = "arial,helvetica,sanserif" >
2011-08-01 03:18:54 +08:00
< a name = "adding_listener" > < strong > 7.3 Adding a Listener to View/Store the Test Results< / strong > < / a > < a class = "sectionlink" href = "#adding_listener" title = "Link to here" > ¶ < / a > < / font >
2009-05-10 06:57:45 +08:00
< / td > < / tr >
< tr > < td >
< blockquote >
< p >
The final element you need to add to your Test Plan is a
< a href = "component_reference.html#listeners" >
Listener
< / a >
. This element is
2007-07-04 07:23:51 +08:00
responsible for storing all of the results of your JDBC requests in a file
2013-10-16 21:57:02 +08:00
and presenting the results.
2009-05-10 06:57:45 +08:00
< / p >
< p >
2013-10-16 21:57:02 +08:00
Select the
< i >
JDBC Users
< / i >
element and add a
< a href = "../usermanual/component_reference.html#Summary_Report" > Summary Report< / a >
listener (
< b >
Add
< / b >
-->
< b >
Listener
< / b >
-->
< b >
Summary Report
< / b >
).
< / p >
< p >
Save the test plan, and run the test with the menu
< b >
Run
< / b >
-->
< b >
Start
< / b >
or
< b >
Ctrl+R
< / b >
< / p >
< p >
The listener shows the results.
2009-05-10 06:57:45 +08:00
< / p >
2013-10-16 21:57:02 +08:00
< p > < table border = "0" cellspacing = "0" cellpadding = "0" > < tr > < td > < img src = "../images/screenshots/jdbctest/jdbc-results.png" / > < br >
2009-05-10 06:57:45 +08:00
< font size = "-1" >
2008-05-28 02:05:49 +08:00
Figure 7.7. Graph results Listener
2009-05-10 06:57:45 +08:00
< / font > < / td > < / tr > < / table > < / p >
< / blockquote >
< / p >
< / td > < / tr >
< tr > < td > < br > < / td > < / tr >
< / table >
2013-10-16 21:57:02 +08:00
< br >
2009-05-10 06:57:45 +08:00
< table >
< tr >
< td bgcolor = "#525D76" >
< div align = "right" > < a href = "index.html" > < font size = -1 color = "#ffffff" face = "arial,helvetica,sanserif" > Index< / font > < / a > < / div >
< / td >
< td bgcolor = "#525D76" >
< div align = "right" > < a href = "build-ftp-test-plan.html" > < font size = -1 color = "#ffffff" face = "arial,helvetica,sanserif" > Next< / font > < / a > < / div >
< / td >
< td bgcolor = "#525D76" >
< div align = "right" > < a href = "build-adv-web-test-plan.html" > < font size = -1 color = "#ffffff" face = "arial,helvetica,sanserif" > Prev< / font > < / a > < / div >
< / td >
< / tr >
< / table >
< / td >
< / tr >
< tr > < td colspan = "2" >
< hr noshade size = "1" / >
< / td > < / tr >
< tr > < td colspan = "2" >
< div align = "center" > < font color = "#525D76" size = "-1" > < em >
2013-01-24 18:35:27 +08:00
Copyright © 1999-2013, Apache Software Foundation
2009-05-10 06:57:45 +08:00
< / em > < / font > < / div >
< / td > < / tr >
2009-06-14 00:59:15 +08:00
< tr > < td colspan = "2" >
< div align = "center" > < font color = "#525D76" size = "-1" >
2011-09-28 23:03:18 +08:00
Apache, Apache JMeter, JMeter, the Apache feather, and the Apache JMeter logo are
trademarks of the Apache Software Foundation.
2009-06-14 00:59:15 +08:00
< / font >
< / div >
< / td > < / tr >
2009-05-10 06:57:45 +08:00
< / table >
< / body >
< / html >
2008-05-28 02:05:49 +08:00
<!-- end the processing -->
2013-10-16 21:57:02 +08:00
2008-05-28 02:05:49 +08:00
2011-08-01 03:18:54 +08:00
2008-05-28 02:05:49 +08:00