Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting Netbeans and MySQL but getting Big Integer error

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.

like image 509
İrem Nur Arı Avatar asked Apr 25 '18 19:04

İrem Nur Arı


People also ask

How do I establish a connection between MySQL and NetBeans?

To connect to the database server, confirm that the MySQL Database Server is running on your machine, right-click the Databases > MySQL Server node in the Services window and choose Connect. You might be prompted to supply a password to connect to the server.

How import MySQL library NetBeans?

Download ZIP Archive file which contains the JAR file of the connector. Step 2: Open the downloaded zipped folder and copy the folder present in it to some other location of your choice. Step 3: Open the Apache NetBeans and right click on the project in which you have to add the connector.


1 Answers

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

like image 81
diddie dee Avatar answered Sep 20 '22 23:09

diddie dee