com.clickhouse.jdbc.JdbcWrapper Maven / Gradle / Ivy
package com.clickhouse.jdbc;
import java.sql.SQLException;
public abstract class JdbcWrapper {
public T unwrap(Class iface) throws SQLException {
if (iface.isAssignableFrom(getClass())) {
return iface.cast(this);
}
throw SqlExceptionUtils.unsupportedError("Cannot unwrap to " + iface.getName());
}
public boolean isWrapperFor(Class> iface) throws SQLException {
return iface.isAssignableFrom(getClass());
}
}