Cannot load driver class:com.mysql.jdbc.Driver
How to add a JDBC driver in the pom file
To-start with, the jar that I need to connect to MySQL 5.5 should have been Mysql-connector-java-5.1.15-bin.jar but Sql-connector-java-5.1.15.jar. Secondly, this jar isn't available in Maven repository so I needed to manually add it to M Y local maven repository and then added it as a dependency to my pom.xml.
Adding Mysql-connector-java-5.1.15.jar to the local maven repository by MVN install:install-file-dfile=c:\libraries\ Mysql-connector-java-5.1.15-bin\mysql-connector-java-5.1.15-bin.jar-dgroupid=mysql-dartifactid= Mysql-connector-java-dversion=5.1.15-bin-dpackaging=jar and then adding the following dependency to Pom.xml of the Proje Ct.
<!--MYSQL 5.5 Connector-->
<dependency>
<groupId>mysql</groupId>
< Artifactid>mysql-connector-java</artifactid>
<version>5.1.15-bin</version>
This is not done yet and you need to add <scope> tags before you can use
<!--MYSQL 5.5 Connector-->
<dependency>
<groupId>mysql</groupId>
< artifactid>mysql-connector-java</artifactid>
<version>5.1.15-bin</version>
< Scope>runtime</scope>
</dependency>