title: How to properly set utf8 encoding with jdbc and MySQL?
body: <p>JDBC and MySQL work just fine in my project except when it comes down to accented characters.
  This is the URL I use to access the database:</p>
  
  <pre><code>jdbc:mysql://localhost:3306/dbname?useUnicode=yes&amp;characterEncoding=UTF-8
  </code></pre>
  
  <p>Suppose a <code>resultSet = preparedStatement.executeQuery()</code>, and then a <code>System.out.println(resultSet.getString("text_with_accents"));</code>. What's stored in the database is <code>àèìòù</code> (note that I've already set the right encoding in the database and all its tables), but what I get is <code>?????</code>.</p>
  
  <p>Is there a way to fix this?</p>