Connecting Netbeans and MySQL but getting Big Integer error

15,715

Solution 1

This is a JDBC Driver problem

I had a similar problem in netbeans. I resolved by removing the default driver (Connector/J driver) from the driver list under databases/drivers as shown below.

This happened with jdbc v8.0.12 on mysql v8.0

enter image description here

So after removing the default jdbc driver, I add an old version of the driver mysql-connector-java-5.1.47. The connection the succeeded.

enter image description here

Solution 2

What is the version of your MySQL driver and your MySQL? If you want to use MySQL 8, for example, you could try to use a MySQL driver which supports MySQL 8.

Try updating your mysql driver.

To install the driver:

1° Go to the services tab, just after databases.

2° Right click on the drivers folder and select add new driver.

3° Click add and look for the .jar of the driver you downloaded.

Solution 3

  1. Remove and clean the jdbc connector jar files already come with netbeans.
  2. Add a new connector jar file to the jdbc library.
    (You can download ==> mysql-connector-java/8.0.11
  3. Try again, connection is going to be ok now.
Share:
15,715
Admin
Author by

Admin

Updated on June 18, 2022

Comments

  • Admin
    Admin almost 2 years

    So I am trying to add new connection to my Netbeans' database which is MySQL but I am getting Big Integer casting error can someone please help me? In detail:

    I right click on existing MySQL Server at localhost:3306 [root(disconnected) >> select connect and this pops up


    Unable to connect to the MySQL server:

    org.netbeans.api.db.explorer.DatabaseException: org.netbeans.api.db.explorer.DatabaseException: java.sql.SQLException: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long.

    The server may not be running or your MySQL connection properties may not be set correctly. Do you want to edit your MySQL connection properties?


    And my basic and admin properties are OK.

    And I tried this too: Right click on databases >> select New Connection >> Driver: MySQL(Connector/J driver), JDBC URL: jdbc:mysql://localhost:3306/mysql , but when I test the connection it gives me the same error.

    **MySQL server is running.

    Thank you.