

This will load the > from mysql-connector-java-5.0.8.jar and register it with JDBC API.
#Com mysql jdbc driver download code#
If you don’t have MySQL JDBC driver, you can download from here Ģ) Add following line of code just before the call to Connection.getConnection(url, props) method You need to do two things in order to solve this problem:ġ) Add mysql-connector-java-5.0.8.jar or any other MySQL JAR corresponding to the MySQL database you are connecting. This program reproduce this error by first leaving out the required JDBC JAR from classpath and also not explicitly registering the driver before use by not calling Class.forName() method. Here is our Java program to demonstrate this error.


JAR not available in > ": No suitable driver found for jdbc:mysql://localhost:3306/test" because of the JDBC URL format "jdbc:mysql" is not matching with any registered JDBC driver. We’ll see these reasons in more detail in this article. mysql-connector-java-5.0.8.jar not available in >getConnection() and you are running on Java version lower than 6 and not using a JDBC 4.0 compliant driver. Most common reason of this error is missing MySQL JDBC Driver JAR e.g. Since JDBC API is part of JDK itself, when you write a Java program to connect any database like MySQL, SQL Server or Oracle, everything compiles fine, as you only use classes from JDK but at runtime, when the JDBC driver which is required to connect to database is not available, JDBC API either throws this error or ": ". The error ": No suitable driver found for jdbc:mysql://localhost:3306/test" occurs when you try to connect MySQL database running on your localhost, listening on port 3306 port from Java program but either you don’t have MySQL JDBC driver in your >getConnection() method.
