Galera, que erro é esse:
jun 14, 2018 8:55:57 PM Ferramentas.Conexao_MySQL link_mysql
GRAVE: null
java.sql.SQLException: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919)
at com.mysql.jdbc.ConnectionImpl.buildCollationMapping(ConnectionImpl.java:1062)
at com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3556)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2513)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2283)
at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:822)
at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:404)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:317)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at Ferramentas.Conexao_MySQL.link_mysql(Conexao_MySQL.java:27)
at Telas.Principal.(Principal.java:25)
at Telas.Principal$6.run(Principal.java:257)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long
at com.mysql.jdbc.ConnectionImpl.buildCollationMapping(ConnectionImpl.java:1007)
… 31 more
Estou usando em um netbook o netbeans 8.2 e o mysql 5.7, mas eu fui instalar uma aplicação feita pelo mesmo netbeans, mas com o mysql 8.0.11, e deu nisso, e não sei de onde veio. No netbook funciona perfeitamente, mas chego no outro computador, da isso ai acima, alguém sabe o que acontece ou onde eu estou errando?
Agradeço ai gente.
Caso queiram ver a classe de conexão, é essa ai abaixo:
package Ferramentas;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
public class Conexao_MySQL{
public Statement stm_mysql;
public ResultSet rs_mysql;
public Connection conn_mysql;
public ImageIcon conectado;
public Integer contact_mysql;
private final String driver_mysql = "com.mysql.jdbc.Driver";
private final String caminho_mysql = "jdbc:mysql://***.*.*.*:****/*********";
private final String usuario_mysql = "root";
private final String senha_mysql = "**********";
public void link_mysql(){
try {
System.setProperty("jdbc.Driver", driver_mysql);
conn_mysql = DriverManager.getConnection(caminho_mysql, usuario_mysql, senha_mysql);
contact_mysql = 1;
} catch (SQLException ex) {
contact_mysql = 0;
Logger.getLogger(Conexao_MySQL.class.getName()).log(Level.SEVERE, null, ex);
}
}
public void executaSQL(String sql){
try {
stm_mysql = conn_mysql.createStatement(rs_mysql.TYPE_SCROLL_INSENSITIVE,rs_mysql.CONCUR_READ_ONLY);
rs_mysql = stm_mysql.executeQuery(sql);
contact_mysql = 1;
} catch (SQLException ex) {
contact_mysql = 0;
//JOptionPane.showMessageDialog(null, "Erro de ExecutaSQL!\nERRO:" + ex.getMessage());
}
}
}