mariadb-connector-r2dbc-install

Installs and configures the MariaDB Connector/R2DBC reactive driver for Java applications.

28|115|Updated Jan 28, 2025
One-click install
npx skills add https://github.com/mariadb-corporation/mariadb-docs --skill mariadb-connector-r2dbc-install-mariadb-corporation
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mariadb-connector-r2dbc-install
Source: https://github.com/mariadb-corporation/mariadb-docs/tree/main/agent-skills/granular/connectors/mariadb-connector-r2dbc-install
Command: npx skills add https://github.com/mariadb-corporation/mariadb-docs --skill mariadb-connector-r2dbc-install-mariadb-corporation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Adding a reactive MariaDB driver to a Java build is error-prone because the R2DBC connector differs from the JDBC driver in artifact coordinates, URL scheme, connection factory wiring, pooling, and TLS defaults, and common assumptions carried over from JDBC silently break the setup. ## Core Features & Use Cases - Build Integration: Provides the correct Maven and Gradle coordinates for org.mariadb:r2dbc-mariadb plus the separate io.r2dbc:r2dbc-pool dependency needed for connection pooling. - ConnectionFactory Configuration: Shows URL-based (r2dbc:mariadb://) and programmatic MariadbConnectionConfiguration setup, including Unix socket connections and parameter names that differ from JDBC (username, socket). - TLS and Pooling Setup: Explains that sslMode defaults to DISABLE, how to enable VERIFY_FULL with serverSslCert, how to disable system truststore fallback, and how to wrap a factory in an R2DBC ConnectionPool. - Use Case: A developer building a Spring Data R2DBC service adds the driver, wires a ConnectionFactory with mutual TLS, and configures a 20-connection pool without falling into JDBC-driver traps like DriverManager or jdbc: URLs. ## Quick Start Ask the AI to add the MariaDB R2DBC driver to your Maven or Gradle build and configure a pooled, TLS-enabled ConnectionFactory for your database host.

Frequently Asked Questions about mariadb-connector-r2dbc-install

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add the MariaDB R2DBC driver to a Maven project?▼

Add the dependency org.mariadb:r2dbc-mariadb (for example version 1.4.2) to your pom.xml. If the application pools connections, also add io.r2dbc:r2dbc-pool, since pooling is a separate dependency and nothing pools by default.

What is the difference between MariaDB Connector/J and Connector/R2DBC?▼

Connector/J is the blocking JDBC driver with artifact org.mariadb.jdbc:mariadb-java-client, while Connector/R2DBC is the reactive driver org.mariadb:r2dbc-mariadb implementing the R2DBC SPI. The JDBC driver cannot serve an R2DBC ConnectionFactory.

How do I create a connection with the MariaDB R2DBC driver?▼

R2DBC has no DriverManager. Obtain a factory with ConnectionFactories.get("r2dbc:mariadb://user:pass@host:3306/db") or build a MariadbConnectionConfiguration and pass it to MariadbConnectionFactory.

Does the MariaDB R2DBC driver enable TLS by default?▼

No, sslMode defaults to DISABLE, so nothing is encrypted until you set sslMode to trust, verify-ca, or verify-full. You can then tune trust with serverSslCert or a truststore and set fallbackToSystemTrustStore=false for exclusive trust.

Why does my R2DBC configuration fail when I use the user parameter?▼

The MariaDB R2DBC driver uses the parameter name username, not user. Similarly, the Unix socket parameter is socket, not socketPath or localSocket, which differs from the JDBC driver's naming.

Can I use connection pooling with MariaDB Connector/R2DBC?▼

Yes, but pooling requires the separate io.r2dbc:r2dbc-pool dependency, which wraps any ConnectionFactory. Build a ConnectionPoolConfiguration with settings like maxSize and maxIdleTime, then create a ConnectionPool, which itself acts as a ConnectionFactory.