【发布时间】:2021-06-22 11:09:46
【问题描述】:
我需要访问位于本地主机上的 MS SQL Server 2012。问题是,每当我尝试发送 HTTP POST 请求(调用在数据库内部写入的方法)时,都会收到以下错误:
com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'admin'. ClientConnectionId:e2b2c522-55c6-406f-9762-fcd36e8472d1
有什么建议吗?
application.properties
spring.datasource.jdbcUrl=jdbc:postgresql://localhost:5432/depiva_test_localhost
spring.datasource.username=postgres
spring.datasource.password=password
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
spring.jpa.hibernate.show-sql=true
spring.jpa.hibernate.ddl-auto=update
spring.datasource.second.jdbcUrl=jdbc:sqlserver://localhost;databaseName=BetonWinSQL;
spring.datasource.second.username=admin
spring.datasource.second.password=mypassword
【问题讨论】:
-
您能否更新您的问题以显示您如何使用
spring.datasource.second.*属性来定义DataSourcebean?
标签: sql spring spring-boot mssql-jdbc