修正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:
wenshao
2011-06-30 05:10:10 +00:00
parent 895c587f93
commit 920c9385eb
2 changed files with 47 additions and 0 deletions
@@ -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);
}