这样会出现上述情况,我们添加代码如下面的情况就可以解决上述问题
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/数据库名?useUnicode=true&characterEncoding=gb2312","用户名","密码");
Connection conn = DriverManager.getConnection(“jdbc:mysql://localhost:3306/数据库名
?useUnicode=true&characterEncoding=gb2312”,“用户名”,“密码”);