Problem with connection from java to mysql

0

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

    
asked by Daniel Magadan 30.06.2018 в 06:42
source

0 answers