3

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?

user2250482
  • 75
  • 2
  • 3
  • 10
  • 1
    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](http://stackoverflow.com/questions/5616898/java-sql-sqlexception-no-suitable-driver-found-for-jdbcmicrosoftsqlserver). – Aliaksandr Belik Apr 05 '13 at 20:25
  • 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 Apr 05 '13 at 21:13

3 Answers3

14

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.
Vin.X
  • 4,759
  • 3
  • 28
  • 35
2

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.

James Green
  • 1,827
  • 1
  • 13
  • 13
2

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..

Rijul
  • 1,418
  • 11
  • 21
  • 1
    Thank you for your answer. Would it be possible to put a link to the original source website of the drivers for posterity (so that if someone happens across this answer in a few years ( :) ) and the link is dead they stand a chance of getting the stuff?) – GHC Aug 13 '14 at 08:15
  • @GHC don't worry mate the link is made from my personnel Google drive sharing, i think it will be safe.. but since you want links you can download jar files from http://sourceforge.net/projects/jtds/files/ and rest sqljdbc.jar and sqljdbc4.jar can be downloaded from Microsoft website for free – Rijul Aug 13 '14 at 08:49