When attempting to connect to a MySQL database, you may encounter an error indicating a casting issue: "java.math.BigInteger cannot be cast to java.lang.Long." This error stems from an underlying problem in the conversion process during connection establishment.
The error message implies that the JDBC driver is trying to cast an instance of java.math.BigInteger to an instance of java.lang.Long, which is not possible as these classes are distinct. To resolve this issue, you should consider updating the MySQL Connector/J library to a more recent version.
It is possible that your current version of MySQL and MySQL Connector/J are incompatible. By upgrading to a newer version of Connector/J, such as 5.1.47 or 8.0.12, you may resolve the casting issue. The latest versions of Connector/J can be downloaded from https://dev.mysql.com/downloads/connector/j/.
Once the updated library is installed and configured, the casting error should no longer occur, allowing you to establish a successful connection to the MySQL database.
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3