Install mysql on your pc. Set up the root username and password.
Start the mysql instance by activating either the batch script on windows or systemd service on linux.
Login to the mysql instance as:
mysql -u root -p
Then enter your root password. Practic some SQL queries on the mysql prompt before attemping the database problem statements.
Download the mysql connector jar and add it to the libraries of your project.
In the code, add the following line,
The above code dynamically loads the class whose name is “className”.
Dynamically load the Driver and proceed as mentioned in the code.