support spring Jdbc4NativeJdbcExtractor

This commit is contained in:
wenshao
2012-01-04 16:16:09 +08:00
parent 408b5c778f
commit e7c4095020
15 changed files with 224 additions and 109 deletions
@@ -25,6 +25,7 @@ import java.util.List;
import com.alibaba.druid.logging.Log;
import com.alibaba.druid.logging.LogFactory;
import com.alibaba.druid.proxy.jdbc.StatementProxy;
/**
* @author wenshao<szujobs@hotmail.com>
@@ -578,4 +579,16 @@ public class DruidPooledStatement extends PoolableWrapper implements Statement {
public boolean isCloseOnCompletion() throws SQLException {
return false;
}
@SuppressWarnings("unchecked")
public <T> T unwrap(Class<T> iface) throws SQLException {
if (iface == Statement.class) {
if (stmt instanceof StatementProxy) {
return stmt.unwrap(iface);
}
return (T) stmt;
}
return super.unwrap(iface);
}
}