MySql is a database and hence used to store data. As the name suggests, JDBC(Java database connectivity) is a set of Java APIs which enables us to connect and perform CRUD(Create, Read, Update and Delete) operations through Java on databases such as MySql, Oracle etc.
In short, When you want to access or modify data stored in MySQL database through Java code, you can use JDBC.