Cannot load JDBC driver class 'com.mysql.jdbc.Driver'




Asked on December 21, 2013
Hi All,
 I am spring security test app. I am accessing user id and password  from database. While running application got the below error. 

Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver'

I am using common dbcp to connect with my mysql. Guys  help me to solve it.




Replied on December 21, 2013
Check your pom.xml or lib directory for the  mysql-connector-java jar.

you can append below code snippet in you pom.xm

 <dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.17</version>
       </dependency>



Replied on May 14, 2017
Hi Arvind,

Wow Super man.. it is working fine .. thank you so much...



Replied on January 28, 2019
After hours of searching you have the solution. Super super man!!!!!!

Write Answer











©2024 concretepage.com | Privacy Policy | Contact Us