This commit is contained in:
zyyang 2021-02-06 15:55:19 +08:00
parent bf8ae90975
commit 67ad9c5058
2 changed files with 13 additions and 7 deletions

View File

@ -349,7 +349,7 @@ public abstract class AbstractResultSet extends WrapperImpl implements ResultSet
if (isClosed())
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_STATEMENT_CLOSED);
return false;
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
}
@Override
@ -357,7 +357,7 @@ public abstract class AbstractResultSet extends WrapperImpl implements ResultSet
if (isClosed())
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_STATEMENT_CLOSED);
return false;
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
}
@Override
@ -365,7 +365,7 @@ public abstract class AbstractResultSet extends WrapperImpl implements ResultSet
if (isClosed())
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_STATEMENT_CLOSED);
return false;
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
}
@Override

View File

@ -259,10 +259,12 @@ public class RestfulResultSetTest {
rs.previous();
}
@Test(expected = SQLException.class)
@Test
public void setFetchDirection() throws SQLException {
rs.setFetchDirection(ResultSet.FETCH_FORWARD);
Assert.assertEquals(ResultSet.FETCH_FORWARD, rs.getFetchDirection());
rs.setFetchDirection(ResultSet.FETCH_UNKNOWN);
Assert.assertEquals(ResultSet.FETCH_FORWARD, rs.getFetchDirection());
}
@Test
@ -270,14 +272,15 @@ public class RestfulResultSetTest {
Assert.assertEquals(ResultSet.FETCH_FORWARD, rs.getFetchDirection());
}
@Test(expected = SQLException.class)
@Test
public void setFetchSize() throws SQLException {
rs.setFetchSize(0);
Assert.assertEquals(0, rs.getFetchSize());
}
@Test
public void getFetchSize() throws SQLException {
Assert.assertEquals(1, rs.getFetchSize());
Assert.assertEquals(0, rs.getFetchSize());
}
@Test
@ -528,7 +531,10 @@ public class RestfulResultSetTest {
@Test(expected = SQLFeatureNotSupportedException.class)
public void getNString() throws SQLException {
rs.getNString("f1");
String f10 = rs.getNString("f10");
Assert.assertEquals("涛思数据", f10);
f10 = rs.getNString(10);
Assert.assertEquals("涛思数据", f10);
}
@Test(expected = SQLFeatureNotSupportedException.class)