ShardingSphereResultSet extends AbstractResultSetAdapter { @Override public byte getByte(final int columnIndex) throws SQLException { return (byte) ResultSetUtil.convertValue(mergeResultSet.getValue(columnIndex, byte.class), byte.class); } ShardingSphereResultSet(final List<ResultSet> resultSets, final MergedResult mergeResultSet, final Statement statement, final ExecutionContext executionContext); @Override boolean next(); @Override boolean wasNull(); @Override boolean getBoolean(final int columnIndex); @Override boolean getBoolean(final String columnLabel); @Override byte getByte(final int columnIndex); @Override byte getByte(final String columnLabel); @Override short getShort(final int columnIndex); @Override short getShort(final String columnLabel); @Override int getInt(final int columnIndex); @Override int getInt(final String columnLabel); @Override long getLong(final int columnIndex); @Override long getLong(final String columnLabel); @Override float getFloat(final int columnIndex); @Override float getFloat(final String columnLabel); @Override double getDouble(final int columnIndex); @Override double getDouble(final String columnLabel); @Override String getString(final int columnIndex); @Override String getString(final String columnLabel); @Override String getNString(final int columnIndex); @Override String getNString(final String columnLabel); @Override BigDecimal getBigDecimal(final int columnIndex); @Override BigDecimal getBigDecimal(final String columnLabel); @Override BigDecimal getBigDecimal(final int columnIndex, final int scale); @Override BigDecimal getBigDecimal(final String columnLabel, final int scale); @Override byte[] getBytes(final int columnIndex); @Override byte[] getBytes(final String columnLabel); @Override Date getDate(final int columnIndex); @Override Date getDate(final String columnLabel); @Override Date getDate(final int columnIndex, final Calendar cal); @Override Date getDate(final String columnLabel, final Calendar cal); @Override Time getTime(final int columnIndex); @Override Time getTime(final String columnLabel); @Override Time getTime(final int columnIndex, final Calendar cal); @Override Time getTime(final String columnLabel, final Calendar cal); @Override Timestamp getTimestamp(final int columnIndex); @Override Timestamp getTimestamp(final String columnLabel); @Override Timestamp getTimestamp(final int columnIndex, final Calendar cal); @Override Timestamp getTimestamp(final String columnLabel, final Calendar cal); @Override InputStream getAsciiStream(final int columnIndex); @Override InputStream getAsciiStream(final String columnLabel); @Override InputStream getUnicodeStream(final int columnIndex); @Override InputStream getUnicodeStream(final String columnLabel); @Override InputStream getBinaryStream(final int columnIndex); @Override InputStream getBinaryStream(final String columnLabel); @Override Reader getCharacterStream(final int columnIndex); @Override Reader getCharacterStream(final String columnLabel); @Override Blob getBlob(final int columnIndex); @Override Blob getBlob(final String columnLabel); @Override Clob getClob(final int columnIndex); @Override Clob getClob(final String columnLabel); @Override Array getArray(final int columnIndex); @Override Array getArray(final String columnLabel); @Override URL getURL(final int columnIndex); @Override URL getURL(final String columnLabel); @Override SQLXML getSQLXML(final int columnIndex); @Override SQLXML getSQLXML(final String columnLabel); @Override Object getObject(final int columnIndex); @Override Object getObject(final String columnLabel); @SuppressWarnings("unchecked") @Override T getObject(final int columnIndex, final Class<T> type); @Override T getObject(final String columnLabel, final Class<T> type);  }
@Test public void assertGetByteWithColumnIndex() throws SQLException { when(mergeResultSet.getValue(1, byte.class)).thenReturn((byte) 1); assertThat(shardingSphereResultSet.getByte(1), is((byte) 1)); }
@Test public void assertGetByteWithColumnLabel() throws SQLException { when(mergeResultSet.getValue(1, byte.class)).thenReturn((byte) 1); assertThat(shardingSphereResultSet.getByte("label"), is((byte) 1)); }