3
votes

I'm using Jmeter 2.9 and trying to connect to SQL Server 2008.
Within JDBC Connection Configuration and have the following in my connection properties:

Database URL = jdbc:microsoft:sqlserver://x.x.x.x:1433
JDBC Driver Class = com.microsoft.sqlserver.jdbc.SQLServerDriver

I've downloaded the latest Microsoft SQL Server JDBC Drivers and placed the following jars under jmeter/lib directory: sqljdbc.jar, sqljdbc4.jar.

I'm getting the following error:

java.sql.SQLException: No suitable driver found for jdbc:microsoft:sqlserver://x.x.x.x:1433

Can you please suggest what I'm missing?

3
Have you already checked discussions displayed in Related list for your question? There is already a lot of similar questions with solutions. E.g. this one.Aliaksandr Belik
Thanks for the link Alies. That helped me narrow down the issue. The Database URL was wrong. It needed to be jdbc:microsoft:sqlserver://x.x.x.x:1433;Database=SchemaName. Also I needed only one jar file under jmeter/lib - that was sqljdbc4.jar.user2250482

3 Answers

14
votes

your solution does not work for me, here is my solution:

​Adding jdbc connection Library into Jmeter lib folder:

  1. Download the lastest jdbc driver from Microsoft

http://msdn.microsoft.com/en-us/sqlserver/aa937724.aspx

  1. Unzip the file and find which driver you need:

http://msdn.microsoft.com/en-us/library/ms378422.aspx

  1. Copy the required JAR file into jmeter/lib folder. (you need to restart the jmeter if you are running it.)

  2. in my JDBC Configuration:

     DatabaseURL: jdbc:sqlserver://localhost:port;DatabaseName=mydb;
    
     JDBC Driver Class: com.microsoft.sqlserver.jdbc.SQLServerDriver
    
     User Name: (SQL server access user name)
    
     Password: (user's password)
    
  3. Give a Variable name for the config: e.g. JDBC_Connection

  4. When you create a JDBC request, use this name in "Variable Name Bound to Pool" field.
2
votes

The only thing I can add to Vin.X's answer is that you can specify the location of your sqljdbc4.jar as a property of your test plan, by browsing for it where it says Add directory or jar to classpath

This is useful if you want to keep libs like this separate from your jMeter distribution folder, to make it easier to update jMeter for example.

2
votes

First download JDBC jar files from below link i have shared:

http://tinyurl.com/o5hgpmt

Extract all *.jar files to: C:\apache-jmeter-2.11\lib

then start JMeter

and in your JDBC Connection Configuration element write below connections as per your database:

Database URL: jdbc:jtds:sqlserver://x.x.x.x:1433;DatabaseName=yourdatabase;

JDBC Driver class: net.sourceforge.jtds.jdbc.Driver

Username: give username of the sql server database Password: give password of the sql server database

My connection is successful.. Hope this helps every body..