title: how to save emoji in mysql using servlet
body: <p>I am using servlet with mysql connector 5.1.44 to connect to mysql database.</p>
  
  <pre><code>Connection conn = DriverManager.getConnection(Utils.DBURL+"/"+Utils.DBName+"?useUnicode=true&amp;amp;characterEncoding=utf8mb4&amp;amp;", Utils.DBUserName, Utils.DBPassword);
  </code></pre>
  
  <p>this works well for multilanguage input but when trying to save emojis, it ends up saving only "??".
  what can I do to save emoji using just servlet?</p>
  
  <p>servlet code</p>
  
  <pre><code>protected void processRequest(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException{
  response.setContentType("application/json");
  request.setCharacterEncoding("UTF-8");
  String content = request.getParameter("content");
  Class.forName("com.mysql.jdbc.Driver");
          Connection conn = 
  DriverManager.getConnection(Utils.DBURL+"/"+Utils.DBName+"?
  useUnicode=true&amp;amp;characterEncoding=utf8mb4&amp;amp;", Utils.DBUserName, 
  Utils.DBPassword);
  PreparedStatement stmt = conn.prepareStatement("INSERT INTO "
                              + "`feed`(`content`)"
                              + " VALUES (?)");
  stmt.setString(1, content);
  stmt.executeUpdate();
  }
  </code></pre>