I am getting class not found com.mysql.jdbc.driver error while connecting servlet with jdbc .But when I am connect alone with jdbc it works fine.
Asked
Active
Viewed 18 times
0
-
That means either that the driver JAR is not on the classpath (e.g. it isn't in the WAR file), or that you are using the wrong classname for the driver class. It also probably means that you are using the outdated `Class.forName` approach for loading the driver. See the Oracle JDBC tutorial for the recommended way. – Stephen C Aug 05 '21 at 00:58
-
See https://stackoverflow.com/questions/5484227 – Stephen C Aug 05 '21 at 01:32
-
I try both classname and add drivers also – Prakash Dash Aug 06 '21 at 08:29
-
Did you try the approach in https://stackoverflow.com/questions/5484227 ? Note that this is a common problem, and the common solutions >do< work ... if you do them correctly. – Stephen C Aug 06 '21 at 10:34