The problem lies in the moment of connecting, it throws me an error, I'm working with workbench 8.0.
This is the code:
public static Connection getConnection() {
Connection conexion = null;
try {
conexion = null;
Class.forName("com.mysql.jdbc.Driver");
conexion =(Connection)DriverManager.getConnection("jdbc:mysql://localhost:3306/escuela","root","1234");
System.out.println("conexion establecida");
} catch (ClassNotFoundException | SQLException e) {
System.out.println("error de conexion"+e);
JOptionPane.showMessageDialog(null, "error de conexion "+e);
}
return conexion;
}
and at the moment of executing it I throw this exception:
java.sql.SQLException: java.lang.ClassCastException: java.math.BigInteger can not be cast to java.lang.Long