在url后面添加参数:url=jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf8


DriverManager.getConnection("jdbc:mysql://localhost:3306/students?useUnicode=true&characterEncoding=utf-8", "root", "");

DriverManager.getConnection("jdbc:mysql://localhost:3306/students", "root", "");



Logo

更多推荐