Skip to content
Open
Show file tree
Hide file tree
Changes from all 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 @@ -231,8 +231,15 @@ public void deleteRow() throws SQLException {
}

@Override
public int findColumn(String columnName) {
return ioTDBRpcDataSet.findColumn(columnName);
public int findColumn(String columnName) throws SQLException {
if (isClosed()) {
throw new SQLException("ResultSet is closed");
}
try {
return ioTDBRpcDataSet.findColumn(columnName);
} catch (NullPointerException e) {
throw new SQLException("Column '" + columnName + "' not found");
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,15 @@ public void setBinaryStream(int parameterIndex, InputStream x, long length) thro

@Override
public void setBlob(int parameterIndex, Blob x) throws SQLException {
throw new SQLException(Constant.PARAMETER_SUPPORTED);
if (x == null) {
setNull(parameterIndex, Types.BLOB);
} else {
try {
setBytes(parameterIndex, x.getBytes(1, (int) x.length()));
} catch (SQLException e) {
throw new SQLException("Failed to read Blob data: " + e.getMessage(), e);
}
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,16 @@ public void setBinaryStream(int parameterIndex, InputStream x, long length) thro

@Override
public void setBlob(int parameterIndex, Blob x) throws SQLException {
throw new SQLException(Constant.PARAMETER_SUPPORTED);
checkParameterIndex(parameterIndex);
if (x == null) {
setNull(parameterIndex, Types.BLOB);
} else {
try {
setBytes(parameterIndex, x.getBytes(1, (int) x.length()));
} catch (SQLException e) {
throw new SQLException("Failed to read Blob data: " + e.getMessage(), e);
}
}
}

@Override
Expand Down