title: Force jdbc to use utf8mb3
body: <p>My <strong>Sql-Database</strong> uses <strong>utf8_bin</strong>, which is limited to <strong>3-Byte</strong>-Characters. Im using a pre "5.1.46" Mysql connector.</p>
  
  <p>On this site: <a href="https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-charsets.html" rel="nofollow noreferrer">https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-charsets.html</a>, it is stated that using the <strong>"characterEncoding=utf-8"</strong> parameter, means that it uses <strong>utf8mb3</strong>. Which would be correct in my case. The problem is, that the application will throw a Mysql-Exception when it tries to write a <strong>4-Byte</strong>-Character:</p>
  
  <pre><code>for example:
  java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x81 \xC4...'
  </code></pre>
  
  <p>Furthermore, if I dont specify the characterEncoding-parameter at all, it will default to some other charset. The problem here is, that a lot of characters that I need to be able to write into the DB will just be replaced by a "?". Like "ğ" for example.</p>
  
  <p>So far, the only Solution I see to this problem is just removing all 4-Byte characters from a String, before I write it into the Database, since changing the charset of the Database iself is not an option unfortunatley</p>
  
  <p>But I was wondering if im missing something here. Is there better way to do this?</p>
  
  <p>Thanks a lot</p>