How to resolve error "Cannot load JDBC driver class" displayed in jmeter 4.0

Praveen PS picture Praveen PS · Apr 9, 2018 · Viewed 8.3k times · Source

I recently updated to jmeter 4.0 from jmeter 3.2. In jmx file, i have query to execute and it was running fine in jmeter 3.2 . But the jmx file fails with error "Response message: java.sql.SQLException: Cannot load JDBC driver class 'com.microsoft.sqlserver.jdbc.SQLServerDriver'" in jmeter 4.0. Please help me in resolving this issue.

below is the screenshot of JDBC Connection ConfigurationJDBC connection config

Answer

Dmitri T picture Dmitri T · Apr 9, 2018

You need to

  1. Download Microsoft JDBC Driver for SQL Server
  2. Extract mssql-jdbc-x.x.x.jrex.jar somewhere to JMeter Classpath
  3. Restart JMeter to pick the .jar up

See Building a Database Test Plan and How to use Different JDBC Drivers articles for more details on how to use JMeter for database testing.