Im building Maven Java Web application and when I do
Class.forName("com.mysql.jdbc.Driver");
I get
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
mysql-connector
is added to my pom.xml
file like this
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.32</version>
<scope>provided</scope>
</dependency>
But I keep getting this. I even tried downloading mysql-connector
and adding it manually to project, but it doesn't change anything.
I also have the same app without Maven, and same code works fine