Im trying to connect my Java program to mysql using JDBC. i wrote the connection code and set the URL, username and password, but the connection keeps failing.
Im getting a classnotfound exception when I try to load the mysql driver. i have installed the MySQL connector/j .jar file, added the driver to my vsc project ,wrote the connection code using Class.forName("com.mysql.cj.jdbc.Driver"). But the program still cant find the driver.
Also, vsc is confusing me. whenever i try to create a java project, the explorer panel creates a new project every single time and it becomes a loop of multiple empty projects.
could someone guide me on what i might be doing wrong?