When I try to make a clausala update in java with the following code:
Statement comando=null;
try {
comando = db.conn.createStatement();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
//System.out.println("insert into alumno(nombre,genero,estatus,activo) values("+"'"+txtNombre.getText()+"','"+charGenero+"','"+cboEstatus.getSelectedItem().toString()+"'"+",'"+charActivo+"')");
try {
comando.executeUpdate("update menu where set nombrePlatillo='"+txtPlatillo.getText()+"',precio='"+txtPrecio.getText()+"',descripcion='"+txtDescripcion.getText()+"' where idMenu ='"+txtidMenu.getText()+"'");
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
Mark the error:
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 is not 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.
Structure:
import java.sql.*;
import javax.swing.JOptionPane;
public class BaseDeDatos {
public static PreparedStatement prest=null;
public static CallableStatement cllst=null;
public static Connection conn=null;
public static Statement st=null;
public static ResultSet rs=null;
public static String usuario;
public static String password;
public static String host;
public static String db;
public void Conectar(){
try{
usuario="root"; password=""; host="localhost"; db="restaurante?useSSL=false";
String url="jdbc:mysql://"+host+"/"+db;
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn=DriverManager.getConnection(url,usuario,password);
}catch(Exception e){
JOptionPane.showMessageDialog(null, e.toString());
}
}
}