Japanese companies raised capital spending in the second quarter as profits surged, in the latest sign that the corporate sector is coping fairly well with the fallout from the Middle East conflict.