Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream data test exception failures fix. #11

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public boolean wasNull() {
}

@Override
public String getString() {
public String getString() throws SQLException {
final Object object = getObject();
if (object == null) {
return null;
Expand All @@ -78,107 +78,107 @@ public String getString() {
}

@Override
public boolean getBoolean() {
public boolean getBoolean() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public byte getByte() {
public byte getByte() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public short getShort() {
public short getShort() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public int getInt() {
public int getInt() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public long getLong() {
public long getLong() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public float getFloat() {
public float getFloat() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public double getDouble() {
public double getDouble() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public BigDecimal getBigDecimal() {
public BigDecimal getBigDecimal() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public BigDecimal getBigDecimal(final int i) {
public BigDecimal getBigDecimal(final int i) throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public byte[] getBytes() {
public byte[] getBytes() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public InputStream getAsciiStream() {
public InputStream getAsciiStream() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public InputStream getUnicodeStream() {
public InputStream getUnicodeStream() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public InputStream getBinaryStream() {
public InputStream getBinaryStream() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public Object getObject() {
public Object getObject() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public Reader getCharacterStream() {
public Reader getCharacterStream() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public Object getObject(final Map<String, Class<?>> map) {
public Object getObject(final Map<String, Class<?>> map) throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public Ref getRef() {
public Ref getRef() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public Blob getBlob() {
public Blob getBlob() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public Clob getClob() {
public Clob getClob() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public Array getArray() {
public Array getArray() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public Struct getStruct() {
public Struct getStruct() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

Expand All @@ -198,32 +198,32 @@ public Timestamp getTimestamp(final Calendar calendar) throws SQLException {
}

@Override
public URL getURL() {
public URL getURL() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public NClob getNClob() {
public NClob getNClob() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public SQLXML getSQLXML() {
public SQLXML getSQLXML() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public String getNString() {
public String getNString() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public Reader getNCharacterStream() {
public Reader getNCharacterStream() throws SQLException {
throw getOperationNotSupported(this.getClass());
}

@Override
public <T> T getObject(final Class<T> type) {
public <T> T getObject(final Class<T> type) throws SQLException {
final Object value;

if (type == Byte.class) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,112 +103,112 @@ public boolean wasNull() {
}

@Override
public String getString() {
public String getString() throws SQLException {
return getAccessor().getString();
}

@Override
public boolean getBoolean() {
public boolean getBoolean() throws SQLException {
return getAccessor().getBoolean();
}

@Override
public byte getByte() {
public byte getByte() throws SQLException {
return getAccessor().getByte();
}

@Override
public short getShort() {
public short getShort() throws SQLException {
return getAccessor().getShort();
}

@Override
public int getInt() {
public int getInt() throws SQLException {
return getAccessor().getInt();
}

@Override
public long getLong() {
public long getLong() throws SQLException {
return getAccessor().getLong();
}

@Override
public float getFloat() {
public float getFloat() throws SQLException {
return getAccessor().getFloat();
}

@Override
public double getDouble() {
public double getDouble() throws SQLException {
return getAccessor().getDouble();
}

@Override
public BigDecimal getBigDecimal() {
public BigDecimal getBigDecimal() throws SQLException {
return getAccessor().getBigDecimal();
}

@Override
public BigDecimal getBigDecimal(int i) {
public BigDecimal getBigDecimal(int i) throws SQLException {
return getAccessor().getBigDecimal(i);
}

@Override
public byte[] getBytes() {
public byte[] getBytes() throws SQLException {
return getAccessor().getBytes();
}

@Override
public InputStream getAsciiStream() {
public InputStream getAsciiStream() throws SQLException {
return getAccessor().getAsciiStream();
}

@Override
public InputStream getUnicodeStream() {
public InputStream getUnicodeStream() throws SQLException {
return getAccessor().getUnicodeStream();
}

@Override
public InputStream getBinaryStream() {
public InputStream getBinaryStream() throws SQLException {
return getAccessor().getBinaryStream();
}

@Override
public Object getObject() {
public Object getObject() throws SQLException {
return getAccessor().getObject();
}

@Override
public Reader getCharacterStream() {
public Reader getCharacterStream() throws SQLException {
return getAccessor().getCharacterStream();
}

@Override
public Object getObject(Map<String, Class<?>> map) {
public Object getObject(Map<String, Class<?>> map) throws SQLException {
return getAccessor().getObject(map);
}

@Override
public Ref getRef() {
public Ref getRef() throws SQLException {
return getAccessor().getRef();
}

@Override
public Blob getBlob() {
public Blob getBlob() throws SQLException {
return getAccessor().getBlob();
}

@Override
public Clob getClob() {
public Clob getClob() throws SQLException {
return getAccessor().getClob();
}

@Override
public Array getArray() {
public Array getArray() throws SQLException {
return getAccessor().getArray();
}

@Override
public Struct getStruct() {
public Struct getStruct() throws SQLException {
return getAccessor().getStruct();
}

Expand All @@ -228,32 +228,32 @@ public Timestamp getTimestamp(Calendar calendar) throws SQLException {
}

@Override
public URL getURL() {
public URL getURL() throws SQLException {
return getAccessor().getURL();
}

@Override
public NClob getNClob() {
public NClob getNClob() throws SQLException {
return getAccessor().getNClob();
}

@Override
public SQLXML getSQLXML() {
public SQLXML getSQLXML() throws SQLException {
return getAccessor().getSQLXML();
}

@Override
public String getNString() {
public String getNString() throws SQLException {
return getAccessor().getNString();
}

@Override
public Reader getNCharacterStream() {
public Reader getNCharacterStream() throws SQLException {
return getAccessor().getNCharacterStream();
}

@Override
public <T> T getObject(Class<T> type) {
public <T> T getObject(Class<T> type) throws SQLException {
return getAccessor().getObject(type);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

import static java.lang.String.format;

import java.sql.SQLException;

import org.apache.calcite.avatica.util.Cursor.Accessor;

/**
Expand All @@ -37,8 +39,8 @@ private ExceptionTemplateThrower() {
*
* @return the exception.
*/
public static UnsupportedOperationException getOperationNotSupported(final Class<?> type) {
return new UnsupportedOperationException(
public static SQLException getOperationNotSupported(final Class<?> type) {
return new SQLException(
format("Operation not supported for type: %s.", type.getName()));
}
}
Loading