Printing the status of a database insertion as JSON The controller is currently inserting a record into the database and returning a JSON response as shown below in the try-catch block. I can see the Inserted Successfully within the try-catch block!. Although, 
I haven't seen this message Error in Inserting Record! so far since my webservice haven't errored out till now.  

Please let me know if the approach I have followed to display just two lines of JSON is an efficient / conventional way of doing similar things ? If it can be improved, please suggest.

@RequestMapping(value = "/insertRecord", method = RequestMethod.POST)
 public Map&lt;String, String&gt; insertRecord
  (
   @RequestParam(value = "type_id", defaultValue = "0") Integer type_id,
   @RequestParam(value = "tempID", defaultValue = "0") Integer tempID,
   @RequestParam(value = "status", defaultValue = "") String successORFailure,
   @RequestParam(value = "notes", defaultValue = "") String message
  ) {


   Map&lt;String, String&gt; response =  new HashMap&lt;String,String&gt;();

   try {

    insertRecordDao insertDao = (insertRecordDao) context.getBean("insertRecordDao");
    insertDao.insertAuditInfo(type_id, tempID, successORFailure, message);
    response.put("message", "Inserted Successfully within the try-catch block!");
    response.put("status", "SUCCESS");

   } catch (Throwable th) {
    th.printStackTrace();
    response.put("message", "Error in Inserting Record!");
    response.put("status", "ERROR");

   }

    return response;

  }


Here's a JSON response from my POSTMAN client:
This looks like you are trying to create a REST interface. If this is true, the following remarks apply:


First of all, your path should not include the action. The resource should be named "record" and the action is determined by the HTTP verb, i.e. "insert" is implied by POST, retrieve by GET, modify/update by PUT, etc.
Success or failure should primarily be communicated via HTTP status. For a POST, customary responses are either code 200 (OK) with the complete object as a result (often modified by the insertion, e.g. having a unique id now) or 204 (no content) to signify that everything is OK without sending the object back.
Likewise, failure should be communicated as a status code in the 500 range (server error, e.g. if the database connection fails) or 400 range (bad request, e.g. wrong data types transmitted by the client)


Generally, look around for "REST best practices", you'll find lots of information on the topic.