If you do not want to support BMP support, you can simply hide these characters before passing to MySQL:
public static String withNonBmpStripped( String input ) { if( input == null ) throw new IllegalArgumentException("input"); return input.replaceAll("[^\\u0000-\\uFFFF]", ""); }
If you want to support more than BMP, you need MySQL 5.5+, and you need to change everything utf8 to utf8mb4 (sortings, encodings ...). But you also need support for this in a driver that I am not familiar with. Processing these characters in Java is also a pain because they are distributed over 2 chars and therefore require special handling in many operations.
Esailija
source share