sql server driver installation

I’m trying to connect to an SQL Server database. I get the error

ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver.

I’ve downloaded the driver, and installed the jar in WEB-INF/lib. I also added it to the Program Files directory under Windows 10. Still, it does not seem to get recognized. I’m running JRE 1.8 under Windows 10. Where am I going wrong?
Thanks
Eric

1 Like

Hi Eric,

Since platform 6.5.0 the native Microsoft SQLServer driver is used by default. It is added as a dependency to your build.gradle and downloaded automatically. Please check that your build.gradle contains:


...
def mssql = 'com.microsoft.sqlserver:mssql-jdbc:6.1.0.jre8'
...
configure(coreModule) {
...
    dependencies {
        compile(globalModule)
        provided(servletApi)
        jdbc(mssql) { exclude(group: 'com.microsoft.azure', module: 'azure-keyvault') }
        testRuntime(mssql) { exclude(group: 'com.microsoft.azure', module: 'azure-keyvault') }
...
1 Like