Full guide to install JDBC connector for Java.
You start by installing the right Database Driver for JDBC mysql-connector.
Once it’s is installed, open your java IDE in this case i use Intellij IDEA. What you want to do is to install the .jar in your project library. This you do by dragging the .jar file in your /src folder. After that what you wanna do is go to File -> Project Structure -> Libraries and add your local .jar file to the Library.