java sql - No suitable driver found for jdbc:sqlserver

1
Hi guys,  We are currently running mendix 7.23.17 and prepping to upgrade to 8.18.22. (On premise solution) We have a java action that connects to a msSql database and retrieves data.  Extracts of our current code: In our userlib we have sqljdbc.jar and sqljdbc4.jar import java.sql…. ... connectionString = "jdbc:sqlserver://" + dbServer + ";" +         "databaseName=" + dbName;         …..   Now after the upgrade to mendix 8 in uat and having  Eclipse Adoptioum jdk-11.0.17.8-hotspot set as the java version. ie was C:\Program Files\Java\jdk1.8.0_192 now is  C:\Program Files\Eclipse Adoptium\jdk-11.0.17.8-hotspot   we get a Connection Error  replication.ReplicationSettings$MendixReplicationException: Connection Error Caused by: java.sql.SQLException: No suitable driver found for jdbc:sqlserver://….   Seem we need to use update jar files for sqljdbc4.jar that works with java 11. But I have tried all jar files I can and placed them in user lib for Mendix studio that after deployment is on our server.  But still keep on getting this error. sqljdbc.jar originals we had in mendix 7 sqljdbc4.jar originals we had in mendix 7 New ones I tried: mssql-jdbc-12.2.0.jre11.jar mssql-jdbc-7.4.1.jre11.jar mssql-jdbc-12.2.0.jre11.jar Anyone have had this issue with an upgrade?
asked
4 answers
0

Hi Frankie Dumas,

 

Can you give a try with com.microsoft.sqlserver.mssql-jdbc-9.4.0.jre11.jar and check there is only one version of mssql jar.
Before running your application, do delete the `deployment` folder in the app directory.

 

Thanks.
Manoj Vutukuri

answered
0

Hi Frankie Dumas,

Can you try with the following flags.

encrypted=true
trustServerCertificate=true

If the above doesn't work please check the below link.
https://learn.microsoft.com/en-us/sql/connect/jdbc/connecting-with-ssl-encryption?view=sql-server-ver16

answered
0

DriverManager.getDrivers(); java.security.Security.setProperty("jdk.tls.disabledAlgorithms","SSLv3, RC4, DES, MD5withRSA, DH keySize < 1024,EC keySize < 224, 3DES_EDE_CBC, anon, NULL"); connectionString = "jdbc:sqlserver://" + dbServer + ";" + "//databaseName=" + dbName + ";sslProtocol=TLSv1";DriverManager.getDrivers(); java.security.Security.setProperty("jdk.tls.disabledAlgorithms","SSLv3, RC4, DES, MD5withRSA, DH keySize < 1024,EC keySize < 224, 3DES_EDE_CBC, anon, NULL"); connectionString = "jdbc:sqlserver://" + dbServer + ";" + "//databaseName=" + dbName + ";sslProtocol=TLSv1";

answered
0

You should enable tls1.2 on the sql server

https://support.microsoft.com/en-us/topic/kb3135244-tls-1-2-support-for-microsoft-sql-server-e4472ef8-90a9-13c1-e4d8-44aad198cdbe

answered