mssqllibR2DBC for SQL Server

Installation

Depend on org.mssqllib.r2dbc.mssql:r2dbc-mssql. Remove io.r2dbc:r2dbc-mssql from the same classpath.

Maven

pom.xml
<dependency>
  <groupId>org.mssqllib.r2dbc.mssql</groupId>
  <artifactId>r2dbc-mssql</artifactId>
  <version>1.0.1</version>
</dependency>

Gradle

Groovy
implementation "org.mssqllib.r2dbc.mssql:r2dbc-mssql:1.0.1"
Kotlin
implementation("org.mssqllib.r2dbc.mssql:r2dbc-mssql:1.0.1")

Maven Central

Depend on version 1.0.1. No extra repository block is required.

One provider

io.r2dbc:r2dbc-mssql must not stay on the classpath. Both drivers register a service at META-INF/services/io.r2dbc.spi.ConnectionFactoryProvider. This driver's file names org.mssqllib.r2dbc.mssql.TdsConnectionFactoryProvider. Which provider answers ConnectionFactories.get is then undefined.

The provider's driver id is mssql only. The name sqlserver is not accepted. A URL written for the other driver often uses r2dbc:sqlserver: or omits the port. Both have to change. See Migration.

What the jar brings in

DependencyVersion declared by this driver
io.r2dbc:r2dbc-spi1.0.0.RELEASE
io.projectreactor:reactor-core3.8.7
org.slf4j:slf4j-api2.0.18

The runtime jar does not include an SLF4J binding. A plain program needs one on the classpath. Spring Boot supplies Logback. The driver does not ship a logback.xml.

Connection pooling is not inside this jar. Use io.r2dbc:r2dbc-pool, or Spring Boot's pool from spring-boot-starter-data-r2dbc. validate, postAllocate, and preRelease tell a pool to drop a socket the peer has already closed.

A Spring Boot application that wants Boot's Reactor version can exclude reactor-core from this dependency. The sibling sample AzureTdsClient does that. See Spring Boot.

Java and the module

The compiler release is Java 17. On the module path the module name is org.tdslib.r2dbc.mssql. It exports org.mssqllib.r2dbc.mssql and provides TdsConnectionFactoryProvider. Types under org.mssqllib.r2dbc.mssql.security are not exported. Classpath applications, including typical Spring Boot programs, can still load them. A modular application should configure login with the options in the exported package.