(Solved) java.sql.SQLException No suitable driver found for jdbcmysql Netbeans

(Problem Solved) java.sql.SQLException No suitable driver found for jdbcmysql Netbeans

The error message “No suitable driver found for jdbc:mysql” typically indicates that the MySQL JDBC driver is not in the classpath of your application.

To fix this error, you will need to add the MySQL JDBC driver to your classpath.

Here is one way you can do this in NetBeans:

  1. Download the MySQL JDBC driver from the MySQL website (https://dev.mysql.com/downloads/connector/j/)
  2. Extract the ZIP file and copy the JAR file (e.g., mysql-connector-java-8.0.xx.jar) to a location on your computer
  3. In NetBeans, right-click on your project and select “Properties”
  4. In the “Project Properties” window, go to the “Libraries” category and click the “Add JAR/Folder” button
  5. Navigate to the location where you copied the JAR file and select it
  6. Click “OK” to close the “Project Properties” window

This should add the MySQL JDBC driver to your project’s classpath and allow you to connect to a MySQL database using the jdbc:mysql URL.

Note: Make sure that you are using the correct version of the MySQL JDBC driver for your MySQL server. For example, if you are using MySQL 8.0, you will need to use the mysql-connector-java-8.0.xx.jar driver.

Exception in thread "main" java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/test
	at java.sql.DriverManager.getConnection(DriverManager.java:689)
	at java.sql.DriverManager.getConnection(DriverManager.java:247)
	at MySqlToJtable.main(MySqlToJtable.java:28)
C:\Users\HP\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1
BUILD FAILED (total time: 0 seconds)

READ MORE  C Sharp And Ms Access Database Tutorial 22 How To Show Datagridview Selected Rows To Another Forms Datagridview

Leave a Reply

Your email address will not be published. Required fields are marked *