© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Java Community | Help. Code. Learn.JC|HCL
Java Community | Help. Code. Learn.•3mo ago•
31 replies
ays

MySql jdbc connection error

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?
Java Community | Help. Code. Learn.Join
We are a Community full of Java developers. Connect with other devs, get help, help others and do much more!
27,705Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Error JDBC Connection
Java Community | Help. Code. Learn.JC|HCLJava Community | Help. Code. Learn. / java-help
2y ago
JDBC connection issue
Java Community | Help. Code. Learn.JC|HCLJava Community | Help. Code. Learn. / java-help
4mo ago