Spring Boot connecting to the Microsoft Sql Server database

2

I'm trying to connect to SQl Server 2008, but I'm giving this error:

  

com.microsoft.sqlserver.jdbc.SQLServerException: Failed to connect to host ERSERVER, named instance \ sqlern_desenv. Error: "java.net.SocketTimeoutException: Receive timed out". Check the server and instance names and verify that no firewall is blocking UDP traffic to port 1434. For SQL Server 2005 or later, make sure that the SQL Server Browser service is running on the host

application.properties:

datasource:
  bar:
    url: jdbc:postgresql://localhost:5432/ER_NETWORK
    username: postgres
    password: 123

  foo:
    url: jdbc:sqlserver://ERSERVER:\SQLERN_DESENV;database=BD_TESTE;integratedSecurity=true
    driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
    username: sa
    password: 123

pom.xml

<dependency>
    <groupId>com.microsoft.sqlserver</groupId>
    <artifactId>sqljdbc4</artifactId>
    <version>4.0</version>
    <scope>test</scope>
</dependency>

Does anyone have a connection example?

    
asked by anonymous 25.10.2017 / 17:56

0 answers