Using the Native R2DBC API of MariaDB Connector/R2DBC
Learn to use the native API of MariaDB Connector/R2DBC for reactive, non- blocking database operations with fine-grained control over data access in Java applications.
Use MariaDB Connector/R2DBC directly through the native R2DBC API for reactive, non-blocking database access with fine-grained control.
Application development with the MariaDB Connector/R2DBC native API covers building Java projects with Maven or JAR, adding the connector to the classpath, and running compiled applications.
Batch operations with the MariaDB Connector/R2DBC native API group multiple DML statements into a single io.r2dbc.spi.Batch to reduce per-statement network overhead.
Connecting to MariaDB with the native R2DBC API uses MariadbConnectionConfiguration and MariadbConnectionFactory to create and manage reactive client connections via io.r2dbc.spi.Connection.
The MariaDB Connector/R2DBC native API supports connection pooling via r2dbc-pool, holding reactive connections open for reuse and configuring them with ConnectionPoolConfiguration.
DDL operations with the MariaDB Connector/R2DBC native API execute schema statements such as CREATE TABLE and ALTER TABLE reactively using io.r2dbc.spi.Statement and io.r2dbc.spi.Result.
DML with the MariaDB Connector/R2DBC native API executes INSERT, UPDATE, DELETE, and SELECT reactively using io.r2dbc.spi.Statement, Result, Row, and RowMetadata classes.
Install MariaDB Connector/R2DBC via Maven by adding the r2dbc-mariadb dependency to pom.xml, or manually by downloading the JAR and adding it to the Java CLASSPATH alongside r2dbc-pool.
Complete Java code example using the MariaDB Connector/R2DBC native API to query a MariaDB table with MariadbConnectionFactory and reactive Flux result handling.
Set up the test database, contact table, and user account required by the MariaDB Connector/R2DBC native API code examples in this documentation section.
The MariaDB Connector/R2DBC native API requires manual subscription for beginTransaction, commitTransaction, and rollbackTransaction; Spring Data R2DBC provides managed transactions.
This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

