JSONArray jsonAnswer = new JSONArray();
try
{
// Get the error message
JSONObject obj = jsonArr.getJSONObject(0);
lazyAnswer.setError(obj.getBoolean("exceptionFlag"));
if(lazyAnswer.hasError()) {
lazyAnswer.setErrorMessage(obj.getString("exceptionText"));
}
// Add the insertedId to the array if the user want it
if(hasInsertedId)
jsonAnswer.put(new JSONObject().put("insertedId", String.valueOf(obj.getInt("insertId"))));
for(int i = 1; i < jsonArr.length(); i++)
{
obj = jsonArr.getJSONObject(i);
jsonAnswer.put(obj);