I\'m trying to add a database-enabled JSP to an existing Tomcat 5.5 application (GeoServer 2.0.0, if that helps).
The app itself talks to Postgres just fine, so I kn
In my case I was working on a Java project with Maven and encountered this error. In your pom.xml file make sure you have this dependencies
junit
junit
4.11
test
mysql
mysql-connector-java
8.0.11
and where you create connection have something like this
public Connection createConnection() {
try {
String url = "jdbc:mysql://localhost:3306/yourDatabaseName";
String username = "root"; //your my sql username here
String password = "1234"; //your mysql password here
Class.forName("com.mysql.cj.jdbc.Driver");
return DriverManager.getConnection(url, username, password);
} catch (SQLException | ClassNotFoundException e) {
e.printStackTrace();
}
return null;
}