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

com.github.phantomthief.failover.impl.checker.DataSourceChecker Maven / Gradle / Ivy

There is a newer version: 0.1.32
Show newest version
package com.github.phantomthief.failover.impl.checker;

import java.sql.Connection;

import javax.sql.DataSource;

/**
 * @author w.vela
 */
public class DataSourceChecker {

    public static boolean test(DataSource t) {
        try (Connection conn = t.getConnection()) {
            return conn != null;
        } catch (Throwable e) {
            return false;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy