title: Java - How to insert data using postman
body: <p>My code is running perfect but at the postman side showing error </p>
  
  <blockquote>
    <p>"The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers." </p>
  </blockquote>
  
  <p>while posted data is coming in <code>restController</code>,<code>serviceImpl</code> and in <code>Studentimpl</code> too.</p>
  
  <p>My <code>restController</code> Is</p>
  
  <pre><code>        @RequestMapping(value="save",method=RequestMethod.POST,produces="application/json")
  
          GetStudentSaveResponse saveResponse(@RequestBody GetStudentSaveRequest saveRequest)
          {
              System.out.println(saveRequest.getName());
              System.out.println(saveRequest.getAddress());
              return serviceIntf.saveResponse(saveRequest);
          }
           RestImpl is
           @Override
          public GetStudentSaveResponse saveResponse(GetStudentSaveRequest saveRequest) {
                  GetStudentSaveResponse saveResponse = new GetStudentSaveResponse();
                  studentIntf.SaveStudent(saveRequest.getName(), saveRequest.getAddress());           
                  System.out.println("SERVICE"+saveRequest.getName());
                  return saveResponse;
              }
  </code></pre>
  
  <p>Implementation class is:</p>
  
  <pre><code>public void SaveStudent(String name, String address) {
      try
      {
          java.sql.Date date = new java.sql.Date(new java.util.Date().getTime());
          con=jdbctemplate.getDataSource().getConnection();
  
          CallableStatement call = con.prepareCall("{Student_pro(?,?,?,?,?)}");
          call.setString(1, "insertStudent");
          call.setInt(2, 0);
          call.setString(3, name);
          call.setString(4, address);
          call.setDate(5, date);
  
          System.out.println(name);
          System.out.println(address);
  
      }catch(Exception e){e.printStackTrace();}
  }
  </code></pre>