use jdbc to connect sql server none default instatnce database fail

China Ryerson 20 Reputation points
2024-12-12T08:48:11.82+00:00

We want to use JDBC to connect Sql server none default instance database, but always got below error:

Login failed for user 'XXX'. ClientConnectionId:92d1a0fb-49c0-45c2-968f-ded3089d6ac9

We make sure the password is correct.

If we try to connect same sqlserver's default instantce database, it's ok.

The Sqlserver's version is 2017, please give us some help, thanks.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,342 questions
{count} votes

Accepted answer
  1. Erland Sommarskog 115.8K Reputation points MVP
    2024-12-16T22:33:51.1733333+00:00

    I am not familiar with DBeaver, but your configuration looks wrong. I think Host should be KSSC-DATA\KSPIG. Database should probably be zkaccess only. It would be very odd to specify the instance name with the database rather than with the host.

    Also, try to leave the port blank. If you can't, you will need to look up the port for the KSPIG instance in SQL Server Configuration Manager.

    What is happening now is that you are connecting to the default instance on KSSC-DATA, and apparently, there is no login for zktime on this instance.

    On another note: you have replied twice by posting Answers. Answers are for answers to the questions, and you would only post an Answer if you find the solution yourself. Else you should use comments, and I converted you Answers to Comments.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.