Merge branch 'feature/TD-4038' of https://github.com/taosdata/TDengine into feature/TD-4038

This commit is contained in:
dapan1121 2021-05-11 15:33:02 +08:00
commit c8ff286cbe
3 changed files with 13 additions and 9 deletions

View File

@ -84,9 +84,11 @@ public abstract class AbstractResultSet extends WrapperImpl implements ResultSet
} }
@Override @Override
@Deprecated
public InputStream getUnicodeStream(int columnIndex) throws SQLException { public InputStream getUnicodeStream(int columnIndex) throws SQLException {
if (isClosed()) if (isClosed()) {
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_RESULTSET_CLOSED);
}
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_UNSUPPORTED_METHOD);
} }
@ -171,6 +173,7 @@ public abstract class AbstractResultSet extends WrapperImpl implements ResultSet
} }
@Override @Override
@Deprecated
public InputStream getUnicodeStream(String columnLabel) throws SQLException { public InputStream getUnicodeStream(String columnLabel) throws SQLException {
return getUnicodeStream(findColumn(columnLabel)); return getUnicodeStream(findColumn(columnLabel));
} }

View File

@ -84,6 +84,7 @@ public class TSDBResultSetRowData {
data.set(col, value); data.set(col, value);
} }
@SuppressWarnings("deprecation")
public int getInt(int col, int srcType) throws SQLException { public int getInt(int col, int srcType) throws SQLException {
Object obj = data.get(col); Object obj = data.get(col);
@ -128,7 +129,7 @@ public class TSDBResultSetRowData {
long value = (long) obj; long value = (long) obj;
if (value < 0) if (value < 0)
throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_NUMERIC_VALUE_OUT_OF_RANGE); throw TSDBError.createSQLException(TSDBErrorNumbers.ERROR_NUMERIC_VALUE_OUT_OF_RANGE);
return new Long(value).intValue(); return Long.valueOf(value).intValue();
} }
} }

View File

@ -3,7 +3,6 @@ package com.taosdata.jdbc;
import com.google.common.primitives.Ints; import com.google.common.primitives.Ints;
import com.google.common.primitives.Longs; import com.google.common.primitives.Longs;
import com.google.common.primitives.Shorts; import com.google.common.primitives.Shorts;
import com.taosdata.jdbc.rs.RestfulResultSet;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.Assert; import org.junit.Assert;
import org.junit.BeforeClass; import org.junit.BeforeClass;
@ -177,6 +176,7 @@ public class TSDBResultSetTest {
rs.getAsciiStream("f1"); rs.getAsciiStream("f1");
} }
@SuppressWarnings("deprecation")
@Test(expected = SQLFeatureNotSupportedException.class) @Test(expected = SQLFeatureNotSupportedException.class)
public void getUnicodeStream() throws SQLException { public void getUnicodeStream() throws SQLException {
rs.getUnicodeStream("f1"); rs.getUnicodeStream("f1");
@ -326,7 +326,7 @@ public class TSDBResultSetTest {
@Test(expected = SQLFeatureNotSupportedException.class) @Test(expected = SQLFeatureNotSupportedException.class)
public void getRow() throws SQLException { public void getRow() throws SQLException {
int row = rs.getRow(); rs.getRow();
} }
@Test(expected = SQLFeatureNotSupportedException.class) @Test(expected = SQLFeatureNotSupportedException.class)
@ -405,12 +405,12 @@ public class TSDBResultSetTest {
@Test(expected = SQLFeatureNotSupportedException.class) @Test(expected = SQLFeatureNotSupportedException.class)
public void updateByte() throws SQLException { public void updateByte() throws SQLException {
rs.updateByte(1, new Byte("0")); rs.updateByte(1, (byte) 0);
} }
@Test(expected = SQLFeatureNotSupportedException.class) @Test(expected = SQLFeatureNotSupportedException.class)
public void updateShort() throws SQLException { public void updateShort() throws SQLException {
rs.updateShort(1, new Short("0")); rs.updateShort(1, (short) 0);
} }
@Test(expected = SQLFeatureNotSupportedException.class) @Test(expected = SQLFeatureNotSupportedException.class)