There is nothing in here that would tell the driver to encode strings in UTF-8. You are only making the database expect UTF-8, and then the driver encodes your strings in some other encoding and the database throws an error.
You don't show what your url
is, but it's supposed to be like this:
jdbc:mysql:///dbname?useUnicode=true&characterEncoding=utf-8
Then you can remove this:
PreparedStatement p = con.prepareStatement("SET NAMES utf8");
p.executeUpdate();