【问题标题】:SQL Server remote connection in connecting to (master) database连接到(主)数据库的 SQL Server 远程连接
【发布时间】:2019-04-08 13:46:24
【问题描述】:

我正在开发使用 SQL Server 作为数据库引擎的 spring 应用程序,我使用的是 SQL Server 2012,一切都很好

然后我从 Intellij IDEA 迁移到 SQL Server 2016,该应用运行良好

但是当我将它上传到wildfly时,使用的数据库是“主”数据库,虽然我使用的是相同的连接字符串

是否需要更改任何配置才能在 Wildfly 中使用 SQL Server 2016

提前致谢

Intellij string
manage.doc.db.url = jdbc:sqlserver://localhost:1433;databaseName=document_springboot
wildfly string
jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=document_springboot

编辑

在 wildfly 日志中我收到此消息

 Connection Properties for DataSource: 'java:/docManagementDatabaseSQLServer' is empty, 
try to use driver-class: 'com.microsoft.sqlserver.jdbc.SQLServerDriver' and connection-url: 'jdbc:sqlserver://localhost:1433;databaseName=document_springboot' to connect database

【问题讨论】:

  • 我认为您不需要连接字符串中的microsoft:。这可能是主数据库的默认设置。
  • 感谢@WEI_DBA 的回复我删除了它但没有任何变化,我仍在访问“主”数据库
  • 连接到wildfly的用户凭据是否不同?
  • 我不这么认为,我什至为数据库@WEI_DBA指定了相同的用户名和密码

标签: sql-server hibernate spring-boot wildfly


【解决方案1】:

我通过参考这个link解决了这个问题 我删除了

<datasource-class>com.microsoft.sqlserver.jdbc.SQLServerDataSource</datasource-class>

来自datasource标签中的standalone.xml

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-12-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多