I've been trying to set up my own rest api for a school project. I decided to use MySQL as a database and i want to connect it with my webservice, but apparently i always get this error message: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/userdatenbank
When i look at the error message, it also tells me that this code can't be executed:
public UserService() {
try {
con = DriverManager.getConnection("jdbc:mysql://localhost:3306/userdatenbank", "root", "adminadmin123");
} catch (SQLException e) {
e.printStackTrace();
}
}
I don't know why this keeps happening... The MySQL Java Connector JAR-File is located in "Referenced Libraries". By the way I use Tomcat 9, MySQL 8, JDK 13 and Maven (Jersey Servlet).