生产代码如下:
public void streamImage(final String name, final OutputStream os)
throws DataAccessException {
this.simpleJdbcTemplate.getJdbcOperations().query(
"select content from imagedb where image_name=?",
new Object[] { name },
new AbstractLobStreamingResultSetExtractor() {
@Override
protected void handleNoRowFound()
throws LobRetrievalFailureException {
throw new EmptyResultDataAccessException(
"Image with name '" + name
+ "' not found in database", 1);
} @Override
protected void streamData(ResultSet rs)
throws SQLException, IOException,
DataAccessException {
InputStream inputStream = lobHandler
.getBlobAsBinaryStream(rs, 1);
if (inputStream != null) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
byte[] bytes = new byte[1024];
int length = 0;
while ((length = inputStream.read(bytes)) > 0) {
outputStream.write(bytes, 0, length);
}
os = outputStream;
if (inputStream != null) {
inputStream.close();
}
if (outputStream != null) {
outputStream.close();
}
}
}
});
}在代码行红色的位置,IDE提示错误,在内部类中如何才能正确为外部形参赋值?请帮忙解答,谢谢。