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?

3
  • Add the integratedSecurity=true to JDBC URL: jdbc:sqlserver://<<Server>>:<<Port>>;databasename=<<DatabaseName>>;integratedsecurity=true References in here spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver spring.jpa.hibernate.dialect=org.hibernate.dialect.SQLServer2012Dialect Commented Nov 24, 2018 at 14:44
  • This link can help you springframework.guru/… Commented Nov 24, 2018 at 14:45
  • Tried it too,not working. Commented Nov 24, 2018 at 15:30

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.