getBatchStatusCode
getBatchStatusCode()
getBatchStatusCode メソッドは、executeBatch メソッドで実行されたコマンドの配列から、最も大きいステータス・コードを返します。
戻り値
getBatchStatusCode メソッドは整数を返します。
*
*
*
以下のサンプル・コードは、BatchStatusCode を取得する方法の例を示します。
// Top level status code is a short cut to determine if there are any 
// non-successes in the array of Response objects
if(batchResponse.getBatchStatusCode() == Response.STATUS_SUCCESS)
{
System.out.println("ExecuteBatch ran perfectly!");
}
else if(batchResponse.getBatchStatusCode() == Response.STATUS_WARNING)
{
System.out.println("ExecuteBatch call processed with at least one warning");
}
else
{
System.out.println("ExecuteBatch call processed with at least one error");
}

// Iterate through the array, and print out the message for any non-successes
for(Response response : batchResponse.getResponses())
{
if(response.getStatusCode()!=Response.STATUS_SUCCESS)
{
printDetailMessageOfWarningOrError("executeBatchCommand",
response.getAdvisoryMessages());
}
}