com.mysql.jdbc.Driver Exception
843859Nov 12 2005 — edited Nov 13 2005Well, I'm somewhat new to java and I'm trying to work with a MySQL database. Anyway, I've downloaded the mysql-connector-java-3.1.11-bin.jar file and put it in C:\
I've compiled the following code example from the MySQL Connector/J documentatoin with the use of javac.exe and everything compiles fine:
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class test
{
public static void main(String[] args)
{
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
}
catch (Exception ex)
{
System.out.println(ex.getMessage()); // handle the error
}
}
}
Then I run it with:
java.exe -classpath C:\ test and I receive the exception message:
com.mysql.jdbc.Driver
I have looked around on the web for but can't seem to find a solution (even though this seems to be a common problem). Wondering if anyone can help me? Thanks in advance.