We have a database on a server for our project.
When I run the program, it works completely fine. I can log in, and register another account.
But when my classmate runs the code, he gets an exception: No suitable driver found for jdbc:mysql://ServerIp//DBName
My code looks like this:
String hostURL = "jdbc:mysql://ServerIp:3306/Database"; //There's an actual ip of course
Connection con = DriverManager.getConnection(hostURL, "username", "password");
System.out.println("Connected successfully");
We've already added mysql-connector
to the dependencies (IntelliJ), but it didn't help at all.
Also, I didn't even need to add it, the project worked just fine for me without doing anything at all. The project is in Java Enterprise -> Web Application