jdbc: java.sql.SQLException: No suitable driver found for jdbc:sqlserver

339 views
Skip to first unread message

GIRISH K S

unread,
Dec 23, 2020, 10:04:53 AM12/23/20
to Gatling User Group
I am getting java.sql.SQLException: No suitable driver found for jdbc:sqlserver: exception. i have included following dependency in my build.gradle file 'implementation group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: '8.4.1.jre11''.

I also tried including 'Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver")', it did not help. Now i am getting 'java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver'.


Stéphane LANDELLE

unread,
Dec 23, 2020, 5:10:22 PM12/23/20
to gat...@googlegroups.com
2 possibilities:
  1. the jar is not in the classpath
  2. the jar in your local cache was corrupted during download and can't be unzipped, so the JVM just skips it silently. Try to locate it and check if you can unzip it. If not, remove it to trigger download again

Logo Stéphane Landelle
Chief Technical Officer
twitter: @slandelle
site:
gatling.io




On Wed, Dec 23, 2020 at 4:04 PM GIRISH K S <learn...@gmail.com> wrote:
I am getting java.sql.SQLException: No suitable driver found for jdbc:sqlserver: exception. i have included following dependency in my build.gradle file 'implementation group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: '8.4.1.jre11''.

I also tried including 'Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver")', it did not help. Now i am getting 'java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver'.


--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gatling/c94f0e5d-d3fd-4ce0-b66d-7d630c5f63c8n%40googlegroups.com.

Sergey Tokmakov

unread,
Dec 29, 2021, 12:11:00 PM12/29/21
to Gatling User Group
I have the same issue locally and on the Frontline.

Screenshot_32.png

The jar is definetely in the classpath.

Screenshot_34.png


These drivers work when I connect a postgresql.

Screenshot_31.png

Stéphane, could you think of any other reason or it is just a bug?
Also, I couldn't find a support link on the Frontline page, where I run the tests.

Regards
Serhii Tokmakov
 

Stéphane LANDELLE

unread,
Dec 29, 2021, 12:35:10 PM12/29/21
to gat...@googlegroups.com
Your way of adding the dependency is wrong.
You shouldn't be editing your module's classpath on IntelliJ.
Instead, you should add a dependency in your gradle build. This way, the dependency will be there when running the gatling-gradle-plugin and when packaging for Gatling Enterprise (formerly known as FrontLine).

> Also, I couldn't find a support link on the Frontline page, where I run the tests.

There's a big "Support" button on the web UI. And links to support on our pages on the AWS and Azure marketplaces, if you purchase from there.

Cheers,

--

Stéphane Landelle

Chief Technical Officer

   

Sergey Tokmakov

unread,
Dec 29, 2021, 2:16:37 PM12/29/21
to Gatling User Group
Thank you!

It worked with this piece:

dependencies {
gatling 'postgresql:postgresql:9.1-901-1.jdbc4'
}

Reply all
Reply to author
Forward
0 new messages