Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a database created in SQL Server with the following configuration:

Also, I am trying to connect to the database named EDS.

For that I created the following details:

Should i have domain in the string or should it be in the username? When i go to the database properties i see the owner has. Also, is the url correct on the instance part according to the image? it looks like it is not able to go to that particular instance.

Also, this is the configuration for the connection (using Windows Authenticaton)

When I put in the username I am getting the following error log:

com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user '. ClientConnectionId:e812971f-b03c-4210-9dbd-de0791bcc304

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
312 views
Welcome To Ask or Share your Answers For Others

1 Answer

When specifying the location of the SQL Server instance, one normally provides serverNameinstanceName or serverName:portNumber, not both. That is, either

jdbc:sqlserver://INNOWAVE-99SQLEXPRESS01;databaseName=EDS

or

jdbc:sqlserver://localhost:1433;databaseName=EDS

(assuming that the SQLEXPRESS01 instance has been explicitly configured to listen on port 1433, which is not usually the case for a SQL Express instance).

As mentioned in the documentation for Building the Connection URL

If both a portNumber and instanceName are used, the portNumber will take precedence and the instanceName will be ignored.

There is no domain= property defined for the connection URL for Microsoft's JDBC driver for SQL Server. Logging in to the SQL Server instance with Windows domain credentials is done implicitly using the integratedSecurity=true connection property (and not explicitly providing a username and password); details here.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...