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

org.itsallcode.jdbc.dialect.BaseDbDialect Maven / Gradle / Ivy

There is a newer version: 0.7.1
Show newest version
package org.itsallcode.jdbc.dialect;

import java.util.Locale;

/**
 * Base class for implementing a {@link DbDialect}.
 */
public abstract class BaseDbDialect implements DbDialect {
    private final String jdbcUrlPrefix;

    /**
     * Create a new instance.
     * 
     * @param jdbcUrlPrefix the JDBC URL prefix supported by this dialect
     */
    protected BaseDbDialect(final String jdbcUrlPrefix) {
        this.jdbcUrlPrefix = jdbcUrlPrefix.toLowerCase(Locale.ROOT);
    }

    @Override
    public boolean supportsUrl(final String jdbcUrl) {
        return jdbcUrl.toLowerCase(Locale.ROOT).startsWith(jdbcUrlPrefix);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy