SQLException: No suitable driver found for jdbc:jtds:sqlserver: after maven build

Answered

Hi. I trying to set up connection to mssql with AD account.

This code works in intelij:

String url ="jdbc:jtds:sqlserver://"+selected_server+";user="+user_name+";password="+user_password+domain+"";
conn = DriverManager.getConnection(url);
stmt = conn.createStatement();
stmt.executeQuery(query);

But after jar build with maven, I'm get SQLException: No suitable driver found for jdbc:jtds:sqlserver


maven build package with maven-assembly-plugin.
here is pom: https://pastebin.com/CprXdrYT
any suggestions?

0
3 comments

Hello,

Please check that driver jar is added into your application jar file.

0
Avatar
Permanently deleted user

Yes it is in jar

0

Please check possible solution: https://stackoverflow.com/a/12298606/2960034

0

Please sign in to leave a comment.