SQL Server remote connection in connecting to (master) database

时间:2019-04-08 13:46:24

标签: sql-server hibernate spring-boot wildfly

I am developing spring app which uses SQL Server as a database engine, I was using SQL Server 2012 and everything was fine

Then I migrated to SQL Server 2016 the app works well from Intellij IDEA

But when I upload it to wildfly, the used database is the "master" database, although I'm using the same connection string

Is there any configurations that need to be changed in order to use SQL Server 2016 in wildfly

Thanks in advance

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

EDIT

in the wildfly log I get this message

 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

1 个答案:

答案 0 :(得分:0)

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

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

来自standalone.xml标签中的datasource