Connect to a MS SQL Server using Windows Authentication with a Java application

Ricardo Rubio 1 Reputation point
2022-02-16T06:58:41.657+00:00

Hello,

We are currently developing a Java application with Spring Boot that will be deployed on a Linux server. Our application must connect to an Microsoft SQL Server database and we are trying to use "Windows Authentication" as the authentication mechanism to connect to the database from our Java application.

We have tried different configurations in the JDBC connection URL, we also installed the library "mssql-jdbc_auth-<version>-<arch>.dll" but it didn't work either, we always get an authentication error.

The only way we can connect to the database is by using the "SQL Authentication" type.

Is it possible to connect to an Microsoft SQL Server database via a Java application with Spring Boot using the "Windows Authentication" type?

We really appreciate your help,
Thanks in advance

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,798 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,577 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. AmeliaGu-MSFT 13,976 Reputation points Microsoft Vendor
    2022-02-16T08:49:57.83+00:00

    Hi RicardoRubio-6206,

    Please refer to the following similar threads which might be helpful:
    Connect to MSSQL from Spring boot application using windows authentication
    java spring: configure properties for sql server with integrated authentication
    And your issue is also related to Spring Boot. I suggest you open a thread in the corresponding forum so that people there will help you more effectively.

    Regards,
    Amelia


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Ricardo Rubio 1 Reputation point
    2022-02-25T19:42:47.187+00:00

    Hi,
    Thanks for the help, we tried following the suggested documentation, however it didn't work either.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.