提交 ff1ab88c 编写于 作者: Z zyyang

change

上级 a5f02a89
......@@ -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);
// }
}
......@@ -8,9 +8,6 @@ import org.junit.Test;
import java.sql.*;
import java.util.Properties;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class StatementTest {
static Connection connection = null;
static Statement statement = null;
......@@ -60,10 +57,10 @@ public class StatementTest {
statement.executeUpdate("insert into " + dbName + "." + tName + " values (" + ts + ", 1)");
statement.executeQuery("select * from " + dbName + "." + tName);
ResultSet resultSet = statement.getResultSet();
assertTrue(null != resultSet);
Assert.assertNotNull(resultSet);
boolean isClosed = statement.isClosed();
assertEquals(false, isClosed);
Assert.assertEquals(false, isClosed);
}
@Test(expected = SQLException.class)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册