提交 56e5beaf 编写于 作者: Z zyyang

change

上级 71bdf7bf
......@@ -2,7 +2,7 @@ package com.taosdata.jdbc;
import java.sql.*;
public abstract class AbstractStatement implements Statement {
public abstract class AbstractStatement extends WrapperImpl implements Statement {
private volatile boolean closeOnCompletion;
private int fetchSize;
......@@ -246,17 +246,4 @@ 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);
}
}
package com.taosdata.jdbc;
import java.sql.SQLException;
import java.sql.Wrapper;
public class WrapperImpl implements Wrapper {
@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);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册