package com.alibaba.druid.pool; import java.sql.SQLException; import java.sql.Wrapper; public class WrapperAdapter implements Wrapper { public WrapperAdapter(){ } @Override public boolean isWrapperFor(Class iface) throws SQLException { if (iface == null) { return false; } if (iface.isInstance(this)) { return true; } return false; } @SuppressWarnings("unchecked") @Override public T unwrap(Class iface) throws SQLException { if (iface == null) { return null; } if (iface.isInstance(this)) { return (T) this; } return null; } }