This commit is contained in:
zyyang 2021-02-03 19:36:10 +08:00
parent ff1ab88cf3
commit 8b6b8192dc
1 changed files with 13 additions and 13 deletions

View File

@ -246,17 +246,17 @@ public abstract class AbstractStatement implements Statement {
return this.closeOnCompletion;
}
// @Override
// public <T> T unwrap(Class<T> iface) throws SQLException {
// try {
// return iface.cast(this);
// } catch (ClassCastException cce) {
// throw new SQLException("Unable to unwrap to " + iface.toString());
// }
// }
//
// @Override
// public boolean isWrapperFor(Class<?> iface) throws SQLException {
// return iface.isInstance(this);
// }
@Override
public <T> T unwrap(Class<T> iface) throws SQLException {
try {
return iface.cast(this);
} catch (ClassCastException cce) {
throw new SQLException("Unable to unwrap to " + iface.toString());
}
}
@Override
public boolean isWrapperFor(Class<?> iface) throws SQLException {
return iface.isInstance(this);
}
}