Parties to a controversy which might be the subject of a civil action may, without action, agree upon a case containing the facts upon which the controversy depends, and present a submission of it to any court which would have jurisdiction if an action had been brought. It must appear by affidavit that the controversy is real, and that the proceedings are had in good faith to determine the rights of the parties. The court shall hear and determine the case at a general or special term, and order judgment on it as in a civil action. Judgment shall be entered as in other cases, and the case, submission, and the judgment shall constitute the judgment roll. The judgment may be enforced, and shall be subject to appeal, as in other cases.