use of com.mchange.v2.c3p0.impl.NewProxyPreparedStatement in project druid by alibaba.
the class TestPSCache method unwrap.
public static MockPreparedStatement unwrap(PreparedStatement stmt) throws Exception {
if (stmt instanceof NewProxyPreparedStatement) {
Field field = NewProxyPreparedStatement.class.getDeclaredField("inner");
field.setAccessible(true);
return (MockPreparedStatement) field.get(stmt);
}
MockPreparedStatement mockStmt = stmt.unwrap(MockPreparedStatement.class);
return mockStmt;
}
Aggregations