Spring Boot connectable in Microsoft Sql Server database

Asked

Viewed 839 times

2

I’m trying to connect in Sql Server 2008 database, but this giving this error:

com.microsoft.sqlserver.jdbc.Sqlserverexception: Connection to ERSERVER host failed, instance named sqlern_desenv. Error: "java.net.Sockettimeoutexception: Receive timed out". Check the server and instance names and make sure no firewall is blocking UDP traffic to port 1434. For SQL Server 2005 or later, make sure 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>

Someone has an example of connection?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.