Flyway: Unable to instantiate JDBC driver: com.microsoft.sqlserver.jdbc.SQLServerDriver - Connecting to SQL Azure

Created on 20 Oct 2015  路  1Comment  路  Source: flyway/flyway

Hi,

I am struggling to resolve the JDBC Driver when trying to connect to SQL Azure(or any SQL Server database). I have managed to create a simple java program demonstrating a connection with the JDBC 4.0 driver, but I cannot seem to get the driver's class to resolve when using Flyway. The error that I get when trying to migrate is:

Flyway 3.2.1 by Boxfuse

ERROR: Unable to instantiate JDBC driver: com.microsoft.sqlserver.jdbc.SQLServerDriver

I am trying to connect to a SQL Azure Database. I working on Windows 8.1. I am using the v4.0 driver from https://www.microsoft.com/en-za/download/details.aspx?id=11774.

My ClassPath is set to ".;C:Program FilesMicrosoft JDBC DRIVER 4.0 for SQL Serversqljdbc.jar".

Here is an example of the simple program that I am using to demonstrate that I can load up the JDBC 4.0 driver: https://gist.github.com/SaberZA/24b0eb20fbf267e72f49

The connection string that I am using in the example is a copy-paste from the flyway.conf

Any assistance would be appreciated.
Thanks

Most helpful comment

I realised my error here. I have been so focused on trying to load the jar up in the classpath, instead of including the driver inside the flyway installation folder.

I resolved my problem by including sqljdbc.jar inside "flyway-3.2.1drivers".

>All comments

I realised my error here. I have been so focused on trying to load the jar up in the classpath, instead of including the driver inside the flyway installation folder.

I resolved my problem by including sqljdbc.jar inside "flyway-3.2.1drivers".

Was this page helpful?
0 / 5 - 0 ratings