将原本:
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test1","root","1234");
改为:
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test1?characterEncoding=UTF-8"+"&serverTimezone=UTC","root","1234");
将原本:
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test1","root","1234");
改为:
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test1?characterEncoding=UTF-8"+"&serverTimezone=UTC","root","1234");