Install MariaDB Connector/R2DBC
This page is part of MariaDB's Documentation.
The parent of this page is: Using the Native R2DBC API of MariaDB Connector/R2DBC
Topics on this page:
Overview
MariaDB Connector/R2DBC is usually installed using Maven or by manually downloading the JAR file. The Maven build process connects to repositories to download and install dependencies, including MariaDB Connector/R2DBC and any other specified dependencies your application may require.
When downloading MariaDB Connector/R2DBC, you must manually add dependencies to your Java CLASSPATH
.
Install MariaDB Connector/R2DBC via JAR
To download the JAR file manually:
Go to the MariaDB Connector/R2DBC download page
Ensure the "Product" dropdown reads "R2DBC connector."
In the "Version" dropdown, select the version you want to download.
Click the "Download" button to download the JAR file.
When the JAR file finishes downloading, place it into the relevant directory on your system.
If you plan to use Connection Pools, download the JAR file for the r2dbc-pool package, and place it into the relevant directory on your system.
Confirm that the relevant JAR files are in your Java
CLASSPATH
.
Install MariaDB Connector/R2DBC via Maven
Add the
r2dbc-mariadb
package as a dependency for your application to your application'spom.xml
file.To install the latest Connector/R2DBC 1.0 release, add the following:
<dependency> <groupId>org.mariadb</groupId> <artifactId>r2dbc-mariadb</artifactId> <version>1.0.3</version> </dependency>
To install the latest Connector/R2DBC 1.2 release, add the following:
<dependency> <groupId>org.mariadb</groupId> <artifactId>r2dbc-mariadb</artifactId> <version>1.2.2</version> </dependency>
If you plan to use Connection Pools, add the r2dbc-pool package as an additional dependency for your application to your application's
pom.xml
file.For Connector/R2DBC 1.0:
<dependency> <groupId>io.r2dbc</groupId> <artifactId>r2dbc-pool</artifactId> <version>0.8.7.RELEASE</version> </dependency>
For Connector/R2DBC 1.2:
<dependency> <groupId>io.r2dbc</groupId> <artifactId>r2dbc-pool</artifactId> <version>0.9.0.M2</version> </dependency>
Run Maven to build your application:
$ mvn package
During the build process, Maven downloads and installs MariaDB Connector/R2DBC and other dependencies from the relevant repositories. After the build process completes and the MariaDB Connector/R2DBC has been installed, it can be used in a Java application.