$Proxy4 cannot be cast to java.sql.Connection

2016-7-23 流沙 JAVA

用动态代理调用连接池出现问题, 不太懂得原理, 只找到了解决方法: 原代码出错位置; Connection proxyConn = (Connection) Proxy.newProxyInstance(TestMyData.class.getClassLoader(), conn.getClass().getInterfaces(), new InvocationHandler() { @Override public Object invoke(Object proxy, Method method, Object...

阅读全文>>

标签: 动态代理

评论(0) 浏览(381)


Powered by 流沙团