There is a VERY similar question to mine but in my case I don\'t have any duplicate jars in my build path, so the solution does not work for me. I\'ve searched google for a
The others are right about making the driver JAR available to your servlet container. My comment was meant to suggest that you verify from the command line whether the driver itself is intact.
Rather than an empty main()
, try something like this, adapted from the included documentation:
public class LoadDriver {
public static void main(String[] args) throws Exception {
Class.forName("com.mysql.jdbc.Driver");
}
}
On my platform, I'd do this:
$ ls mysql-connector-java-5.1.12-bin.jar mysql-connector-java-5.1.12-bin.jar $ javac LoadDriver.java $ java -cp mysql-connector-java-5.1.12-bin.jar:. LoadDriver
On your platform, you need to use ;
as the path separator, as discussed here and here.