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

com.databricks.jdbc.commons.util.WrapperUtil Maven / Gradle / Ivy

There is a newer version: 2.6.40-patch-1
Show newest version
package com.databricks.jdbc.commons.util;

import com.databricks.jdbc.core.DatabricksSQLException;
import java.sql.SQLException;

public class WrapperUtil {
  public static boolean isWrapperFor(Class iface, Object object) {
    return iface.isInstance(object);
  }

  public static  T unwrap(Class iface, Object object) throws SQLException {
    try {
      return iface.cast(object);
    } catch (Exception exception) {
      throw new DatabricksSQLException("Cannot unwrap object to class", exception);
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy