大佬看下JDBC连接mysqll数据出现的这个问题

轻语z 2017-11-08 08:07:04


public class jdbc3 {

public static void main(String[] args) {
// TODO 自动生成的方法存根

try {
Connection conn=(Connection) DriverManager.getConnection("jdbc:mysql://localhost:3306/helloworld","root","514730");
Statement st =(Statement) conn.createStatement();
ResultSet rs=st.executeQuery("select*from student");

while(rs.next()) {
System.out.println(rs.getString("last_name")+rs.getString("first_name"));
}


} catch (Exception e) {
// TODO 自动生成的 catch 块
e.printStackTrace();
}
}

}
Wed Nov 08 08:03:52 CST 2017 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

结果Doejohn
Kobebryant
kulijack


能够得到运算结果,不知道红色信息上面什么意思
...全文
169 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧