add testcase & bug fixed

This commit is contained in:
wenshao
2012-08-26 09:18:16 +08:00
parent 994b773242
commit 21c1b1da5d
7 changed files with 235 additions and 2 deletions
@@ -23,6 +23,7 @@ import java.sql.Blob;
import java.sql.CallableStatement;
import java.sql.Clob;
import java.sql.NClob;
import java.sql.PreparedStatement;
import java.sql.Ref;
import java.sql.ResultSet;
import java.sql.RowId;
@@ -1076,7 +1077,7 @@ public class DruidPooledCallableStatement extends DruidPooledPreparedStatement i
@SuppressWarnings("unchecked")
public <T> T unwrap(Class<T> iface) throws SQLException {
if (iface == CallableStatement.class) {
if (iface == CallableStatement.class || iface == PreparedStatement.class) {
if (stmt instanceof CallableStatementProxy) {
return stmt.unwrap(iface);
}
@@ -612,7 +612,7 @@ public class CallableStatementProxyImpl extends PreparedStatementProxyImpl imple
@SuppressWarnings("unchecked")
public <T> T unwrap(Class<T> iface) throws SQLException {
if (iface == PreparedStatement.class) {
if (iface == PreparedStatement.class || iface == CallableStatement.class) {
return (T) statement;
}