Install MariaDB Connector/R2DBC

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:

  1. Go to the MariaDB Connectors download page:

  2. In the "Product" drop-down, select "r2dbc connector."

  3. Click the "Download" button to download the JAR file.

  4. When the JAR file finishes downloading, place it into the relevant directory on your system.

  5. 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.

  6. Confirm that the relevant JAR files are in your Java CLASSPATH.

Install MariaDB Connector/R2DBC via Maven

  1. Add the r2dbc-mariadb package as a dependency for your application to your application's pom.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.1 RC release, add the following:

    <dependency>
       <groupId>org.mariadb</groupId>
       <artifactId>r2dbc-mariadb</artifactId>
       <version>1.1.1-rc</version>
    </dependency>
    
  2. 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.1 RC:

    <dependency>
        <groupId>io.r2dbc</groupId>
        <artifactId>r2dbc-pool</artifactId>
        <version>0.9.0.M2</version>
    </dependency>
    
  3. 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.