Quando inicio conexão com o banco de dados aparece esse erro :
Fri Feb 05 12:33:50 BRST 2021 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.
Conexão aberta.
Conexão fechada.
o codigo é esse de baixo:
public class CONEXAO {
public static Connection abrirConexao()
{
Connection con = null;
try
{
Class.forName(“com.mysql.jdbc.Driver”).newInstance();
String url = “”;
url += “jdbc:mysql://127.0.0.1/cadastro?”;
url += “user=root&password=”;
jdbc:mysql://127.0.0.1
con = DriverManager.getConnection(url);
System.out.println(“Conexão aberta.”);
}
catch (SQLException e)
{
System.out.println(e.getMessage());
}
catch (ClassNotFoundException e)
{
System.out.println(e.getMessage());
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
return con;
}
public static void fecharConexao(Connection con)
{
try {
con.close();
System.out.println("Conexão fechada.");
}
catch (SQLException e)
{
System.out.println(e.getMessage());
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
}
}