I am getting an exception while running my spring boot application, it say unable to create bean of datasource and caused of this exception is that it unable to detect my Dr
Is the jar present on your system? You are forcing maven to get the dependency from the system and if it is not on that path maven will fail. Can you replace the tag with these :
<dependency>
<groupId>com.microsoft</groupId>
<artifactId>sqljdbc4</artifactId>
<version>3.0</version>
</dependency>
Source: https://mvnrepository.com/artifact/com.microsoft/sqljdbc4/3.0
You are trying to load the wrong driver. The driver with name com.microsoft.jdbc.sqlserver.SQLServerDriver
is from the very old SQL Server 2000 JDBC driver.
In the SQL Server 2005 JDBC driver, Microsoft changed this to com.microsoft.sqlserver.jdbc.SQLServerDriver
(note the switch of order between sqlserver
and jdbc
.
Side note: you are using an old version of the driver. Microsoft has open sourced the SQL Server JDBC driver and it is available on maven as:
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>6.2.2.jre8</version>
</dependency>
See https://github.com/Microsoft/mssql-jdbc for actual latest versions.