All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.umlg.sqlg.MariadbPlugin Maven / Gradle / Ivy

There is a newer version: 3.0.4
Show newest version
package org.umlg.sqlg;

import org.umlg.sqlg.sql.dialect.MariadbDialect;
import org.umlg.sqlg.sql.dialect.SqlDialect;

import java.sql.DatabaseMetaData;
import java.sql.SQLException;

/**
 * @author Pieter Martin (https://github.com/pietermartin)
 *         Date: 2017/07/07
 */
public class MariadbPlugin implements SqlgPlugin{

    @Override
    public boolean canWorkWith(DatabaseMetaData metaData) throws SQLException {
        return metaData.getDatabaseProductName().toLowerCase().contains("mysql");
    }

    @Override
    public String getDriverFor(String connectionUrl) {
        return connectionUrl.startsWith("jdbc:mariadb") ? "org.mariadb.jdbc.Driver" : null;
    }

    @Override
    public SqlDialect instantiateDialect() {
        return new MariadbDialect();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy