Java PreparedStatement UTF-8 character problem

The number of ways this can get screwed up is actually quite impressive. If you’re using MySQL, try adding a characterEncoding=UTF-8 parameter to the end of your JDBC connection URL:

jdbc:mysql://server/database?characterEncoding=UTF-8

You should also check that the table / column character set is UTF-8.

Leave a Comment