mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improve java.sql.Wrapper support
This commit is contained in:
@@ -98,7 +98,7 @@ public class MockConnection extends ConnectionBase implements Connection {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <T> T unwrap(Class<T> iface) throws SQLException {
|
||||
if (iface == MockConnection.class) {
|
||||
if (iface.isInstance(this)) {
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public class MockConnection extends ConnectionBase implements Connection {
|
||||
|
||||
@Override
|
||||
public boolean isWrapperFor(Class<?> iface) throws SQLException {
|
||||
return iface == MockConnection.class;
|
||||
return iface.isInstance(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user