Skip to content

Commit

Permalink
Merge pull request #8 from rafael-telles/number-data-conversion-tests…
Browse files Browse the repository at this point in the history
…-failures-exception-fix

Number data conversion tests failures exception fix for varchar accessor.
  • Loading branch information
escobargabriel authored Mar 10, 2022
2 parents 0a82d13 + 04ca5fe commit e21bd75
Show file tree
Hide file tree
Showing 10 changed files with 263 additions and 217 deletions.
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,34 +198,33 @@ 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) {
value = getByte();
} else if (type == Short.class) {
Expand All @@ -249,7 +248,6 @@ public <T> T getObject(final Class<T> type) {
} else {
value = getObject();
}

return !type.isPrimitive() && wasNull ? null : type.cast(value);
}
}
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);
}
}
Loading

0 comments on commit e21bd75

Please sign in to comment.