mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
修正Oracle Driver下 FilterChainImpl的unwrap的bug
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@322 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -92,15 +92,30 @@ public class FilterChainImpl implements FilterChain {
|
||||
if (this.pos < filterSize) {
|
||||
return nextFilter().isWrapperFor(this, wrapper, iface);
|
||||
}
|
||||
|
||||
// // if driver is for jdbc 3.0
|
||||
if (iface.isAssignableFrom(wrapper.getClass())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return wrapper.isWrapperFor(iface);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <T> T unwrap(Wrapper wrapper, Class<T> iface) throws SQLException {
|
||||
if (this.pos < filterSize) {
|
||||
return nextFilter().unwrap(this, wrapper, iface);
|
||||
}
|
||||
|
||||
if (iface == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// if driver is for jdbc 3.0
|
||||
if (iface.isAssignableFrom(wrapper.getClass())) {
|
||||
return (T) wrapper;
|
||||
}
|
||||
|
||||
return wrapper.unwrap(iface);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user