title: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x91\xBD\xF0\x9F...'
body: <p>I have the following string value: "walmart obama "</p>
  
  <p>I am using MySQL and Java.</p>
  
  <p>I am getting the following exception: `java.sql.SQLException: Incorrect string value: '\xF0\x9F\x91\xBD\xF0\x9F...'</p>
  
  <p>Here is the variable I am trying to insert into:</p>
  
  <pre><code>var1 varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL`
  </code></pre>
  
  <p>My Java code that is trying to insert "walmart obama " is a preparedStatement. So I am using the <code>setString()</code> method.</p>
  
  <p>It looks like the problem is the encoding of the values . How can I fix this? Previously I was using Derby SQL and the values  just ended up being two sqaures (I think this is the representation of the null character)</p>
  
  <p>All help is greatly appreciated!</p>