【JMeter连接SQLServer】采用window鉴权方式连接(原创)
大家都知道Jmeter可以连接各种数据库,这方面我也不多说了,如果你还不知道怎么连接的话,可以参看我看的另外一篇博文,这边有详细的介绍 http://blog.csdn.net/lzqinfen/article/details/38730259 回归正题,由于公司测试环境的问题,我在连接SQLServer时,
大家都知道Jmeter可以连接各种数据库,这方面我也不多说了,如果你还不知道怎么连接的话,可以参看我看的另外一篇博文,这边有详细的介绍
http://blog.csdn.net/lzqinfen/article/details/38730259
回归正题,由于公司测试环境的问题,我在连接SQLServer时,公司只能使用window方式的鉴权(通过我们的域账号验证),这下就变得麻烦了,因为本来按照普通的sqlServer连接,是很简单的如下图一样:
但现在采用window鉴权的方式,你无法再填写username和password。我想通过网上查询,包括性能技术群,都没找到相关的解决方法,再各种尝试之后终于搞定~(所以笔者认为是原创方法,应该不为过吧)
1、Java连接数据库
Jmeter是纯Java的,大家都知道自己写Java的时候,可以写成window方式连接SQLserver,所以我坚信Jmeter应该可以用同样的方法实现。Java的实现,其实是增加了一个参数
integratedSecurity= true
所以我们在JMeter里面也做下修改,如下图(前面是IP和端口。后面增加了integratedSecurity= true,注:我这边没有指定数据库名字,你可以指定也可以不指定)
2、看似没什么问题了,运行,结果报错(Jmeter命令窗口报错),
错误为:没有为集成身份验证配置驱动程序
原因是:C:\Windows 下缺少了sqljdbc_auth.dll文件
3、下载sqljdbc_auth.dll,并放到C:\Windows 下,重新启动,再次运行Ok。
下载地址:http://download.csdn.net/detail/lzqinfen/8066775
----------------------------------注意 : 雷区---------------------------------------------
1、sqljdbc_auth.dll已经放到相关目录下,但是报不是64位之类的错误。
原因是:我的是win7 64位的,下载的sqljdbc_auth包中包含x86 和64位的(各3个版本的),我找到其中的64位,随便用的一个也是报错,后来选择最新日期(3.0.1301.101这个)的那个dll 就OK了,这点大家注意下
(我Jmeter是2.8的+1.7JDK ,Jmeter2.11 版本的 用最新dll应该也没问题的,请大家验证吧~);
2、另外一点注意下:Jmeter apache-jmeter-2.8\lib 下应该有sqljdbc4.jar的 ,如果没有的话 肯定也会报错的。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The import steps are as follows: Copy the MDF file to SQL Server's data directory (usually C:\Program Files\Microsoft SQL Server\MSSQL\DATA). In SQL Server Management Studio (SSMS), open the database and select Attach. Click the Add button and select the MDF file. Confirm the database name and click the OK button.

For objects with the same name that already exist in the SQL Server database, the following steps need to be taken: Confirm the object type (table, view, stored procedure). IF NOT EXISTS can be used to skip creation if the object is empty. If the object has data, use a different name or modify the structure. Use DROP to delete existing objects (use caution, backup recommended). Check for schema changes to make sure there are no references to deleted or renamed objects.

How to connect the keep body fat scale? Keep has a specially designed body fat scale, but most users do not know how to connect the keep body fat scale. Next is the graphic tutorial on the connection method of the keep body fat scale that the editor brings to users. , interested users come and take a look! How to connect the keep body fat scale 1. First open the keep software, go to the main page, click [My] in the lower right corner, and select [Smart Hardware]; 2. Then on the My Smart Devices page, click the [Add Device] button in the middle; 3 , then select the device you want to add interface, select [Smart Body Fat/Weight Scale]; 4. Then on the device model selection page, click the [keep body fat scale] option; 5. Finally, in the interface shown below, finally [Add Now] at the bottom

When the SQL Server service fails to start, here are some steps to resolve: Check the error log to determine the root cause. Make sure the service account has permission to start the service. Check whether dependency services are running. Disable antivirus software. Repair SQL Server installation. If the repair does not work, reinstall SQL Server.

To view the SQL Server port number: Open SSMS and connect to the server. Find the server name in Object Explorer, right-click it and select Properties. In the Connection tab, view the TCP Port field.

SQL Server database files are usually stored in the following default location: Windows: C:\Program Files\Microsoft SQL Server\MSSQL\DATALinux: /var/opt/mssql/data The database file location can be customized by modifying the database file path setting.

If you accidentally delete a SQL Server database, you can take the following steps to recover: stop database activity; back up log files; check database logs; recovery options: restore from backup; restore from transaction log; use DBCC CHECKDB; use third-party tools. Please back up your database regularly and enable transaction logging to prevent data loss.

If the SQL Server installation fails, you can clean it up by following these steps: Uninstall SQL Server Delete registry keys Delete files and folders Restart the computer
