I am trying to connect to a SQL Server 2012 Database using Hibernate 5. I am using the following connection string in order to connect to the database
jdbc:sqlserver://server;instanceName=instance;DatabaseName=database;integratedSecurity=true
As the database authentication is with Windows Credentials. However, my account has not access to it, so I need to use an application account which I have configured on Windows Credential Manager. When I connect to the database through Microsoft SQL Management Studio it works fine (it picks up the user and password from credential manager and log in to the database). But when I attempt to do it with the application it seems that it still using my primary account for authentication as it shows the following error:
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'SA\ezequiel.de-luca'. ClientConnectionId:b10e13ef-e400-4569-bb2e-be592e2d9872
I attempt to pass the credentials on the connection string, as follows
jdbc:sqlserver://server;instanceName=instance;DatabaseName=database;domain=domain;userName=user;password=passowrd
but it doesn´t work either. The same error appears, it only change the username on the exception message. Do you have any idea of how should I modify the connection string?