I am a beginner with Java and Xcode.
I downloaded the Java Connector/J from the internet and copied the .jar file to the following location. /Users/laurel/JavaJars/mysql-connector-java-5.0.4-bin.jar
In Xcode I added a /Users/Laurel/JavaJars to the Java Class Search Paths for the Active Target.
In the Executible target I added: -classpath /Users/laurel/JavaJars/mysql-connector-java-5.0.4-bin.jar
(I tried with and without double quotes around the file name)
Here is my code....
import java.util.*; import java.sql.*;
public class DavidJava {
public static void main (String args[]) {
try { Class.forName("com.mysql.jdbc.Driver").newInstance(); System.out.println("SUCCESS"); } catch(Exception e) { System.err.println(e.getCause()); System.err.println(e); } } }
And this is what I get when I build and run my code.
[Session started at 2007-02-17 13:58:03 -0700.] null java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
java has exited with status 0.
This class should be in the .jar file as long as it is found. No doubt I am missing something simple, but I am stuck.
Any help would be appreciated.
|