Prerequisites: Install the JDBC driver First
Driver download link address :http://pan.baidu.com/s/1bpDpjSr Password:v6tn
after downloading the decompression, say sqljdbc4.jar place jmeter installation directory /lib ; restart after copying JMeter;
1. test Plan -Configure drivers
The bottom right corner of the test plan, click Browse, select the jdbc driver
650) this.width=650; "Src=" http://img.blog.csdn.net/20161012185928700?watermark/2/text/ Ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/center "Style=" Border:none;height:auto; "/>
2. add a thread group
Right-click the test Plan --add--Thread--Threads Group
650) this.width=650; "Src=" http://img.blog.csdn.net/20161012185939732?watermark/2/text/ Ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/center "Style=" Border:none; "/>
3. Add configuration element JDBC Connection Config
650) this.width=650; "Src=" http://img.blog.csdn.net/20161012185947895?watermark/2/text/ Ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/center "Style=" Border:none;height:auto; "/>
4. Configure the JDBC Connection configuration
650) this.width=650; "Src=" http://img.blog.csdn.net/20161012185958973?watermark/2/text/ Ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/center "Style=" Border:none;height:auto; "/>
The parameters that need to be configured are:
(1) Variable name: test Span style= "font-family: ' The song Body '; > follow jdbc Request
(2) Database url: jdbc:sqlserver : //192.168.1.2:1222 ; DatabaseName = DBname ( > Everybody write what's right, I'll write it for convenience. ip: port number );
(3) JDBC Driver class:com.microsoft.jdbc.sqlserver.SQLServerDriver (SQL Server fixed notation, different for each database );
(4) Username the user name and password of the Password database;
The Configuration reference tablefor the Database URL (also available inJMeter 's help ) is shown below:
650) this.width=650; "Src=" http://img.blog.csdn.net/20161012190033498?watermark/2/text/ Ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/center "Style=" Border:none;height:auto; "/>
5. Add JDBC Request
650) this.width=650; "Src=" http://img.blog.csdn.net/20161012190152156?watermark/2/text/ Ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/center "Style=" Border:none;height:auto; "/>
6. Configure the JDBC Request parameter
650) this.width=650; "Src=" http://img.blog.csdn.net/20161012190046599?watermark/2/text/ Ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/center "Style=" Border:none; "/>
7. Adding listeners
650) this.width=650; "Src=" http://img.blog.csdn.net/20161012190208985?watermark/2/text/ Ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/center "Style=" Border:none; "/>
8. run to see the results
650) this.width=650; "Src=" http://img.blog.csdn.net/20161012190221079?watermark/2/text/ Ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/center "Style=" Border:none; "/>
9. stress test on query conditions
Thread group threads and loops are all 1;
selected JDBC Request Right-click Insert ancestor--Logic controller--loop controller
650) this.width=650; "Src=" http://img.blog.csdn.net/20161012190231412?watermark/2/text/ Ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/center "Style=" Border:none;height:auto; "/>
Set loop controller cycle times
650) this.width=650; "Src=" http://img.blog.csdn.net/20161012190250006?watermark/2/text/ Ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/center "Style=" Border:none;height:auto; "/>
The results can be viewed through the monitor -aggregation report;
This article from the "32 Krypton" blog, reproduced please contact the author!
JMeter connecting SQL Server database for stress testing