这是警告不是错误,以后使用是不影响的。大概的意思就是说建立ssl连接,但是服务器没有身份认证,这种方式不推荐使用。
解决办法:数据库名字后+?useUnicode=true&characterEncoding=utf-8&useSSL=false
原来的连接url:Connection connect = DriverManager.getConnection(“jdbc:mysql://localhost:3306/test”, “root”, “letmein”);
现在的连接url:Connection connect = DriverManager.getConnection(“jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=false”,“root”, “letmein”);
// 连接URL为 jdbc:mysql//服务器地址/数据库名 ,后面的2个参数分别是登陆用户名和密码