Java MySQL: Insert special charactar into database
<p>I want to insert a special character like <code>✪</code> into a database.</p>

<p>When I do it like this in the Java code:</p>

<pre><code>String message = "✪";
preparedStatement = connection.prepareStatement("INSERT INTO `messages` (`message`) VALUES (?)");
preparedStatement.setString(1, message);
preparedStatement.executeUpdate();
</code></pre>

<p>It just inserts a <code>?</code> instead of <code>✪</code>. But when I execute the SQL command on phpMyAdmin it works fine and <code>✪</code> is inserted.</p>

<p>The column <code>message</code> in the database is of the type <code>varchar(2048)</code> and collation <code>utf8_general_ci</code>.
And the text file encoding of the java project is UTF-8 as well.</p>