0

I am using SQL server 2016.

and my application.property file is

spring.datasource.data-username=DDS-NA/njain

spring.datasource.data-password=

spring.datasource.url=jdbc:sqlserver://localhost;databaseName=photo-app

spring.jpa.hibernate.ddl-auto=update

spring.jpa.hibernate.dialect=org.hibernate.dialect.SQLServer2012Dialect

enter image description here

I am getting "Cannot load driver class: com.microsoft.sqlserver.jdbc.SQLServerDriver" error. could someone guide me?

Akira
  • 21
  • 2
  • 7
  • Add the integratedSecurity=true to JDBC URL: `jdbc:sqlserver://<>:<>;databasename=<>;integratedsecurity=true` References in [here](https://stackoverflow.com/a/48980393/8207836) spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver spring.jpa.hibernate.dialect=org.hibernate.dialect.SQLServer2012Dialect – huytmb Nov 24 '18 at 14:44
  • This link can help you https://springframework.guru/configuring-spring-boot-for-microsoft-sql-server/ – Jonathan JOhx Nov 24 '18 at 14:45
  • Tried it too,not working. – Akira Nov 24 '18 at 15:30

1 Answers1

1

Please download the drivers from here

Add the jar to your project Right Click on project - > Build Path -> Configure Build Path - > Libraries -> Add External JARs

And add the integratedSecurity=true to JDBC URL: jdbc:sqlserver://<<Server>>:<<Port>>;databasename=<<DatabaseName>>;integratedsecurity=true

You don't have to specify username and password for Windows Authentication

Moddasir
  • 1,449
  • 13
  • 33
Anish Kumar
  • 103
  • 10