-1

I have downloaded MySQL driver connector for java and I add it to librairies of my project but an error occur while connecting to my database " No suitable driver found for jdbc:mysql".

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
  • 1
    There's not enough information here to answer your question. Post the code on how you're initializing the driver and the connection so we can help you out. – lscoughlin Mar 01 '20 at 11:45
  • have you included the jdbc driver jar in your project. here is a [link](https://www.mysql.com/products/connector/) to the download – fuggerjaki61 Mar 01 '20 at 11:47

1 Answers1

-1

In case the driver is not loaded, you can call the following statement before getting connection.

Class.forName("com.mysql.cj.jdbc.Driver").newInstance();

Check the link https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-usagenotes-connect-drivermanager.html

Gaurav
  • 1,570
  • 4
  • 20
  • 25