I'm not certain, but I suspect that Jan is talking about your CLASSPATH environment variable. If you're on Windows you can go to your System Properties window, click on Environment Variables then on you CLASSPATH variable.
You can view it from a command prompt by entering the command:
> ECHO %CLASSPATH%
Again, I'm not sure that what was meant but give it a shot. You may want to save a copy of that variable before you start changing it. It's a list of folders on your system delimited by semi-colons (;).
However in Eclipse you don't have to fool around with the CLASSPATH environment variable. You just have to set your project's build path appropriately.
To me that error message looks like whatever you put into the build path claiming to be the Connector/J jar file isn't a jar file.
Joined: May 12, 2011
Thank you all for your suggestions. Finally the program runs without this error.
I downloaded the jar multiple times and used it in the build path. Still got the same error.
So after some googling I found that sometimes the error goes away if new Java updates are installed.
So I installed java 7(had Java 6 previously) and the latest version of Eclipse and it works!!
So the changes I made are:
1) Latest version of Java and Eclipse
2) Download the rar file for Connector J from MySql.org and extract the entire file into Eclipse workspace.
3) Java Build Path - Add external jar- add the above jar