title: how to insert json data to the database from json response in spring mvc
body: <p>i am working with json data.after successful signup i am getting the json response in the body.now i want to insert that json response in to my table in database..any help for this..?i m working with spring mvc with beans for getter and setter.
  I m havving jsp page for usename password mobilenumber.after successful login ,i m getting response from the server in json format. like this</p>
  
  <pre><code>{"user id":"dgdsjfhsjf","username":"xyz","password":"hfhgfjg"}
  </code></pre>
  
  <p>i want to insert this data in to my database table  named as user..how can i do this..? this is my user.java</p>
  
  <pre><code>@Table(name = "user")
  @Column(name = "username")private string username;
  @Column(name = "password")private string password;
  //getter and setters for username and password
  </code></pre>
  
  <p>i created json object like this</p>
  
  <pre><code>String username = user.getUsername();
  String password = user.getPassword();
  JSONObject jsondata = new JSONObject();
  jsondata.put("userName", username);
  jsondata.put("Password", password);
  </code></pre>
  
  <p>and i m getting the response body like this,</p>
  
  <pre><code>respone = restTemplate.exchange(url, HttpMethod.POST,
                      requestEntity, String.class);
  
              System.out.println(respone.getBody());
  </code></pre>
  
  <p>its in json format,like this</p>
  
  <pre><code>{"user id":"hgjfgfffffffffffff","username":"gfg","password":"jfg"}
  </code></pre>
  
  <p>want to convert it into string and insert that value into mysql database and also the user id i m not sending,i m getting this in the json response.so how can i insert one by one value from this json response to my database table?</p>