有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java spring:通过集成身份验证为sql server配置属性

我在java spring中有一个简单的应用程序,但我无法配置与本地sql server数据库的连接,该数据库与windows集成了身份验证

我的财产

    spring.datasource.url=jdbc:sqlserver://localhost;databaseName=mydatabase
    spring.integratedSecurity=true
    spring.datasource.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
    spring.jpa.hibernate.dialect=org.hibernate.dialect.SQLServer2012Dialect
    spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
    spring.datasource.testOnBorrow=false
    spring.datasource.validationQuery=SELECT 1

我的数据库配置

enter image description here

com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.

谢谢


共 (1) 个答案