Skip to content

Cannot connect to specific database instance #129

Open
@phunsberger

Description

@phunsberger

Bug Report

For a traditional JDBC connection to a SQL Server instance instance the connection string (at least on Windows) would resemble:

jdbc:sqlserver://host\instanceName

with r2dbc if I include the instance as part of the database host, the host it isn't found. If I try to include it as part of the database name I get the error:

Connection refused: no further information: localhost/127.0.0.1:1433

I've tried about a dozen different ways to format it, all but give the same error. If I change the credentials I get the expected authentication error so they seem to be getting passed properly. From what I can tell this either not implemented or a bug?

Versions

io.r2dbc: 0.8.0.RELEASE
spring-data-r2dbc: 1.0.0.RELEASE
spring-framework-cloud: 2.2.0

  • Database:
    MSSQL Server 2017

  • Java:
    Kotlin on JVM 1.8

  • OS:
    Windows 10 Enterprise 10.0.17134

Current Behavior

Connection refused

Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: no further information: localhost/127.0.0.1:1433 Caused by: java.net.ConnectException: Connection refused: no further information at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.8.0_191] at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) ~[na:1.8.0_191] at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:330) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final] at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:334) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:688) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:635) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:552) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:514) ~[netty-transport-4.1.43.Final.jar:4.1.43.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1050) ~[netty-common-4.1.43.Final.jar:4.1.43.Final] at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.43.Final.jar:4.1.43.Final] at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.43.Final.jar:4.1.43.Final] at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_191]
N/A
Open class TestServiceConfig @Autowired constructor(private val properties: TestServiceProperties) : AbstractR2dbcConfiguration() {
@Bean
override fun connectionFactory(): ConnectionFactory {
      return MssqlConnectionFactory(
            builder().host( properties.host!! )
                    .database( properties.database!! )
                    .username( properties.username!!)
                    .password( properties.password!!).build() )
}

}

Steps to reproduce

Any connection attempt causes the error

Expected behavior/code

A connection to the database

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions