提交 ff1ab88c 编写于 作者: Z zyyang

change

上级 a5f02a89
...@@ -246,17 +246,17 @@ public abstract class AbstractStatement implements Statement { ...@@ -246,17 +246,17 @@ public abstract class AbstractStatement implements Statement {
return this.closeOnCompletion; return this.closeOnCompletion;
} }
@Override // @Override
public <T> T unwrap(Class<T> iface) throws SQLException { // public <T> T unwrap(Class<T> iface) throws SQLException {
try { // try {
return iface.cast(this); // return iface.cast(this);
} catch (ClassCastException cce) { // } catch (ClassCastException cce) {
throw new SQLException("Unable to unwrap to " + iface.toString()); // throw new SQLException("Unable to unwrap to " + iface.toString());
} // }
} // }
//
@Override // @Override
public boolean isWrapperFor(Class<?> iface) throws SQLException { // public boolean isWrapperFor(Class<?> iface) throws SQLException {
return iface.isInstance(this); // return iface.isInstance(this);
} // }
} }
...@@ -8,9 +8,6 @@ import org.junit.Test; ...@@ -8,9 +8,6 @@ import org.junit.Test;
import java.sql.*; import java.sql.*;
import java.util.Properties; import java.util.Properties;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class StatementTest { public class StatementTest {
static Connection connection = null; static Connection connection = null;
static Statement statement = null; static Statement statement = null;
...@@ -60,10 +57,10 @@ public class StatementTest { ...@@ -60,10 +57,10 @@ public class StatementTest {
statement.executeUpdate("insert into " + dbName + "." + tName + " values (" + ts + ", 1)"); statement.executeUpdate("insert into " + dbName + "." + tName + " values (" + ts + ", 1)");
statement.executeQuery("select * from " + dbName + "." + tName); statement.executeQuery("select * from " + dbName + "." + tName);
ResultSet resultSet = statement.getResultSet(); ResultSet resultSet = statement.getResultSet();
assertTrue(null != resultSet); Assert.assertNotNull(resultSet);
boolean isClosed = statement.isClosed(); boolean isClosed = statement.isClosed();
assertEquals(false, isClosed); Assert.assertEquals(false, isClosed);
} }
@Test(expected = SQLException.class) @Test(expected = SQLException.class)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册