解决办法:
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/hibernate</property>
需要在后面添加两句,改为:
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/hibernate?useUnicode=true&characterEncoding=UTF8</property>
&可转义为&,若直接用&,会报错。