I have an "old" database (in utf 8) where I read and write on by using JDBC. Now, I must be able to also store emoji into a column of my table. I have changed the charset of involved columns to utf8mb4:
ALTER TABLE
myTable
CHANGE column_name column_name
longtext
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci
NOT NULL;
However, when I try to insert an emoticon into that column, I get the famous error
java.sql.SQLException: Incorrect string value: '\xF0\x9F\x91\x8D\xF0\x9F...'
Should I convert entire database, or am I doing something wrong?