1. 程式人生 > >MySQL連線字串設定了字符集,寫入資料還出現亂碼

MySQL連線字串設定了字符集,寫入資料還出現亂碼

properties:jdbc:mysql://192.168.1.190:3306/global?useUnicode=true&characterEncoding=UTF-8

xml:jdbc:mysql://192.168.1.190:3306/global?useUnicode=true&characterEncoding=UTF-8

注意如果你是在xml裡設定的的話就使用 & 如果是在properties裡面使用 &