SQLException: java.sql.SQLException: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long
Does anyone know what it can be?
My connection class:
import static java.lang.System.out;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class ConexaoMySQL {
private String user = "user";
private String pass = "pass";
private String dbClass = "com.mysql.jdbc.Driver";
private String dbDriver = "jdbc:mysql://db4free.net:3307/corrente";
private Connection conn = null;
public boolean connect() {
boolean done = false;
//load driver
try {
Class.forName(dbClass).newInstance();
System.out.println("driver loaded"); // THIS IS BEING RETURNED
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException ex) {
System.err.println(ex);
}
// Connection
try {
conn = DriverManager.getConnection(dbDriver, user, pass);
System.out.println("connected"); // THIS IS NOT BEING RETURNED
done = true;
} catch (SQLException ex) {
System.out.println("SQLException: " + ex);
}
return done;
}
public static void main(String[] args) {
new ConexaoMySQL().connect();
}
}