启动以后报java.math.BigInteger cannot be cast to java.lang.Long等错误
使用Mysql8.0后依然使用5.0的Jar包连接导致直接报错java.math.BigInteger cannot be cast to java.lang.Long,更新Jar包后。
原来5.0版本连接mysql的连接方式:
1 Class.forName("com.mysql.jdbc.Driver"); 2 System.out.println("数据库加载成功!"); 3 Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/db1?" "root", "root");
使用新的Jar包之后连接方式有所改变,如下呈现。
1 Class.forName("com.mysql.cj.jdbc.Driver"); 2 System.out.println("数据库加载成功!"); 3 Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/db1?useSSL=false&serverTimezone=Asia/Shanghai", "root", "root");
mysql-connection-8.0百度云盘下载地址:https://pan.baidu.com/s/126qznRNfg6A81ltkcNGiOQ 提取码:k0sv
原文地址:https://www.cnblogs.com/XjStudy/p/10426154.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。