ResourceUnknownException,
ClientException
{
StringBuilder resultData = new StringBuilder();
DataSourceResource dataSource = result.getDataSource();
DataStreamData data = null;
resultData.append("[");
do
{
data = dataSource.getDataValues(100);
for (DataValue value : data.getDataValues())
{
resultData.append(value.toString());
resultData.append(",");
}
}
while (data.getStreamStatus() == DataStreamStatus.OPEN);
if (resultData.length() > 1)
{
resultData.delete(resultData.length()-1, resultData.length());
}
resultData.append("]");
if (data.getStreamStatus() == DataStreamStatus.CLOSED_DUE_TO_ERROR)
{
resultData.append("\nCLOSED DUE TO ERROR");
}
return resultData.toString();
}