I am using Eclipse 3.1 under Mac OS X 10.4.4. I just downloaded MySQL.
I installed MySQL successfully. I am able to create databases and
tables. And I am able to load them and run queries by running mysql.app.
I downloaded mysql-connector-java-3.0.17-ga and I have a .jar file but I
don't know how to tell Eclipse to look for it. Should I move the .jar
file somewhere, or do I have to do something in Eclipse?
Here is the code I copied:
//---------------------------------------
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
// Notice, do not import com.mysql.jdbc.*
// or you will have problems!
public class LoadDriver {
public static void main(String[] args) {
try { // The newInstance() call is a work around for
//some
// broken Java implementations
Class.forName("com.mysql.jdbc.Driver").newInstance();
} catch (Exception ex) {
System.out.print(ex.toString());
}
}
}
//_________________________________
I get java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
>I downloaded mysql-connector-java-3.0.17-ga and I have a .jar file but I
>don't know how to tell Eclipse to look for it. Should I move the .jar
>file somewhere, or do I have to do something in Eclipse?
Right click on your project | properties | java build path
Add your jars in there.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
DrMatrix - 16 Jan 2006 05:12 GMT
> >I downloaded mysql-connector-java-3.0.17-ga and I have a .jar file but I
> >don't know how to tell Eclipse to look for it. Should I move the .jar
[quoted text clipped - 3 lines]
>
> Add your jars in there.
That did the trick.
Thank you.